clan-vm-manager: Fixing vm starting.

This commit is contained in:
Qubasa
2024-02-16 16:10:49 +07:00
parent 0b0867907e
commit 8a0edddca7
8 changed files with 59 additions and 79 deletions

View File

@@ -32,7 +32,9 @@ class VMAttr:
log.debug(f"qmp_socket: {self._qmp_socket}")
rpath = self._qmp_socket.resolve()
if not rpath.exists():
raise ClanError(f"qmp socket {rpath} does not exist. Is the VM running?")
raise ClanError(
f"qmp socket {rpath} does not exist. Is the VM running?"
)
self._qmp = QEMUMonitorProtocol(str(rpath))
self._qmp.connect()
try:

View File

@@ -37,7 +37,7 @@ def facts_to_nixos_config(facts: dict[str, dict[str, bytes]]) -> dict:
# TODO move this to the Machines class
def build_vm(
machine: Machine, vm: VmConfig, tmpdir: Path, nix_options: list[str]
machine: Machine, vm: VmConfig, tmpdir: Path, nix_options: list[str] = []
) -> dict[str, str]:
secrets_dir = get_secrets(machine, tmpdir)