Revision ce5fb329
b/ncclient/operations/edit.py | ||
---|---|---|
12 | 12 |
# See the License for the specific language governing permissions and |
13 | 13 |
# limitations under the License. |
14 | 14 |
|
15 |
from copy import deepcopy |
|
16 |
|
|
15 | 17 |
from ncclient import content |
16 | 18 |
|
17 | 19 |
from rpc import RPC |
... | ... | |
48 | 50 |
|
49 | 51 |
:seealso: :ref:`return` |
50 | 52 |
""" |
51 |
spec = EditConfig.SPEC.copy()
|
|
53 |
spec = deepcopy(EditConfig.SPEC)
|
|
52 | 54 |
subtree = spec['subtree'] |
53 | 55 |
subtree.append(util.store_or_url('target', target, self._assert)) |
54 | 56 |
subtree.append(content.validated_element(config, ('config', content.qualify('config')))) |
... | ... | |
85 | 87 |
|
86 | 88 |
:seealso: :ref:`return` |
87 | 89 |
""" |
88 |
spec = DeleteConfig.SPEC.copy()
|
|
90 |
spec = deepcopy(DeleteConfig.SPEC)
|
|
89 | 91 |
spec['subtree'].append(util.store_or_url('target', target, self._assert)) |
90 | 92 |
return self._request(spec) |
91 | 93 |
|
... | ... | |
108 | 110 |
|
109 | 111 |
:seealso: :ref:`return` |
110 | 112 |
""" |
111 |
spec = CopyConfig.SPEC.copy()
|
|
113 |
spec = deepcopy(CopyConfig.SPEC)
|
|
112 | 114 |
spec['subtree'].append(util.store_or_url('target', target, self._assert)) |
113 | 115 |
spec['subtree'].append(util.store_or_url('source', source, self._assert)) |
114 | 116 |
return self._request(spec) |
... | ... | |
131 | 133 |
|
132 | 134 |
:seealso: :ref:`return` |
133 | 135 |
""" |
134 |
spec = Validate.SPEC.copy()
|
|
136 |
spec = deepcopy(Validate.SPEC)
|
|
135 | 137 |
try: |
136 | 138 |
src = content.validated_element(source, ('config', content.qualify('config'))) |
137 | 139 |
except Exception as e: |
... | ... | |
168 | 170 |
|
169 | 171 |
:seealso: :ref:`return` |
170 | 172 |
""" |
171 |
spec = SPEC.copy()
|
|
173 |
spec = deepcopy(Commit.SPEC)
|
|
172 | 174 |
if confirmed: |
173 | 175 |
self._assert(':confirmed-commit') |
174 | 176 |
spec['subtree'].append({'tag': 'confirmed'}) |
b/ncclient/operations/lock.py | ||
---|---|---|
14 | 14 |
|
15 | 15 |
'Locking-related NETCONF operations' |
16 | 16 |
|
17 |
from copy import deepcopy |
|
18 |
|
|
17 | 19 |
from rpc import RPC |
18 | 20 |
|
19 | 21 |
class Lock(RPC): |
... | ... | |
37 | 39 |
|
38 | 40 |
:rtype: :ref:`return` |
39 | 41 |
""" |
40 |
spec = Lock.SPEC.copy()
|
|
42 |
spec = deepcopy(Lock.SPEC)
|
|
41 | 43 |
spec['subtree']['subtree']['tag'] = target |
42 | 44 |
return self._request(spec) |
43 | 45 |
|
... | ... | |
63 | 65 |
|
64 | 66 |
:rtype: :ref:`return` |
65 | 67 |
""" |
66 |
spec = Unlock.SPEC.copy()
|
|
68 |
spec = deepcopy(Unlock.SPEC)
|
|
67 | 69 |
spec['subtree']['subtree']['tag'] = target |
68 | 70 |
return self._request(spec) |
69 | 71 |
|
b/ncclient/operations/retrieve.py | ||
---|---|---|
15 | 15 |
from rpc import RPC, RPCReply |
16 | 16 |
|
17 | 17 |
from ncclient import content |
18 |
from copy import deepcopy |
|
18 | 19 |
|
19 | 20 |
import util |
20 | 21 |
|
... | ... | |
71 | 72 |
|
72 | 73 |
:seealso: :ref:`return` |
73 | 74 |
""" |
74 |
spec = Get.SPEC.copy()
|
|
75 |
spec = deepcopy(Get.SPEC)
|
|
75 | 76 |
if filter is not None: |
76 | 77 |
spec['subtree'].append(util.build_filter(filter)) |
77 | 78 |
return self._request(spec) |
... | ... | |
95 | 96 |
|
96 | 97 |
:seealso: :ref:`return` |
97 | 98 |
""" |
98 |
spec = GetConfig.SPEC.copy()
|
|
99 |
spec = deepcopy(GetConfig.SPEC)
|
|
99 | 100 |
spec['subtree'].append(util.store_or_url('source', source, self._assert)) |
100 | 101 |
if filter is not None: |
101 | 102 |
spec['subtree'].append(util.build_filter(filter)) |
b/ncclient/operations/session.py | ||
---|---|---|
14 | 14 |
|
15 | 15 |
'Session-related NETCONF operations' |
16 | 16 |
|
17 |
from copy import deepcopy |
|
18 |
|
|
17 | 19 |
from rpc import RPC |
18 | 20 |
|
19 | 21 |
class CloseSession(RPC): |
... | ... | |
48 | 50 |
|
49 | 51 |
:seealso: :ref:`return` |
50 | 52 |
""" |
51 |
spec = KillSession.SPEC.copy()
|
|
53 |
spec = deepcopy(KillSession.SPEC)
|
|
52 | 54 |
if not isinstance(session_id, basestring): # make sure |
53 | 55 |
session_id = str(session_id) |
54 | 56 |
spec['subtree'].append({ |
Also available in: Unified diff