]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-start-ephemeral: Fix get_ips call
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 19 Jun 2013 18:12:37 +0000 (14:12 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 19 Jun 2013 18:12:37 +0000 (14:12 -0400)
The timeout option in get_ips has been deprecated, so work around it.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxc-start-ephemeral.in

index b5cad9a4e1d3101bbae69b27ab6aacfd614b71b4..94cbf38001d6ad1f5d29bcd98ba94fd71df56df4 100644 (file)
@@ -36,6 +36,7 @@ import os
 import sys
 import subprocess
 import tempfile
+import time
 
 _ = gettext.gettext
 gettext.textdomain("lxc-start-ephemeral")
@@ -259,7 +260,12 @@ if not args.command and not args.daemon:
     sys.exit(0)
 
 # Try to get the IP addresses
-ips = dest.get_ips(timeout=10)
+ips = None
+timeout = 5
+while not ips and timeout != 0:
+    ips = dest.get_ips()
+    time.sleep(1)
+    timeout -= 1
 
 # Deal with the case where we just print info about the container
 if args.daemon: