diff --git a/tests/cli-test-xml/compare/virtxml-edit-simple-security.xml b/tests/cli-test-xml/compare/virtxml-edit-simple-security.xml index bfb10aae6..9de0c392f 100644 --- a/tests/cli-test-xml/compare/virtxml-edit-simple-security.xml +++ b/tests/cli-test-xml/compare/virtxml-edit-simple-security.xml @@ -5,7 +5,7 @@ + -+ ++ + diff --git a/tests/clitest.py b/tests/clitest.py index 06b1cb78a..02e5b6259 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -763,7 +763,7 @@ c.add_compare("--vcpus 10,maxvcpus=20,cores=5,sockets=4,threads=1", "virtxml-edi c.add_compare("--cpu model=pentium2,+x2apic,forbid=pbe", "virtxml-edit-simple-cpu") c.add_compare("--numatune 1-5,7,mode=strict", "virtxml-edit-simple-numatune") c.add_compare("--boot loader=foo.bar,network,useserial=on,init=/bin/bash", "virtxml-edit-simple-boot") -c.add_compare("--security label=foo,bar,baz,relabel=on", "virtxml-edit-simple-security") +c.add_compare("--security label=foo,bar,baz,UNKNOWN=val,relabel=on", "virtxml-edit-simple-security") c.add_compare("--features eoi=on,hyperv_relaxed=off,acpi=", "virtxml-edit-simple-features") c.add_compare("--clock offset=localtime,hpet_present=yes,kvmclock_present=no,rtc_tickpolicy=merge", "virtxml-edit-simple-clock") c.add_compare("--disk /dev/zero,perms=ro,startup_policy=optional", "virtxml-edit-simple-disk") diff --git a/virtinst/cli.py b/virtinst/cli.py index bdcf6a24a..2e92385c1 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -959,7 +959,7 @@ class _VirtCLIArgument(object): After the parser sees this option, it will iterate over the option string until it finds another known argument name: everything prior to that argument name is considered part of - the value of this option. Should be used sparingly. + the value of this option, '=' included. Should be used sparingly. @is_list: This value should be stored as a list, so multiple instances are appended. @is_onoff: The value expected on the cli is on/off or yes/no, convert @@ -1086,7 +1086,9 @@ class VirtOptionString(object): optlist.append(tuple(commaopt)) commaopt = None else: - commaopt[1] += "," + (val or cliname) + commaopt[1] += "," + cliname + if val: + commaopt[1] += "=" + val continue if (cliname in virtargmap and virtargmap[cliname].can_comma):