[et-mgmt-tools] [PATCH] checking for file-size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I add to check for the file-size of the disk.
If the file-size is less than or equal to 0, it will show the following
message:
    ERROR:  Size of the disk image must be greater than 0
and ask again.

Signed-off-by: Saori Fukuta <fukuta.saori@xxxxxxxxxxxxxx>

Thanks,
Saori Fukuta


diff -r 797e92fd5e0d virtinst/Guest.py
--- a/virtinst/Guest.py Thu May 31 14:20:33 2007 -0400
+++ b/virtinst/Guest.py Thu Jun 07 14:19:54 2007 +0900
@@ -57,6 +57,8 @@ class VirtualDisk:
             if not os.path.exists(self.path):
                 if size is None:
                     raise ValueError, "Must provide a size for non-existent disks"
+                if size <= 0:
+                    raise ValueError, "Size of the disk image must be greater than 0"
                 self._type = VirtualDisk.TYPE_FILE
             else:
                 if stat.S_ISBLK(os.stat(self.path)[stat.ST_MODE]):


[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux