FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 12-04-2007, 11:44 PM
David Lutterkort
 
Default Don't ask questions on the command line

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,

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 12-04-2007, 11:53 PM
"Daniel P. Berrange"
 
Default Don't ask questions on the command line

On Tue, Dec 04, 2007 at 04:44:59PM -0800, David Lutterkort wrote:
> 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,

ACK

Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 09:50 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org