Revision d771dffc ncclient/operations/retrieve.py

b/ncclient/operations/retrieve.py
28 28
    def _parsing_hook(self, root):
29 29
        self._data = None
30 30
        if not self._errors:
31
            self._data = content.namespaced_find(root, 'data')
31
            self._data = content.find(root, 'data')
32 32
    
33 33
    @property
34
    def data_element(self):
34
    def data(self):
35 35
        if not self._parsed:
36 36
            self.parse()
37 37
        return self._data
38
    
39
    @property
40
    def data_xml(self):
41
        return content.element2string(self.data_element)
42
    
43
    data = data_element
44 38

  
45 39
class Get(RPC):
46 40
    
......
57 51
    def request(self, filter=None):
58 52
        spec = Get.SPEC.copy()
59 53
        if filter is not None:
60
            spec['subtree'].append(util.build_filter(filter)))
54
            spec['subtree'].append(util.build_filter(filter))
61 55
        return self._request(spec)
62 56

  
57

  
63 58
class GetConfig(RPC):
64 59

  
65 60
    # tested: no
......
72 67
    
73 68
    REPLY_CLS = GetReply
74 69
    
75
    def request(self, source=None, source_url=None, filter=None):
70
    def request(self, source, filter=None):
76 71
        """
77 72
        `filter` has to be a tuple of (type, criteria)
78 73
        The type may be one of 'xpath' or 'subtree'
79 74
        The criteria may be an ElementTree.Element, an XML fragment, or tree specification
80 75
        """
81 76
        spec = GetConfig.SPEC.copy()
82
        spec['subtree'].append({
83
            'tag': 'source',
84
            'subtree': util.store_or_url(source, source_url)
85
            })
77
        spec['subtree'].append(util.store_or_url('source', source, self._assert))
86 78
        if filter is not None:
87 79
            spec['subtree'].append(util.build_filter(filter))
88 80
        return self._request(spec)
89

  

Also available in: Unified diff