Machine __str__ impl
This commit is contained in:
parent
a3207f7011
commit
649e345585
@ -31,6 +31,12 @@ class Machine:
|
|||||||
if deployment_info is not None:
|
if deployment_info is not None:
|
||||||
self.deployment_info = deployment_info
|
self.deployment_info = deployment_info
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return f"Machine(name={self.name}, flake={self.flake})"
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
return str(self)
|
||||||
|
|
||||||
def get_deployment_info(self) -> None:
|
def get_deployment_info(self) -> None:
|
||||||
self.deployment_info = json.loads(
|
self.deployment_info = json.loads(
|
||||||
self.build_nix("config.system.clan.deployment.file").read_text()
|
self.build_nix("config.system.clan.deployment.file").read_text()
|
||||||
|
@ -189,9 +189,9 @@ class ClanList(Gtk.Box):
|
|||||||
def vm_status_changed(self, switch: Gtk.Switch, vm: VM, _vm: VM) -> None:
|
def vm_status_changed(self, switch: Gtk.Switch, vm: VM, _vm: VM) -> None:
|
||||||
switch.set_active(vm.is_running())
|
switch.set_active(vm.is_running())
|
||||||
switch.set_state(vm.is_running())
|
switch.set_state(vm.is_running())
|
||||||
print("====> Set switch to", vm.is_running())
|
|
||||||
exitc = vm.process.proc.exitcode
|
exitc = vm.process.proc.exitcode
|
||||||
if not vm.is_running() and exitc != 0 and exitc != -15:
|
print("VM exited with code:", exitc)
|
||||||
|
if not vm.is_running() and exitc != 0:
|
||||||
print("VM exited with error. Exitcode:", exitc)
|
print("VM exited with error. Exitcode:", exitc)
|
||||||
print(vm.read_log())
|
print(vm.read_log())
|
||||||
self.show_error_dialog(vm.read_log())
|
# self.show_error_dialog(vm.read_log())
|
||||||
|
Loading…
Reference in New Issue
Block a user