From ad5f15151580201b79fc140f664227b494639e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Wed, 22 May 2013 22:28:43 -0400 Subject: [PATCH] python: Fix lxc-ls's usage of get_ips() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/lxc/lxc-ls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)