From: John McFarlane Date: Fri, 12 Jul 2013 21:06:20 +0000 (-0700) Subject: Make get_ips timeout poll configurable X-Git-Tag: lxc-1.0.0.alpha1~1^2~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=819554fe20bbc0ce720b5ed0d5b8e53aeba6b284;p=thirdparty%2Flxc.git Make get_ips timeout poll configurable This commit increases the default timeout used by lxc-start-ephemeral from 5 to 10, and adds support for an LXC_IP_TIMEOUT override. Patchset 2: - Previous patch used a command line arg. Signed-off-by: John McFarlane Acked-by: Stéphane Graber --- diff --git a/src/lxc/lxc-start-ephemeral.in b/src/lxc/lxc-start-ephemeral.in index cb1f732c6..4cbf93fed 100644 --- a/src/lxc/lxc-start-ephemeral.in +++ b/src/lxc/lxc-start-ephemeral.in @@ -273,7 +273,7 @@ if not args.command and not args.daemon: sys.exit(0) # Try to get the IP addresses -ips = dest.get_ips(timeout=5) +ips = dest.get_ips(timeout=10) # Deal with the case where we just print info about the container if args.daemon: diff --git a/src/python-lxc/lxc/__init__.py b/src/python-lxc/lxc/__init__.py index 9ada7ffef..4891cd1db 100644 --- a/src/python-lxc/lxc/__init__.py +++ b/src/python-lxc/lxc/__init__.py @@ -369,6 +369,7 @@ class Container(_lxc.Container): kwargs['scope'] = scope ips = None + timeout = int(os.environ.get('LXC_GETIP_TIMEOUT', timeout)) while not ips: ips = _lxc.Container.get_ips(self, **kwargs)