create: Fix default storage path when VM name is changed (bz 1169141)

Regressed with 2e7ebd4 . Use skip_disk_page() to determine when we
shouldn't assume default storage
This commit is contained in:
Cole Robinson 2014-12-03 13:08:18 -05:00
parent c090d18beb
commit 4a678f0543
2 changed files with 5 additions and 8 deletions

View File

@ -108,9 +108,6 @@ class vmmAddStorage(vmmGObjectUI):
hd_label = ("<span color='#484848'>%s</span>" % hd_label)
widget.set_markup(hd_label)
def _is_default_storage(self):
return bool(self.widget("config-storage-create").get_active())
def _check_default_pool_active(self):
default_pool = self.conn.get_default_pool()
if default_pool and not default_pool.is_active():
@ -257,8 +254,7 @@ class vmmAddStorage(vmmGObjectUI):
return path
def is_default_storage(self):
return self.widget("config-storage-create").is_visible() and \
self.widget("config-storage-create").get_active()
return self.widget("config-storage-create").get_active()
def _check_ideal_path(self, path, vmname, collidelist):
# See if the ideal disk path (/default/pool/vmname.img)

View File

@ -1062,9 +1062,8 @@ class vmmCreate(vmmGObjectUI):
return self.addstorage.get_default_path(name)
def is_default_storage(self):
usedef = self.addstorage.is_default_storage()
isimport = (self.get_config_install_page() == INSTALL_PAGE_IMPORT)
return usedef and not isimport
return (self.addstorage.is_default_storage() and
not self.skip_disk_page())
def get_config_customize(self):
return self.widget("summary-customize").get_active()
@ -1718,6 +1717,8 @@ class vmmCreate(vmmGObjectUI):
if name != self.guest.name:
self.guest.name = name
if self.is_default_storage():
logging.debug("User changed VM name and using default storage,"
"re-validating with new default storage path.")
# User changed the name and we are using default storage
# which depends on the VM name. Revalidate things
if not self.validate_storage_page():