[et-mgmt-tools] [PATCH] bugzillaID:329091

S.Sakamoto fj0588di at aa.jp.fujitsu.com
Tue Oct 16 07:09:06 UTC 2007


Hi

I make a patch of BugzillaID-329091.
https://bugzilla.redhat.com/show_bug.cgi?id=329091

Thanks,
Shigeki Sakamoto.

----------------------------------------------------------------------
diff -r 531b73491ac2 virt-install
--- a/virt-install	Wed Oct 10 14:24:48 2007 -0400
+++ b/virt-install	Tue Oct 16 16:01:29 2007 +0900
@@ -15,6 +15,7 @@
 
 
 import os, sys, string
+from stat import *
 from optparse import OptionParser, OptionValueError
 import subprocess
 import logging
@@ -48,10 +49,10 @@ def get_disk(disk, size, sparse, guest, 
         if not size is None:
             msg = _("Please enter the path to the file you would like to use for storage. It will have size %sGB.") %(size,)
         disk = cli.prompt_for_input(msg, disk)
-        if os.path.exists(disk) and os.path.isfile(disk):
+        if os.path.exists(disk) and ( S_ISBLK(os.stat(disk)[ST_MODE]) or S_ISREG(os.stat(disk)[ST_MODE]) ):
             while 1:
                 retryFlg = False
-                warnmsg = _("You are going to overwrite file '%s'!\n") % disk
+                warnmsg = _("You are going to overwrite '%s'!\n") % disk
                 res = cli.prompt_for_input(warnmsg + _("Do you really want to use the file (yes or no)? "))
                 try:
                     if cli.yes_or_no(res) is True:
----------------------------------------------------------------------




More information about the et-mgmt-tools mailing list