lxc-ls: Allow the use of --groups without --fancy

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: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent a5ab2796
...@@ -194,10 +194,6 @@ if args.nesting: ...@@ -194,10 +194,6 @@ if args.nesting:
parser.error(_("Showing nested containers requires setns to the " parser.error(_("Showing nested containers requires setns to the "
"PID namespace which your kernel doesn't support.")) "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 # Set the actual lxcpath value
if not args.lxcpath: if not args.lxcpath:
args.lxcpath = lxc.default_config_path args.lxcpath = lxc.default_config_path
...@@ -229,7 +225,8 @@ def get_containers(fd=None, base="/", root=False): ...@@ -229,7 +225,8 @@ def get_containers(fd=None, base="/", root=False):
continue continue
# Return before grabbing the object (non-root) # 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) containers.append(entry)
continue continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment