Revision 541247ba ncclient/operations/reply.py

b/ncclient/operations/reply.py
31 31
        return self._raw
32 32
    
33 33
    def parse(self):
34
        if self._parsed: return
34 35
        root = ET.fromstring(self._raw) # <rpc-reply> element
35 36
        
36 37
        # per rfc 4741 an <ok/> tag is sent when there are no errors or warnings
37 38
        oktags = _('ok')
38 39
        for oktag in oktags:
39 40
            if root.find(oktag) is not None:
40
                logger.debug('found %s' % oktag)
41
                logger.debug('parsed [%s]' % oktag)
41 42
                self._parsed = True
42 43
                return
43 44
        
......
45 46
        errtags = _('rpc-error')
46 47
        for errtag in errtags:
47 48
            for err in root.getiterator(errtag): # a particular <rpc-error>
49
                logger.debug('parsed [%s]' % errtag)
48 50
                d = {}
49 51
                for err_detail in err.getchildren(): # <error-type> etc..
50
                    d[__(err_detail)] = err_detail.text
52
                    d[__(err_detail.tag)] = err_detail.text
51 53
                self._errors.append(RPCError(d))
52 54
            if self._errors:
53 55
                break
......
128 130
    
129 131
    items = lambda self: self._dict.items()
130 132
    
131
    __repr__ = lambda self: repr(self._dict)
133
    __repr__ = lambda self: repr(self._dict)

Also available in: Unified diff