Revision 94803aaf ncclient/rpc/reply.py
b/ncclient/rpc/reply.py | ||
---|---|---|
18 | 18 |
from ncclient.content import unqualify as __ |
19 | 19 |
|
20 | 20 |
import logging |
21 |
logger = logging.getLogger('ncclient.operations.reply')
|
|
21 |
logger = logging.getLogger('ncclient.rpc.reply')
|
|
22 | 22 |
|
23 | 23 |
class RPCReply: |
24 | 24 |
|
25 | 25 |
def __init__(self, raw): |
26 | 26 |
self._raw = raw |
27 | 27 |
self._parsed = False |
28 |
self._root = None |
|
28 | 29 |
self._errors = [] |
29 | 30 |
|
30 | 31 |
def __repr__(self): |
... | ... | |
32 | 33 |
|
33 | 34 |
def parse(self): |
34 | 35 |
if self._parsed: return |
35 |
root = ET.fromstring(self._raw) # <rpc-reply> element |
|
36 |
root = self._root = ET.fromstring(self._raw) # <rpc-reply> element
|
|
36 | 37 |
|
37 | 38 |
if __(root.tag) != 'rpc-reply': |
38 | 39 |
raise ValueError('Root element is not RPC reply') |
... | ... | |
66 | 67 |
return self._raw |
67 | 68 |
|
68 | 69 |
@property |
70 |
def root(self): |
|
71 |
return self._root |
|
72 |
|
|
73 |
@property |
|
69 | 74 |
def ok(self): |
70 | 75 |
if not self._parsed: self.parse() |
71 | 76 |
return not self._errors # empty list => false |
Also available in: Unified diff