misc; no functional changes
authorShikhar Bhushan <shikhar@schmizz.net>
Wed, 20 May 2009 03:05:39 +0000 (03:05 +0000)
committerShikhar Bhushan <shikhar@schmizz.net>
Wed, 20 May 2009 03:05:39 +0000 (03:05 +0000)
git-svn-id: http://ncclient.googlecode.com/svn/trunk@145 6dbcf712-26ac-11de-a2f3-1373824ab735

ncclient/operations/edit.py
ncclient/operations/rpc.py

index 9d360c9..f123d50 100644 (file)
@@ -58,10 +58,12 @@ class EditConfig(RPC):
         spec = deepcopy(EditConfig.SPEC)
         subtree = spec['subtree']
         subtree.append(util.store_or_url('target', target, self._assert))
-        if default_operation is not None:
+        if error_option is not None:
+            if error_option == 'rollback-on-error':
+                self._assert(':rollback-on-error')
             subtree.append({
-                'tag': 'default-operation',
-                'text': default_operation
+                'tag': 'error-option',
+                'text': error_option
                 })
         if test_option is not None:
             self._assert(':validate')
@@ -69,12 +71,10 @@ class EditConfig(RPC):
                 'tag': 'test-option',
                 'text': test_option
                 })
-        if error_option is not None:
-            if error_option == 'rollback-on-error':
-                self._assert(':rollback-on-error')
+        if default_operation is not None:
             subtree.append({
-                'tag': 'error-option',
-                'text': error_option
+                'tag': 'default-operation',
+                'text': default_operation
                 })
         subtree.append(content.validated_element(config, ('config', content.qualify('config'))))
         return self._request(spec)
index 2071b7c..aba6c00 100644 (file)
@@ -113,7 +113,7 @@ class RPCReply:
 class RPCError(OperationError): # raise it if you like
 
     """Represents an *<rpc-error>*. It is an instance of :exc:`OperationError`
-    so it can be raised like any other exception."""
+    and can be raised like any other exception."""
 
     def __init__(self, err_dict):
         self._dict = err_dict
@@ -124,32 +124,32 @@ class RPCError(OperationError): # raise it if you like
 
     @property
     def type(self):
-        "`string` represeting *error-type* element"
+        "`string` representing text of *error-type* element"
         return self.get('error-type', None)
 
     @property
     def severity(self):
-        "`string` represeting *error-severity* element"
+        "`string` representing text of *error-severity* element"
         return self.get('error-severity', None)
 
     @property
     def tag(self):
-        "`string` represeting *error-tag* element"
+        "`string` representing text of *error-tag* element"
         return self.get('error-tag', None)
 
     @property
     def path(self):
-        "`string` or :const:`None`; represeting *error-path* element"
+        "`string` or :const:`None`; representing text of *error-path* element"
         return self.get('error-path', None)
 
     @property
     def message(self):
-        "`string` or :const:`None`; represeting *error-message* element"
+        "`string` or :const:`None`; representing text of *error-message* element"
         return self.get('error-message', None)
 
     @property
     def info(self):
-        "`string` or :const:`None`, represeting *error-info* element"
+        "`string` (XML) or :const:`None`, representing *error-info* element"
         return self.get('error-info', None)
 
     ## dictionary interface