summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2019-12-24 12:02:53 -0500
committerCole Robinson <crobinso@redhat.com>2019-12-24 12:02:53 -0500
commit637781fca216dde9629d93776bb20dc220626564 (patch)
tree34a9edd599418fc21a6df0a9f09a0f9f6dc2b2ea
parent2138cca6a5ea89120affc4fc4abb326f52ba87b1 (diff)
downloadvirt-manager-637781fca216dde9629d93776bb20dc220626564.tar.gz
cli: Add --serial type= arg, with back compat alias char_type
'type' is the expected naming here Signed-off-by: Cole Robinson <crobinso@redhat.com>
-rw-r--r--tests/clitest.py4
-rw-r--r--virtinst/cli.py5
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/clitest.py b/tests/clitest.py
index beef8fd7..1ee547d5 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -641,9 +641,9 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
--input tablet
--input mouse
---serial tcp,host=:2222,mode=bind,protocol=telnet,log.file=/tmp/foo.log,log.append=yes,,target.model.name=pci-serial
+--serial char_type=tcp,host=:2222,mode=bind,protocol=telnet,log.file=/tmp/foo.log,log.append=yes,,target.model.name=pci-serial
--serial nmdm,source.master=/dev/foo1,source.slave=/dev/foo2,alias.name=testalias7
---parallel udp,host=0.0.0.0:1234,bind_host=127.0.0.1:1234
+--parallel type=udp,host=0.0.0.0:1234,bind_host=127.0.0.1:1234
--parallel udp,source.connect_host=127.0.0.2,source.connect_service=8888,source.bind_host=127.0.0.1,source.bind_service=7777
--parallel unix,path=/tmp/foo-socket,source.seclabel0.model=none,source.seclabel1.model=dac,source.seclabel1.relabel=yes,source.seclabel1.label=foobar,source.seclabel.relabel=no
--channel pty,target_type=guestfwd,target_address=127.0.0.1:10000
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 274df5f2..769447dd 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -3836,9 +3836,10 @@ class ParserVsock(VirtCLIParser):
######################################################
class _ParserChar(VirtCLIParser):
- remove_first = "char_type"
+ remove_first = "type"
stub_none = False
aliases = {
+ "type": "char_type",
"protocol.type": "protocol",
"target.address": "target_address",
@@ -3893,7 +3894,7 @@ class _ParserChar(VirtCLIParser):
VirtCLIParser._init_class(**kwargs)
_add_common_device_args(cls)
- cls.add_arg("char_type", "type")
+ cls.add_arg("type", "type")
# These are handled in _add_advertised_aliases
cls.add_arg("path", "source.path", cb=cls.noset_cb)