Improve error messages

This commit is contained in:
Joshua Boniface 2022-10-05 17:26:09 -04:00
parent 47b0704555
commit da85480488
1 changed files with 5 additions and 5 deletions

View File

@ -613,7 +613,7 @@ def create_vm(
vm_builder.setup()
except Exception as e:
general_cleanup()
raise ProvisioningError(f"Error in setup(): {e}")
raise ProvisioningError(f"Error in script setup() step: {e}")
# Phase 5 - script: create()
# * Prepare the libvirt XML defintion for the VM
@ -635,7 +635,7 @@ def create_vm(
vm_schema = vm_builder.create()
except Exception as e:
general_cleanup()
raise ProvisioningError(f"Error in create(): {e}")
raise ProvisioningError(f"Error in script create() step: {e}")
print("Generated VM schema:\n{}\n".format(vm_schema))
@ -681,7 +681,7 @@ def create_vm(
vm_builder.prepare()
except Exception as e:
general_cleanup()
raise ProvisioningError(f"Error in prepare(): {e}")
raise ProvisioningError(f"Error in script prepare() step: {e}")
# Phase 7 - script: install()
# * Run installation with arguments
@ -702,7 +702,7 @@ def create_vm(
vm_builder.install()
except Exception as e:
general_cleanup()
raise ProvisioningError(f"Error in install(): {e}")
raise ProvisioningError(f"Error in script install() step: {e}")
# Phase 8 - script: cleanup()
# * Run cleanup steps
@ -723,7 +723,7 @@ def create_vm(
vm_builder.cleanup()
except Exception as e:
general_cleanup()
raise ProvisioningError(f"Error in cleanup(): {e}")
raise ProvisioningError(f"Error in script cleanup() step: {e}")
# Phase 9 - general cleanup
# * Clean up the chroot from earlier