[et-mgmt-tools] [PATCH 4 of 4] Don't ask questions on the command line
David Lutterkort
dlutter at redhat.com
Wed Dec 5 00:44:59 UTC 2007
diff -r ea7588e72c26 -r eb09d45157b3 virt-image
--- a/virt-image Tue Dec 04 15:17:48 2007 -0800
+++ b/virt-image Tue Dec 04 15:17:50 2007 -0800
@@ -41,6 +41,11 @@ gettext.install(virtinst.gettext_app, vi
### General input gathering functions
+def get_name(name, image_name, guest):
+ if name is None:
+ name = image_name
+ cli.get_name(name, guest)
+
def get_memory(memory, image_memory, guest):
if memory is None and image_memory is not None:
memory = int(image_memory)/1024
@@ -72,6 +77,8 @@ def get_graphics(domain, vnc, vncport, n
guest.graphics = False
return
else:
+ if not vnc and not sdl:
+ vnc = True
cli.get_graphics(vnc, vncport, nographics, sdl, keymap, guest)
### Option parsing
@@ -186,7 +193,7 @@ def main():
guest = virtinst.ParaVirtGuest(connection=conn, installer=installer)
# now let's get some of the common questions out of the way
- cli.get_name(options.name, guest)
+ get_name(options.name, image.name, guest)
get_memory(options.memory, image.domain.memory, guest)
cli.get_uuid(options.uuid, guest)
get_vcpus(options.vcpus, image.domain.vcpu, options.check_cpu,
More information about the et-mgmt-tools
mailing list