[node-patches] Change in ovirt-node[master]: Add a basepath to AugeasWrapper's get_many

rbarry at redhat.com rbarry at redhat.com
Tue Jul 29 14:00:05 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Add a basepath to AugeasWrapper's get_many
......................................................................

Add a basepath to AugeasWrapper's get_many

Give the option to retrieve multiple related paths. Also, don't
try to concatenate strings with None. It doesn't work.

Change-Id: I4284a084b1a16b3b6dee315b92d09e15bc57f1d2
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/utils/__init__.py
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/04/30804/1

diff --git a/src/ovirt/node/utils/__init__.py b/src/ovirt/node/utils/__init__.py
index 75cf046..6de61d5 100644
--- a/src/ovirt/node/utils/__init__.py
+++ b/src/ovirt/node/utils/__init__.py
@@ -93,7 +93,7 @@
             self.set(path, value)
         return self.save()
 
-    def remove_many(self, paths, basepath=None):
+    def remove_many(self, paths, basepath=""):
         """Removes many keys at once
 
         Args:
@@ -105,7 +105,7 @@
             self.remove(path, False)
         return self.save()
 
-    def get_many(self, paths, strip_basepath=""):
+    def get_many(self, paths, strip_basepath="", basepath=""):
         """Get all values for all the paths
 
         Args:
@@ -116,6 +116,8 @@
         for path in paths:
             if strip_basepath:
                 path = path[len(strip_basepath):]
+            if basepath:
+                path = basepath + path
             values[path] = self.get(path)
         return values
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4284a084b1a16b3b6dee315b92d09e15bc57f1d2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list