[lxc-devel] [PATCH] lxc-ls: Allow the use of --groups without --fancy

Stéphane Graber stgraber at ubuntu.com
Fri May 2 15:18:12 UTC 2014


There wasn't a good reason for that limit, we can simply make the code
slightly slower when --groups is passed and still have the expected
output even without --fancy.

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

diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in
index a165166..64dd121 100755
--- a/src/lxc/lxc-ls.in
+++ b/src/lxc/lxc-ls.in
@@ -194,10 +194,6 @@ if args.nesting:
         parser.error(_("Showing nested containers requires setns to the "
                        "PID namespace which your kernel doesn't support."))
 
-## Check that -g is passed alongside -f
-if args.groups and not args.fancy:
-    parser.error(_("Group filtering requires fancy formatting."))
-
 # Set the actual lxcpath value
 if not args.lxcpath:
     args.lxcpath = lxc.default_config_path
@@ -229,7 +225,8 @@ def get_containers(fd=None, base="/", root=False):
                 continue
 
             # Return before grabbing the object (non-root)
-            if not args.state and not args.fancy and not args.nesting:
+            if not args.state and not args.fancy and not args.nesting \
+                    and not args.groups:
                 containers.append(entry)
                 continue
 
-- 
1.9.1



More information about the lxc-devel mailing list