[lxc-devel] [PATCH 3/4] lxc-ls: Add workaround for nested containers

Stéphane Graber stgraber at ubuntu.com
Thu Dec 19 15:26:42 UTC 2013


When accessing nested containers, hardcode the path to their config.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 src/lxc/lxc-ls | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/lxc-ls b/src/lxc/lxc-ls
index e358525..d63d9d6 100755
--- a/src/lxc/lxc-ls
+++ b/src/lxc/lxc-ls
@@ -211,6 +211,9 @@ for container_name in lxc.list_containers(config_path=lxcpath):
 
     container = lxc.Container(container_name, args.lxcpath)
 
+    if 'NESTED' in os.environ:
+        container.load_config(os.path.join(lxcpath, container_name, "config"))
+
     if container.controllable:
         state = container.state
     else:
-- 
1.8.5.2



More information about the lxc-devel mailing list