summaryrefslogtreecommitdiff
path: root/virtinst
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2019-11-20 16:40:00 -0500
committerCole Robinson <crobinso@redhat.com>2019-11-20 16:40:00 -0500
commitc311b2897939c02b1fbd5b37b914d6a903889dde (patch)
treeaaf511c089f7790d6ac2be019994ff350a756ab8 /virtinst
parent1d9d91910a11ee9cc1bd372d72617bad13f7ff9e (diff)
downloadvirt-manager-c311b2897939c02b1fbd5b37b914d6a903889dde.tar.gz
cli: Add 'clearxml' arg for options it doesn't apply to
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'virtinst')
-rw-r--r--virtinst/cli.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 7eeb9395..369ed115 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1255,6 +1255,7 @@ class VirtCLIParser(metaclass=_InitClass):
cli_arg_name = None
_virtargs = []
aliases = {}
+ supports_clearxml = True
@classmethod
def add_arg(cls, cliname, propname, *args, **kwargs):
@@ -1266,11 +1267,13 @@ class VirtCLIParser(metaclass=_InitClass):
Don't insist that each instance has full testsuite coverage.
"""
if not cls._virtargs:
- clearxmlvirtarg = _VirtCLIArgumentStatic(
- "clearxml", None, None,
- cb=cls._clearxml_cb, lookup_cb=None,
- is_onoff=True)
- cls._virtargs = [clearxmlvirtarg]
+ cls._virtargs = []
+ if cls.supports_clearxml:
+ clearxmlvirtarg = _VirtCLIArgumentStatic(
+ "clearxml", None, None,
+ cb=cls._clearxml_cb, lookup_cb=None,
+ is_onoff=True)
+ cls._virtargs.append(clearxmlvirtarg)
parent_cliname = cls.cli_arg_name
if kwargs.pop("skip_testsuite_tracking", False):
@@ -1508,6 +1511,7 @@ class VirtCLIParser(metaclass=_InitClass):
class ParserUnattended(VirtCLIParser):
cli_arg_name = "unattended"
+ supports_clearxml = False
@classmethod
def _init_class(cls, **kwargs):
@@ -1543,6 +1547,7 @@ def convert_old_force(options):
class ParserCheck(VirtCLIParser):
cli_arg_name = "check"
+ supports_clearxml = False
@classmethod
def _init_class(cls, **kwargs):
@@ -1574,6 +1579,7 @@ def parse_check(checks):
class ParserInstall(VirtCLIParser):
cli_arg_name = "install"
remove_first = "os"
+ supports_clearxml = False
@classmethod
def _init_class(cls, **kwargs):
@@ -1615,6 +1621,7 @@ def parse_install(optstr):
class ParserLocation(VirtCLIParser):
cli_arg_name = "location"
remove_first = "location"
+ supports_clearxml = False
@classmethod
def _init_class(cls, **kwargs):