[virt-tools-list] [virt-manager] [PATCH 1/5] create: Stop if virt-bootstrap has failed
Cole Robinson
crobinso at redhat.com
Wed Aug 2 17:20:17 UTC 2017
On 07/26/2017 12:06 PM, Radostin wrote:
> The check here should be done only if virt-bootstrap has been called.
>
>> Prevent container creation if virt-bootstrap has not finished
>> successfully.
>> ---
>> virtManager/asyncjob.py | 3 +++
>> virtManager/create.py | 6 +++++-
>> 2 files changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/virtManager/asyncjob.py b/virtManager/asyncjob.py
>> index 3c96fdf..35347ca 100644
>> --- a/virtManager/asyncjob.py
>> +++ b/virtManager/asyncjob.py
>> @@ -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):
>> diff --git a/virtManager/create.py b/virtManager/create.py
>> index d8e09bf..dd99c17 100644
>> --- a/virtManager/create.py
>> +++ b/virtManager/create.py
>> @@ -2512,6 +2512,9 @@ class vmmCreate(vmmGObjectUI):
>> if bootstrap_args:
>> # Start container bootstrap
>> self._create_directory_tree(asyncjob, meter, bootstrap_args)
>> + # Do not continue if virt-bootstrap has not finished
>> successfully
>> + if asyncjob.has_error:
>> + return
>>
This will always resolve to True, it should be has_error() I think. I fixed
that and pushed, sorry for the review delay. I pushed patch #2 and #3 as well
Thanks,
Cole
More information about the virt-tools-list
mailing list