Revision 66cd54c8
b/ncclient/manager.py | ||
---|---|---|
132 | 132 |
self._session.close() |
133 | 133 |
|
134 | 134 |
@property |
135 |
def session(self, session):
|
|
135 |
def session(self): |
|
136 | 136 |
":class:`~ncclient.transport.Session` instance" |
137 | 137 |
return self._session |
138 | 138 |
|
b/ncclient/operations/__init__.py | ||
---|---|---|
31 | 31 |
'delete-config': DeleteConfig, |
32 | 32 |
'lock': Lock, |
33 | 33 |
'unlock': Unlock, |
34 |
'close_session': CloseSession,
|
|
34 |
'close-session': CloseSession,
|
|
35 | 35 |
'kill-session': KillSession, |
36 | 36 |
} |
37 | 37 |
|
b/ncclient/operations/rpc.py | ||
---|---|---|
291 | 291 |
""" |
292 | 292 |
logger.debug('request %r with opsepc=%r' % (self, op)) |
293 | 293 |
req = self._build(op) |
294 |
self.session.send(req) |
|
295 |
if self.async: |
|
294 |
self._session.send(req)
|
|
295 |
if self._async:
|
|
296 | 296 |
logger.debug('async, returning event') |
297 |
return self.event |
|
297 |
return self._event
|
|
298 | 298 |
else: |
299 |
logger.debug('sync, will wait for timeout=%r' % self.timeout) |
|
300 |
self.event.wait(self.timeout)
|
|
301 |
if self.event.isSet(): |
|
302 |
if self.error: |
|
299 |
logger.debug('sync, will wait for timeout=%r' % self._timeout)
|
|
300 |
self._event.wait(self._timeout)
|
|
301 |
if self._event.isSet():
|
|
302 |
if self._error:
|
|
303 | 303 |
raise self._error |
304 |
self.reply.parse() |
|
305 |
return self.reply |
|
304 |
self._reply.parse()
|
|
305 |
return self._reply
|
|
306 | 306 |
else: |
307 | 307 |
raise TimeoutExpiredError |
308 | 308 |
|
b/ncclient/transport/session.py | ||
---|---|---|
18 | 18 |
from ncclient import content |
19 | 19 |
from ncclient.capabilities import Capabilities |
20 | 20 |
|
21 |
from errors import TransportError |
|
22 |
|
|
21 | 23 |
import logging |
22 | 24 |
logger = logging.getLogger('ncclient.transport.session') |
23 | 25 |
|
... | ... | |
138 | 140 |
|
139 | 141 |
:type message: `string` |
140 | 142 |
""" |
143 |
if not self.connected: |
|
144 |
raise TransportError('Not connected to NETCONF server') |
|
141 | 145 |
logger.debug('queueing %s' % message) |
142 | 146 |
self._q.put(message) |
143 | 147 |
|
... | ... | |
184 | 188 |
allows the callback to determine whether it wants to further process the |
185 | 189 |
document. |
186 | 190 |
|
187 |
:arg root: is a tuple of `(tag, attributes)` where `tag` is the qualified name of the root element and `attributes` is a dictionary of its attributes (also qualified names)
|
|
191 |
:arg root: tuple of `(tag, attributes)` where `tag` is the qualified name of the root element and `attributes` is a dictionary of its attributes (also qualified names) |
|
188 | 192 |
:type root: `tuple` |
189 | 193 |
|
190 | 194 |
:arg raw: XML document |
Also available in: Unified diff