cli: add a timeout option
authorGuido Trotter <ultrotter@google.com>
Fri, 9 Oct 2009 10:52:02 +0000 (11:52 +0100)
committerGuido Trotter <ultrotter@google.com>
Fri, 9 Oct 2009 15:02:41 +0000 (16:02 +0100)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/cli.py

index 2d6e7f7..b864527 100644 (file)
@@ -111,6 +111,7 @@ __all__ = [
   "STATIC_OPT",
   "SYNC_OPT",
   "TAG_SRC_OPT",
+  "TIMEOUT_OPT",
   "USEUNITS_OPT",
   "VERBOSE_OPT",
   "VG_NAME_OPT",
@@ -816,6 +817,9 @@ NOSHUTDOWN_OPT = cli_option("","--noshutdown", dest="shutdown",
                             action="store_false", default=True,
                             help="Don't shutdown the instance (unsafe)")
 
+TIMEOUT_OPT = cli_option("--timeout", dest="timeout", type="int",
+                         default=constants.DEFAULT_SHUTDOWN_TIMEOUT,
+                         help="Maximum time to wait")
 
 
 def _ParseArgs(argv, commands, aliases):