<div dir="ltr">Thank you :)</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 8, 2013 at 10:56 AM, Stéphane Graber <span dir="ltr"><<a href="mailto:stgraber@ubuntu.com" target="_blank">stgraber@ubuntu.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Jul 08, 2013 at 10:26:09AM -0700, John McFarlane wrote:<br>
> Locally I find 5 seconds to be inadequate to reliably obtain the ip<br>
> address of a container.  This commit only adds an option, a subsequent<br>
> commit could increase the default (5) if that seems reasonable.<br>
><br>
> Signed-off-by: John McFarlane <<a href="mailto:john@rockfloat.com">john@rockfloat.com</a>><br>
> ---<br>
>  src/lxc/<a href="http://lxc-start-ephemeral.in" target="_blank">lxc-start-ephemeral.in</a> | 5 ++++-<br>
>  1 file changed, 4 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/lxc/<a href="http://lxc-start-ephemeral.in" target="_blank">lxc-start-ephemeral.in</a> b/src/lxc/<a href="http://lxc-start-ephemeral.in" target="_blank">lxc-start-ephemeral.in</a><br>
> index cb1f732..6123259 100644<br>
> --- a/src/lxc/<a href="http://lxc-start-ephemeral.in" target="_blank">lxc-start-ephemeral.in</a><br>
> +++ b/src/lxc/<a href="http://lxc-start-ephemeral.in" target="_blank">lxc-start-ephemeral.in</a><br>
> @@ -97,6 +97,9 @@ parser.add_argument("--union-type", "-U", type=str, default="overlayfs",<br>
>  parser.add_argument("--keep-data", "-k", action="store_true",<br>
>                      help=_("don't wipe everything clean at the end"))<br>
><br>
> +parser.add_argument("--get-ips-timeout", "-I", type=int, default=5,<br>
> +                    help=_("the timeout to use when polling get_ips"))<br>
> +<br>
>  parser.add_argument("command", metavar='CMD', type=str, nargs="*",<br>
>                      help=_("Run specific command in container "<br>
>                             "(command as argument)"))<br>
> @@ -273,7 +276,7 @@ if not args.command and not args.daemon:<br>
>      sys.exit(0)<br>
><br>
>  # Try to get the IP addresses<br>
> -ips = dest.get_ips(timeout=5)<br>
> +ips = dest.get_ips(timeout=args.get_ips_timeout)<br>
><br>
>  # Deal with the case where we just print info about the container<br>
>  if args.daemon:<br>
<br>
</div></div>Hi,<br>
<br>
I'd be happy to have this increased to 10s by default upstream, I only<br>
put it at 5s in my previous commit because that was our old default<br>
value.<br>
<br>
I'd prefer not to add --get-ips-timeout as this sounds like a<br>
workaround/debug option and I'd like to keep the option list relatively<br>
short. However, I'd be happy to use a LXC_IP_TIMEOUT environment<br>
variable for this which would be used by get_ips when timeout isn't set<br>
and by lxc-start-ephemeral as a way to override the default timeout of<br>
10s.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Stéphane Graber<br>
Ubuntu developer<br>
<a href="http://www.ubuntu.com" target="_blank">http://www.ubuntu.com</a><br>
</font></span></blockquote></div><br></div>