Revision 179b00d4 ncclient/operations/retrieve.py

b/ncclient/operations/retrieve.py
18 18

  
19 19
class GetReply(RPCReply):
20 20
    
21
    # tested: no
22
    
23
    def __init__(self, *args, **kwds):
24
        RPCReply.__init__(self, *args, **kwds)
25
        self._data = None
26
    
21 27
    def parse(self):
22 28
        RPCReply.parse(self)
29
        if self.ok:
30
            self.root.find('data')
23 31
    
24 32
    @property
25 33
    def data(self):
26
        return None
34
        return ET.tostring(self._data)
27 35

  
28 36
class Get(RPC):
29 37
    
38
    # tested: no
39
    
30 40
    SPEC = {
31 41
        'tag': 'get',
32
        'children': []
42
        'subtree': []
33 43
    }
34 44
    
35 45
    REPLY_CLS = GetReply
......
37 47
    def request(self, filter=None):
38 48
        spec = Get.SPEC.copy()
39 49
        if filter is not None:
40
            spec['children'].append(util.build_filter(*filter))
50
            spec['subtree'].append(util.build_filter(*filter))
41 51
        return self._request(spec)
42 52

  
43 53
class GetConfig(RPC):
44 54
    
45 55
    SPEC = {
46 56
        'tag': 'get-config',
47
        'children': []
57
        'subtree': []
48 58
    }
49 59
    
50 60
    REPLY_CLS = GetReply
......
52 62
    def request(self, source=None, source_url=None, filter=None):
53 63
        util.one_of(source, source_url)
54 64
        spec = GetConfig.SPEC.copy()
55
        children = spec['children']
56
        children.append({'tag': 'source', 'children': util.store_or_url(source, source_url)})
65
        subtree = spec['subtree']
66
        subtree.append({'tag': 'source', 'subtree': util.store_or_url(source, source_url)})
57 67
        if filter is not None:
58
            children.append(util.build_filter(*filter))
68
            subtree.append(util.build_filter(*filter))
59 69
        return self._request(spec)

Also available in: Unified diff