[et-mgmt-tools] [PATCH] "--file-size" option is ignored

Nobuhiro Itou fj0873gn at aa.jp.fujitsu.com
Tue Mar 6 03:30:24 UTC 2007


Hi

When I execute "virt-install --file-size=10", 
the value of "--file-size" option is ignored and the error message 
"ERROR:  float() argument must be a string or a number" is output 
after I answer "What would you like to use as the disk (path)?". 

The attached patch adds to solve this problem.


Signed-off-by: Nobuhiro Itou <fj0873gn at aa.jp.fujitsu.com>

Thanks,
Nobuhiro Itou.


Index: virt-install (python-virtinst-0.101.0)
===================================================================
--- virt-install        2007-03-05 06:03:21.000000000 +0900
+++ virt-install.disk_size      2007-03-05 19:32:50.000000000 +0900
@@ -99,7 +99,10 @@ def get_vcpus(vcpus, guest):
 def get_disk(disk, size, sparse, guest, hvm):
     # FIXME: need to handle a list of disks at some point
     while 1:
-        disk = prompt_for_input("What would you like to use as the disk (path)?", disk)
+        msg = "What would you like to use as the disk (path)?"
+        if not size is None:
+            msg = "What would you like the size %sGB to use as the disk (path)?" %(size,)
+        disk = prompt_for_input(msg, disk)
         while 1:
             if os.path.exists(disk):
                 break
@@ -131,10 +134,15 @@ def get_disks(disk, size, sparse, guest,
             sys.exit(1)
     elif type(disk) == list:
         size = [ None ] * len(disk)
+    elif type(size) == list:
+        disk = [ None ] * len(size)

     if (type(disk) == list):
         map(lambda d, s: get_disk(d, s, sparse, guest, hvm),
             disk, size)
+    elif (type(size) == list):
+        map(lambda d, s: get_disk(d, s, sparse, guest, hvm),
+            disk, size)
     else:
         get_disk(disk, size, sparse, guest, hvm)




More information about the et-mgmt-tools mailing list