ordering of params for <edit-config> operation
authorShikhar Bhushan <shikhar@schmizz.net>
Tue, 19 May 2009 10:45:34 +0000 (10:45 +0000)
committerShikhar Bhushan <shikhar@schmizz.net>
Tue, 19 May 2009 10:45:34 +0000 (10:45 +0000)
git-svn-id: http://ncclient.googlecode.com/svn/trunk@143 6dbcf712-26ac-11de-a2f3-1373824ab735

ncclient/operations/edit.py
test.py [deleted file]

index aef5a90..9d360c9 100644 (file)
@@ -47,7 +47,10 @@ class EditConfig(RPC):
         :arg default_operation: optional; one of {'merge', 'replace', 'none'}
         :type default_operation: `string`
 
-        :arg test_option: optional; one of {'stop-on-error', 'continue-on-error', 'rollback-on-error'}. Last option depends on the *:rollback-on-error* capability
+        :arg error_option: optional; one of {'stop-on-error', 'continue-on-error', 'rollback-on-error'}. Last option depends on the *:rollback-on-error* capability
+        :type error_option: string
+
+        :arg test_option: optional; one of {'test-then-set', 'set'}. Depends on *:validate* capability.
         :type test_option: string
 
         :seealso: :ref:`return`
@@ -55,7 +58,6 @@ class EditConfig(RPC):
         spec = deepcopy(EditConfig.SPEC)
         subtree = spec['subtree']
         subtree.append(util.store_or_url('target', target, self._assert))
-        subtree.append(content.validated_element(config, ('config', content.qualify('config'))))
         if default_operation is not None:
             subtree.append({
                 'tag': 'default-operation',
@@ -74,6 +76,7 @@ class EditConfig(RPC):
                 'tag': 'error-option',
                 'text': error_option
                 })
+        subtree.append(content.validated_element(config, ('config', content.qualify('config'))))
         return self._request(spec)
 
 class DeleteConfig(RPC):
diff --git a/test.py b/test.py
deleted file mode 100644 (file)
index f5de968..0000000
--- a/test.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from ncclient import manager
-
-import logging
-logging.basicConfig(level=logging.DEBUG)
-
-with manager.connect('broccoli', 22, username='sbhushan') as m:
-    with m.locked('candidate'):
-        reply = m.copy_config(source='running', target='candidate')
-
-print reply