Skip to content

Commit

Permalink
Timeout property on ncclient.Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
shikhar committed Mar 13, 2011
1 parent b484869 commit 98f9e16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/source/manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Presence of capabilities is verified to the extent possible, and you can expect

.. autoattribute:: async_mode

.. autoattribute:: timeout

.. autoattribute:: raise_mode

.. autoattribute:: client_capabilities
Expand Down
5 changes: 5 additions & 0 deletions ncclient/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ def __exit__(self, *args):
self.close_session()
return False

def __set_timeout(self, timeout):
self._timeout = timeout

def __set_async_mode(self, mode):
self._async_mode = mode

Expand Down Expand Up @@ -165,6 +168,8 @@ def connected(self):
async_mode = property(fget=lambda self: self._async_mode, fset=__set_async_mode)
"Specify whether operations are executed asynchronously (`True`) or synchronously (`False`) (the default)."

timeout = property(fget=lambda self: self._timeout, fset=__set_timeout)
"Specify the timeout for synchronous RPC requests."

raise_mode = property(fget=lambda self: self._raise_mode, fset=__set_raise_mode)
"Specify which errors are raised as :exc:`~ncclient.operations.RPCError` exceptions. Valid values are the constants defined in :class:`~ncclient.operations.RaiseMode`. The default value is :attr:`~ncclient.operations.RaiseMode.ALL`."

0 comments on commit 98f9e16

Please sign in to comment.