[et-mgmt-tools] [PATCH 4 of 4] Don't ask questions on the command line

Daniel P. Berrange berrange at redhat.com
Wed Dec 5 00:53:03 UTC 2007


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  -=| 




More information about the et-mgmt-tools mailing list