[lxc-devel] [PATCH 1/3] python: get_keys() doesn't require a path

Stéphane Graber stgraber at ubuntu.com
Fri Dec 7 20:47:10 UTC 2012


The python binding was forcing the user to pass a base path to
get_keys() even though the C binding doesn't require it.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 src/python-lxc/lxc/__init__.py.in | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/python-lxc/lxc/__init__.py.in b/src/python-lxc/lxc/__init__.py.in
index f42b944..9ef3459 100644
--- a/src/python-lxc/lxc/__init__.py.in
+++ b/src/python-lxc/lxc/__init__.py.in
@@ -400,11 +400,14 @@ class Container(_lxc.Container):
         os.remove(path)
         return ips
 
-    def get_keys(self, key):
+    def get_keys(self, key=None):
         """
             Returns a list of valid sub-keys.
         """
-        value = _lxc.Container.get_keys(self, key)
+        if key:
+            value = _lxc.Container.get_keys(self, key)
+        else:
+            value = _lxc.Container.get_keys(self)
 
         if value is False:
             return False
-- 
1.8.0





More information about the lxc-devel mailing list