[node-patches] Change in ovirt-node[master]: enhance the function clear() of class NodeConfigFileSection

hadong0720 at gmail.com hadong0720 at gmail.com
Wed Dec 25 09:07:45 UTC 2013


hadong has uploaded a new change for review.

Change subject: enhance the function clear() of class NodeConfigFileSection
......................................................................

enhance the function clear() of class NodeConfigFileSection

Previously if using clear() will remove all item from configuration.
Now the user could definite which item removed.

Change-Id: I814cce21fef6865302f044d09a1d2377425c87a1
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/config/defaults.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/29/22729/1

diff --git a/src/ovirt/node/config/defaults.py b/src/ovirt/node/config/defaults.py
index befacfd..661dcd5 100644
--- a/src/ovirt/node/config/defaults.py
+++ b/src/ovirt/node/config/defaults.py
@@ -138,9 +138,10 @@
         assert len(keys_to_args) == len(model)
         return model
 
-    def clear(self):
+    def clear(self, keys=None):
         """Remove the configuration for this item
         """
+        keys = keys or self.keys
         cfg = self.raw_file.get_dict()
         to_be_deleted = dict((k, None) for k in self.keys)
         cfg.update(to_be_deleted)


-- 
To view, visit http://gerrit.ovirt.org/22729
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I814cce21fef6865302f044d09a1d2377425c87a1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list