[node-patches] Change in ovirt-node[master]: ui: Remove unused code from config.defaults

fabiand at fedoraproject.org fabiand at fedoraproject.org
Mon Jan 28 17:34:52 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: ui: Remove unused code from config.defaults
......................................................................

ui: Remove unused code from config.defaults

… to prevent user/developer irritations.

Change-Id: Icd2b700cf2a4347975008885fb884fcce112c82d
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/config/defaults.py
1 file changed, 1 insertion(+), 29 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/75/11475/1

diff --git a/scripts/tui/src/ovirt/node/config/defaults.py b/scripts/tui/src/ovirt/node/config/defaults.py
index ebb20bc..774594c 100644
--- a/scripts/tui/src/ovirt/node/config/defaults.py
+++ b/scripts/tui/src/ovirt/node/config/defaults.py
@@ -45,36 +45,8 @@
 OVIRT_NODE_DEFAULTS_FILENAME = "/etc/default/ovirt"
 
 
-class AugeasProvider(base.Base):
-    def __init__(self, filename):
-        super(AugeasProvider, self).__init__()
-        self.filename = filename
-
-    def update(self, new_dict, remove_empty):
-        aug = utils.AugeasWrapper()
-        basepath = "/files/%s/" % self.filename.strip("/")
-        if new_dict:
-            # If values are given, update the file
-            LOGGER.debug("Updating oVirtNode defaults file '%s': %s %s" %
-                         (self.filename, new_dict, basepath))
-            aug.set_many(new_dict, basepath)
-
-            if remove_empty:
-                paths_to_be_removed = [p for p, v in new_dict.items()
-                                       if v is None]
-                aug.remove_many(paths_to_be_removed, basepath)
-
-    def get_dict(self):
-        aug = utils.AugeasWrapper()
-        basepath = "/files/%s/" % self.filename.strip("/")
-
-        # Retrieve all entries of the default file and return their values
-        paths = aug.match(basepath + "*")
-        return aug.get_many(paths, strip_basepath=basepath)
-
-
 class SimpleProvider(base.Base):
-    """Can write our simple configuration file
+    """SimpleProvider writes simple KEY=VALUE (shell-like) configuration file
 
     >>> fn = "/tmp/cfg_dummy.simple"
     >>> open(fn, "w").close()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd2b700cf2a4347975008885fb884fcce112c82d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list