From: Stéphane Graber Date: Thu, 23 May 2013 02:28:43 +0000 (-0400) Subject: python: Fix lxc-ls's usage of get_ips() X-Git-Tag: lxc-1.0.0.alpha1~1^2~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad5f15151580201b79fc140f664227b494639e81;p=thirdparty%2Flxc.git python: Fix lxc-ls's usage of get_ips() The recent port of get_ips() from pure python to the C API came with a couple of API changes for that function call (as were highlighted in the commit message). I somehow didn't notice that lxc-ls was still calling with the old API and so was crashing whenever it was asked to show the ipv4 or ipv6 address. Signed-off-by: Stéphane Graber --- diff --git a/src/lxc/lxc-ls b/src/lxc/lxc-ls index d4e369b6f..491e95bee 100644 --- a/src/lxc/lxc-ls +++ b/src/lxc/lxc-ls @@ -202,10 +202,10 @@ for container_name in lxc.list_containers(config_path=lxcpath): entry['pid'] = str(container.init_pid) # Get the IPs - for protocol in ('ipv4', 'ipv6'): + for family, protocol in {'inet': 'ipv4', 'inet6': 'ipv6'}.items(): if protocol in args.fancy_format or args.nesting: entry[protocol] = "-" - ips = container.get_ips(protocol=protocol, timeout=1) + ips = container.get_ips(family=family) if ips: entry[protocol] = ", ".join(ips)