]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-ls: Allow the use of --groups without --fancy
authorStéphane Graber <stgraber@ubuntu.com>
Fri, 2 May 2014 15:16:51 +0000 (11:16 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 2 May 2014 15:16:51 +0000 (11:16 -0400)
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@ubuntu.com>
src/lxc/lxc-ls.in

index a165166d9c7fb92391e91acda3b46a0b2c44ffa7..64dd121934971e6b70afbf49660d88c8f8b555be 100755 (executable)
@@ -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