6505c36ecc
virtman-netstats-fix.diff virtman-finish-button-fix.diff virtman-shutoff-fix.diff virtman-set-has-window-fix.diff virtman-grep-fix.diff virtman-no-cd-present-fix.diff virtman-resize-menu-fix.diff virtman-vcpu-count-fix.diff virtman-storage-pool-fix.diff virtman-domain-name-fix.diff virtman-unapplied-changes-fix.diff virtman-details-fix.diff virtman-delete-fix.diff virtman-collidelist-fix.diff virtman-char-device-mode-fix.diff virtinst-hv-version-fix.diff virtinst-initrd-inject-fix.diff virtinst-initrd-inject2-fix.diff virtinst-no-volume-fix.diff virtinst-prompts-fix.diff virtinst-cpu-model-name-fix.diff virtinst-xml-clear-fix.diff virtinst-remote-storage-fix.diff virtinst-error-message-fix.diff virtinst-typo-fix.diff virtinst-cdrom.diff virtinst-storage-ocfs2.diff OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=63
63 lines
2.2 KiB
Diff
63 lines
2.2 KiB
Diff
|
|
Subject: VirtualDisk: Fix logic error determining if we are creating storage
|
|
From: Cole Robinson crobinso@redhat.com Tue Aug 30 14:54:47 2011 -0400
|
|
Date: Tue Aug 30 14:54:47 2011 -0400:
|
|
Git: 9ad2e3a68b8f5cc1b5c11588dc1c4d5edcca3deb
|
|
|
|
If creating a storage volume, the logic would fall through and check if
|
|
the path existed locally. This isn't valid for remote connections.
|
|
|
|
Addtionally cleanup similar functions to be easier to read and hopefully
|
|
avoid these problems in the future.
|
|
|
|
Index: virtinst-0.600.0/virtinst/VirtualDisk.py
|
|
===================================================================
|
|
--- virtinst-0.600.0.orig/virtinst/VirtualDisk.py
|
|
+++ virtinst-0.600.0/virtinst/VirtualDisk.py
|
|
@@ -1123,23 +1123,38 @@ class VirtualDisk(VirtualDevice):
|
|
Return bool representing if managed storage parameters have
|
|
been explicitly specified or filled in
|
|
"""
|
|
- return (self.vol_object != None or self.vol_install != None or
|
|
- self._pool_object != None)
|
|
+ return bool(self.vol_object != None or
|
|
+ self.vol_install != None or
|
|
+ self._pool_object != None)
|
|
|
|
def __creating_storage(self):
|
|
"""
|
|
Return True if the user requested us to create a device
|
|
"""
|
|
- return not (self.__no_storage() or
|
|
- (self.__managed_storage() and
|
|
- self.vol_object or self._pool_object) or
|
|
- (self.path and os.path.exists(self.path)))
|
|
+ if self.__no_storage():
|
|
+ return False
|
|
+
|
|
+ if self.__managed_storage():
|
|
+ if self.vol_object or self._pool_object:
|
|
+ return False
|
|
+ return True
|
|
+
|
|
+ if (not self.is_remote() and
|
|
+ self.path and
|
|
+ os.path.exists(self.path)):
|
|
+ return False
|
|
+
|
|
+ return True
|
|
|
|
def __no_storage(self):
|
|
"""
|
|
Return True if no path or storage was specified
|
|
"""
|
|
- return (not self.__managed_storage() and not self.path)
|
|
+ if self.__managed_storage():
|
|
+ return False
|
|
+ if self.path:
|
|
+ return False
|
|
+ return True
|
|
|
|
|
|
def _storage_security_label(self):
|