Revision 188649fa

b/ncclient/operations/rpc.py
268 268
    def _build(self, opspec):
269 269
        # internal
270 270
        spec = {
271
            'tag': content.qualify('rpc'),
272
            'attrib': {'message-id': self._id},
271
            'tag': 'rpc',
272
            'attrib': {
273
                'xmlns': content.BASE_NS,
274
                'message-id': self._id
275
                },
273 276
            'subtree': [ opspec ]
274 277
            }
275 278
        return content.dtree2xml(spec)
b/ncclient/operations/util.py
44 44
    type = None
45 45
    if isinstance(spec, tuple):
46 46
        type, criteria = spec
47
        rep = {
48
            'tag': 'filter',
49
            'attrib': {'type': type},
50
            'subtree': criteria
51
        }
47
        rep = {'tag': 'filter', 'attrib': {'type': type}}
48
        if type == 'xpath':
49
            rep['attrib']['select'] = criteria
50
        elif type == 'subtree':
51
            rep['subtree'] = criteria
52
        else:
53
            raise OperationError("Invalid filter type")
52 54
    else:
53 55
        rep = content.validated_element(spec, ['filter', content.qualify('filter')],
54 56
                                        attrs=[('type', content.qualify('type'))])
55
        try:
56
            type = rep['type']
57
        except KeyError:
58
            type = ele[content.qualify('type')]
59 57
    if type == 'xpath' and capcheck is not None:
60 58
        capcheck(':xpath')
61 59
    return rep
b/ncclient/transport/errors.py
23 23
class SessionCloseError(TransportError):
24 24

  
25 25
    def __init__(self, in_buf, out_buf=None):
26
        msg = 'Unexpected session close.'
26
        msg = 'Unexpected session close'
27 27
        if in_buf:
28
            msg += ' IN_BUFFER: {%s}' % in_buf
28
            msg += '\nIN_BUFFER: {%s}' % in_buf
29 29
        if out_buf:
30 30
            msg += ' OUT_BUFFER: {%s}' % out_buf
31 31
        SSHError.__init__(self, msg)

Also available in: Unified diff