Revision 6c70b245 ncclient/manager.py

b/ncclient/manager.py
35 35
#: Same as :meth:`connect_ssh`
36 36
connect = connect_ssh
37 37

  
38
class RAISE:
39
    ALL = 0
40
    ERRORS = 1
41
    NONE = 2
42

  
43 38
class Manager(object):
44 39

  
45 40
    """API for NETCONF operations.
......
51 46
        self._session = session
52 47
        self._async_mode = False
53 48
        self._timeout = None
49
        self._raise_mode = 'all'
54 50

  
55 51
    def __enter__(self):
56 52
        return self
......
67 63
        else:
68 64
            return op(self.session,
69 65
                      async=self._async_mode,
70
                      raising=self._raise_mode,
71
                      timeout=self.timeout).request
66
                      timeout=self.timeout,
67
                      raise_mode=self._raise_mode).request
72 68

  
73 69
    def locked(self, target):
74 70
        """Returns a context manager for the *with* statement.
......
116 112
    def set_async_mode(self, bool=True):
117 113
        self._async_mode = bool
118 114

  
119
    def set_raise_mode(self, choice='all'):
120
        self._raise_mode = choice
115
    def set_raise_mode(self, mode):
116
        assert(choice in ('all', 'errors', 'none'))
117
        self._raise_mode = mode
121 118

  
122 119
    async_mode = property(fget=lambda self: self._async_mode, fset=set_async_mode)
123 120

  

Also available in: Unified diff