From 50df4a62a25fd1d75d35b3dfc0fcff4ad53e9e00 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Sat, 22 Mar 2014 23:26:59 -0400 Subject: [PATCH] lxc-ls: Optimize things a bit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Don't bother access information that the user didn't request. Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- src/lxc/lxc-ls.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in index 19fbfb83a..fa387b3cf 100755 --- a/src/lxc/lxc-ls.in +++ b/src/lxc/lxc-ls.in @@ -244,17 +244,17 @@ def get_containers(fd=None, base="/", root=False): continue # Some extra field we may want - if 'state' in args.fancy_format or args.nesting: + if 'state' in args.fancy_format: entry['state'] = state - if 'pid' in args.fancy_format or args.nesting: + if 'pid' in args.fancy_format: entry['pid'] = "-" if state == 'UNKNOWN': entry['pid'] = state elif container.init_pid != -1: entry['pid'] = str(container.init_pid) - if 'autostart' in args.fancy_format or args.nesting: + if 'autostart' in args.fancy_format: entry['autostart'] = "NO" try: if container.get_config_item("lxc.start.auto") == "1": @@ -308,7 +308,7 @@ def get_containers(fd=None, base="/", root=False): # Get the IPs for family, protocol in {'inet': 'ipv4', 'inet6': 'ipv6'}.items(): - if protocol in args.fancy_format or args.nesting: + if protocol in args.fancy_format: entry[protocol] = "-" if state == 'UNKNOWN': -- 2.47.2