diff options
author | Cole Robinson <crobinso@redhat.com> | 2014-01-24 18:07:45 -0500 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2014-01-25 17:20:29 -0500 |
commit | cf626c3afe8fb95f9dfd84f08225110b1b32c381 (patch) | |
tree | af15e3d80189c6b33acd8a2d977aec724a1b3c3e | |
parent | 65124ff66b28b45e12983e76ba204e3923d10d1e (diff) | |
download | virt-manager-cf626c3afe8fb95f9dfd84f08225110b1b32c381.tar.gz |
cli: Fix --security label=foo,unknownopt=val
We should embed the unknown opt
-rw-r--r-- | tests/cli-test-xml/compare/virtxml-edit-simple-security.xml | 2 | ||||
-rw-r--r-- | tests/clitest.py | 2 | ||||
-rw-r--r-- | virtinst/cli.py | 6 |
3 files changed, 6 insertions, 4 deletions
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 bfb10aae..9de0c392 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 @@ </rng> </devices> + <seclabel relabel="yes"> -+ <label>foo,bar,baz</label> ++ <label>foo,bar,baz,UNKNOWN=val</label> + </seclabel> </domain> diff --git a/tests/clitest.py b/tests/clitest.py index 06b1cb78..02e5b625 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 bdcf6a24..2e92385c 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): |