forked from clan/clan-core
Merge pull request 'Machine __str__ impl' (#779) from Qubasa-heads/origin/Qubasa-fix into main
This commit is contained in:
commit
a0ebf882c5
@ -31,6 +31,12 @@ class Machine:
|
||||
if deployment_info is not None:
|
||||
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:
|
||||
self.deployment_info = json.loads(
|
||||
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:
|
||||
switch.set_active(vm.is_running())
|
||||
switch.set_state(vm.is_running())
|
||||
print("====> Set switch to", vm.is_running())
|
||||
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.read_log())
|
||||
self.show_error_dialog(vm.read_log())
|
||||
# self.show_error_dialog(vm.read_log())
|
||||
|
Loading…
Reference in New Issue
Block a user