mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
create: Stop if virt-bootstrap has failed
Prevent container creation if virt-bootstrap has not finished successfully.
This commit is contained in:
committed by
Cole Robinson
parent
6f8206dc55
commit
c5264a2390
@@ -257,6 +257,9 @@ class vmmAsyncJob(vmmGObjectUI):
|
||||
def set_error(self, error, details):
|
||||
self._error_info = (error, details)
|
||||
|
||||
def has_error(self):
|
||||
return bool(self._error_info)
|
||||
|
||||
def set_extra_data(self, data):
|
||||
self._data = data
|
||||
def get_extra_data(self):
|
||||
|
||||
@@ -2512,6 +2512,9 @@ class vmmCreate(vmmGObjectUI):
|
||||
if bootstrap_args:
|
||||
# Start container bootstrap
|
||||
self._create_directory_tree(asyncjob, meter, bootstrap_args)
|
||||
if asyncjob.has_error():
|
||||
# Do not continue if virt-bootstrap failed
|
||||
return
|
||||
|
||||
# Build a list of pools we should refresh, if we are creating storage
|
||||
refresh_pools = []
|
||||
@@ -2648,4 +2651,5 @@ class vmmCreate(vmmGObjectUI):
|
||||
self.widget("install-oscontainer-bootstrap").set_active(False)
|
||||
self.idle_add(cb)
|
||||
except Exception as err:
|
||||
asyncjob.set_error(err, log_stream.getvalue())
|
||||
asyncjob.set_error("virt-bootstrap did not complete successfully",
|
||||
'%s\n%s' % (err, log_stream.getvalue()))
|
||||
|
||||
Reference in New Issue
Block a user