From 9737a2060ca725bb6622736f2bf2ebb6656a8d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 13 Sep 2012 10:03:21 -0400 Subject: [PATCH] lxc-start-ephemeral: Drop stop() calls when shutdown() returns non-True MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit shutdown() when given a timeout already does a stop call so there's no need to check its return value and do another one. Signed-off-by: Stéphane Graber --- src/lxc/lxc-start-ephemeral.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lxc/lxc-start-ephemeral.in b/src/lxc/lxc-start-ephemeral.in index 72b2114ba..70b1150da 100644 --- a/src/lxc/lxc-start-ephemeral.in +++ b/src/lxc/lxc-start-ephemeral.in @@ -251,8 +251,7 @@ The following IP addresses have be found in the container: sys.exit(0) else: dest.console(tty=1) - if not dest.shutdown(timeout=5): - dest.stop() + dest.shutdown(timeout=5) sys.exit(0) # Now deal with the case where we want to run a command in the container @@ -286,5 +285,4 @@ for ip in ips: break # Shutdown the container -if not dest.shutdown(timeout=5): - dest.stop() +dest.shutdown(timeout=5)