[lxc-devel] [PATCH] Make get_ips timeout poll configurable

John McFarlane john at rockfloat.com
Fri Jul 12 21:06:20 UTC 2013


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 <john at rockfloat.com>
---
 src/lxc/lxc-start-ephemeral.in | 2 +-
 src/python-lxc/lxc/__init__.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lxc/lxc-start-ephemeral.in b/src/lxc/lxc-start-ephemeral.in
index cb1f732..4cbf93f 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 9ada7ff..c45ff9f 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_IP_TIMEOUT', timeout))
 
         while not ips:
             ips = _lxc.Container.get_ips(self, **kwargs)
-- 
1.8.1.2





More information about the lxc-devel mailing list