mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-10-27 01:55:20 +03:00
Reset Guest.domain to None on domain creation error
When an error occurs when the VM creation wizard tries to start the VM, it's then not possible to press again the "Finish" button to try again to start it, as this errors out with: Traceback (most recent call last): File "/home/teuf/redhat/virt/virt-manager/virtManager/asyncjob.py", line 88, in cb_wrapper callback(asyncjob, *args, **kwargs) File "/home/teuf/redhat/virt/virt-manager/virtManager/create.py", line 2341, in _do_async_install guest.start_install(meter=meter) File "/home/teuf/redhat/virt/virt-manager/virtinst/guest.py", line 457, in start_install raise RuntimeError(_("Domain has already been started!")) RuntimeError: Domain has already been started! This is caused by code introduced in commit fc6778 which does not reset self.domain to None when an exception is caught. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
6b23810733
commit
2099a1946e
@ -408,6 +408,7 @@ class Guest(XMLBuilder):
|
||||
exc_info = sys.exc_info()
|
||||
try:
|
||||
self.domain.undefine()
|
||||
self.domain = None
|
||||
except:
|
||||
pass
|
||||
raise exc_info[0], exc_info[1], exc_info[2]
|
||||
|
Loading…
Reference in New Issue
Block a user