mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
createpool: Don't set values half way through the validation process.
This commit is contained in:
parent
6ddf8b434a
commit
0953fea9e7
@ -21,6 +21,7 @@
|
|||||||
import gobject
|
import gobject
|
||||||
import gtk.glade
|
import gtk.glade
|
||||||
|
|
||||||
|
import copy
|
||||||
import traceback
|
import traceback
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -394,16 +395,17 @@ class vmmCreatePool(gobject.GObject):
|
|||||||
source = self.get_config_source_path()
|
source = self.get_config_source_path()
|
||||||
fmt = self.get_config_format()
|
fmt = self.get_config_format()
|
||||||
|
|
||||||
|
tmppool = copy.copy(self._pool)
|
||||||
try:
|
try:
|
||||||
self._pool.target_path = target
|
tmppool.target_path = target
|
||||||
if host:
|
if host:
|
||||||
self._pool.host = host
|
tmppool.host = host
|
||||||
if source:
|
if source:
|
||||||
self._pool.source_path = source
|
tmppool.source_path = source
|
||||||
if fmt:
|
if fmt:
|
||||||
self._pool.format = fmt
|
tmppool.format = fmt
|
||||||
|
|
||||||
self._pool.get_xml_config()
|
tmppool.get_xml_config()
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
return self.err.val_err(_("Pool Parameter Error"), str(e))
|
return self.err.val_err(_("Pool Parameter Error"), str(e))
|
||||||
|
|
||||||
@ -413,6 +415,7 @@ class vmmCreatePool(gobject.GObject):
|
|||||||
return self.err.yes_no(_("Building a pool of this type will "
|
return self.err.yes_no(_("Building a pool of this type will "
|
||||||
"format the source device. Are you "
|
"format the source device. Are you "
|
||||||
"sure you want to 'build' this pool?"))
|
"sure you want to 'build' this pool?"))
|
||||||
|
self._pool = tmppool
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def update_doc(self, ignore1, ignore2, param, infobox):
|
def update_doc(self, ignore1, ignore2, param, infobox):
|
||||||
|
Loading…
Reference in New Issue
Block a user