Let provisioning finish if script fails

This will allow cleanup to succeed even if the provisioning script
fails, avoiding leaving the system in a weird state.
This commit is contained in:
Joshua Boniface 2020-01-09 13:19:23 -05:00
parent b6474198a4
commit 641f13bb95
1 changed files with 11 additions and 8 deletions

View File

@ -1291,6 +1291,7 @@ def create_vm(self, vm_name, vm_profile, define_vm=True, start_vm=True):
script_arguments[argument_name] = argument_data script_arguments[argument_name] = argument_data
# Run the script # Run the script
try:
installer_script.install( installer_script.install(
vm_name=vm_name, vm_name=vm_name,
vm_id=vm_id, vm_id=vm_id,
@ -1299,6 +1300,8 @@ def create_vm(self, vm_name, vm_profile, define_vm=True, start_vm=True):
networks=vm_data['networks'], networks=vm_data['networks'],
**script_arguments **script_arguments
) )
except:
continue
# Phase 9 - install cleanup # Phase 9 - install cleanup
# * Unmount any mounted volumes # * Unmount any mounted volumes