+def wait_for_running(args):
+ lxc_status = status(args)
+ timeout = 10
+ while lxc_status != "RUNNING" and timeout > 0:
+ lxc_status = status(args)
+ logging.info(
+ "waiting {} seconds for container to start...".format(timeout))
+ timeout = timeout - 1
+ time.sleep(1)
+ if lxc_status != "RUNNING":
+ raise OSError("container failed to start")
+