From 38f29a361192c89073599beac8e3658702c33083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= <rn@google.com> Date: Fri, 25 Nov 2011 14:53:47 +0100 Subject: [PATCH] cli: Add common command flags for hv/disk state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RenΓ© Nussbaumer <rn@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- lib/cli.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/cli.py b/lib/cli.py index cde99913c..5cceb7b63 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -185,6 +185,8 @@ __all__ = [ "VERBOSE_OPT", "VG_NAME_OPT", "YES_DOIT_OPT", + "DISK_STATE_OPT", + "HV_STATE_OPT", # Generic functions for CLI programs "ConfirmOperation", "GenericMain", @@ -1293,6 +1295,18 @@ IGNORE_ERRORS_OPT = cli_option("-I", "--ignore-errors", default=[], choices=list(constants.CV_ALL_ECODES_STRINGS), help="Error code to be ignored") +DISK_STATE_OPT = cli_option("--disk-state", default=[], dest="disk_state", + action="append", + help=("Specify disk state information in the format" + " storage_type/identifier:option=value,..."), + type="identkeyval") + +HV_STATE_OPT = cli_option("--hypervisor-state", default=[], dest="hv_state", + action="append", + help=("Specify hypervisor state information in the" + " format hypervisor:option=value,..."), + type="identkeyval") + #: Options provided by all commands COMMON_OPTS = [DEBUG_OPT] -- GitLab