Improve error messages
This commit is contained in:
parent
47b0704555
commit
da85480488
|
@ -613,7 +613,7 @@ def create_vm(
|
||||||
vm_builder.setup()
|
vm_builder.setup()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
general_cleanup()
|
general_cleanup()
|
||||||
raise ProvisioningError(f"Error in setup(): {e}")
|
raise ProvisioningError(f"Error in script setup() step: {e}")
|
||||||
|
|
||||||
# Phase 5 - script: create()
|
# Phase 5 - script: create()
|
||||||
# * Prepare the libvirt XML defintion for the VM
|
# * Prepare the libvirt XML defintion for the VM
|
||||||
|
@ -635,7 +635,7 @@ def create_vm(
|
||||||
vm_schema = vm_builder.create()
|
vm_schema = vm_builder.create()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
general_cleanup()
|
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))
|
print("Generated VM schema:\n{}\n".format(vm_schema))
|
||||||
|
|
||||||
|
@ -681,7 +681,7 @@ def create_vm(
|
||||||
vm_builder.prepare()
|
vm_builder.prepare()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
general_cleanup()
|
general_cleanup()
|
||||||
raise ProvisioningError(f"Error in prepare(): {e}")
|
raise ProvisioningError(f"Error in script prepare() step: {e}")
|
||||||
|
|
||||||
# Phase 7 - script: install()
|
# Phase 7 - script: install()
|
||||||
# * Run installation with arguments
|
# * Run installation with arguments
|
||||||
|
@ -702,7 +702,7 @@ def create_vm(
|
||||||
vm_builder.install()
|
vm_builder.install()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
general_cleanup()
|
general_cleanup()
|
||||||
raise ProvisioningError(f"Error in install(): {e}")
|
raise ProvisioningError(f"Error in script install() step: {e}")
|
||||||
|
|
||||||
# Phase 8 - script: cleanup()
|
# Phase 8 - script: cleanup()
|
||||||
# * Run cleanup steps
|
# * Run cleanup steps
|
||||||
|
@ -723,7 +723,7 @@ def create_vm(
|
||||||
vm_builder.cleanup()
|
vm_builder.cleanup()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
general_cleanup()
|
general_cleanup()
|
||||||
raise ProvisioningError(f"Error in cleanup(): {e}")
|
raise ProvisioningError(f"Error in script cleanup() step: {e}")
|
||||||
|
|
||||||
# Phase 9 - general cleanup
|
# Phase 9 - general cleanup
|
||||||
# * Clean up the chroot from earlier
|
# * Clean up the chroot from earlier
|
||||||
|
|
Loading…
Reference in New Issue