[virt-tools-list] [virt-manager PATCH] virt-install: add "-c" as short option of "--connect"

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Tue Feb 11 06:58:25 UTC 2014


From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>

Add "-c" as short option of "--connect".
Replace original "-c" as "-cd" for "--cdrom"

This will be much convenient if we operate
non-default hypervisor.

Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 man/virt-install.pod | 2 +-
 man/virt-xml.pod     | 2 +-
 virt-install         | 7 ++-----
 virtinst/cli.py      | 2 +-
 4 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 119b515..a74ea7d 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -48,7 +48,7 @@ Show the help message and exit
 
 Show program's version number and exit
 
-=item  --connect=URI
+=item  -c URI, --connect=URI
 
 Connect to a non-default hypervisor. If this isn't specified, libvirt
 will try and choose the most suitable default.
diff --git a/man/virt-xml.pod b/man/virt-xml.pod
index 177b4b9..29594f3 100644
--- a/man/virt-xml.pod
+++ b/man/virt-xml.pod
@@ -37,7 +37,7 @@ Show the help message and exit
 
 Show program's version number and exit
 
-=item  --connect=URI
+=item  -c URI, --connect=URI
 
 Connect to a non-default hypervisor. See L<virt-install(1)> for details
 
diff --git a/virt-install b/virt-install
index 9121445..c3740b2 100755
--- a/virt-install
+++ b/virt-install
@@ -89,12 +89,9 @@ def supports_pxe(guest):
 
 def check_cdrom_option_error(options):
     if options.cdrom_short and options.cdrom:
-        fail("Cannot specify both -c and --cdrom")
+        fail("Cannot specify both -cd and --cdrom")
 
     if options.cdrom_short:
-        if "://" in options.cdrom_short:
-            fail("-c specified with what looks like a URI. Did you mean "
-                 "to use --connect? If not, use --cdrom instead")
         options.cdrom = options.cdrom_short
 
     if not options.cdrom:
@@ -749,7 +746,7 @@ def parse_args():
     cli.add_guest_xml_options(geng)
 
     insg = parser.add_argument_group(_("Installation Method Options"))
-    insg.add_argument("-c", dest="cdrom_short", help=argparse.SUPPRESS)
+    insg.add_argument("-cd", dest="cdrom_short", help=argparse.SUPPRESS)
     insg.add_argument("--cdrom", help=_("CD-ROM installation media"))
     insg.add_argument("-l", "--location",
                     help=_("Installation source (eg, nfs:host:/path, "
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 7811957..defe4a0 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -553,7 +553,7 @@ def set_os_variant(obj, distro_type, distro_variant):
 #############################
 
 def add_connect_option(parser):
-    parser.add_argument("--connect", metavar="URI",
+    parser.add_argument("-c", "--connect", metavar="URI",
                       help=_("Connect to hypervisor with libvirt URI"))
 
 
-- 
1.8.2.1




More information about the virt-tools-list mailing list