rename machine.host to machine.target_host
This commit is contained in:
@@ -13,7 +13,7 @@ def create_backup(machine: Machine, provider: str | None = None) -> None:
|
||||
backup_scripts = json.loads(machine.eval_nix("config.clanCore.backups"))
|
||||
if provider is None:
|
||||
for provider in backup_scripts["providers"]:
|
||||
proc = machine.host.run(
|
||||
proc = machine.target_host.run(
|
||||
["bash", "-c", backup_scripts["providers"][provider]["create"]],
|
||||
)
|
||||
if proc.returncode != 0:
|
||||
@@ -23,7 +23,7 @@ def create_backup(machine: Machine, provider: str | None = None) -> None:
|
||||
else:
|
||||
if provider not in backup_scripts["providers"]:
|
||||
raise ClanError(f"provider {provider} not found")
|
||||
proc = machine.host.run(
|
||||
proc = machine.target_host.run(
|
||||
["bash", "-c", backup_scripts["providers"][provider]["create"]],
|
||||
)
|
||||
if proc.returncode != 0:
|
||||
|
||||
@@ -19,7 +19,7 @@ class Backup:
|
||||
def list_provider(machine: Machine, provider: str) -> list[Backup]:
|
||||
results = []
|
||||
backup_metadata = json.loads(machine.eval_nix("config.clanCore.backups"))
|
||||
proc = machine.host.run(
|
||||
proc = machine.target_host.run(
|
||||
["bash", "-c", backup_metadata["providers"][provider]["list"]],
|
||||
stdout=subprocess.PIPE,
|
||||
check=False,
|
||||
|
||||
@@ -20,7 +20,7 @@ def restore_service(
|
||||
env["JOB"] = backup.job_name
|
||||
env["FOLDERS"] = ":".join(folders)
|
||||
|
||||
proc = machine.host.run(
|
||||
proc = machine.target_host.run(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
@@ -34,7 +34,7 @@ def restore_service(
|
||||
f"failed to run preRestoreScript: {backup_folders[service]['preRestoreScript']}, error was: {proc.stdout}"
|
||||
)
|
||||
|
||||
proc = machine.host.run(
|
||||
proc = machine.target_host.run(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
@@ -48,7 +48,7 @@ def restore_service(
|
||||
f"failed to restore backup: {backup_metadata['providers'][provider]['restore']}"
|
||||
)
|
||||
|
||||
proc = machine.host.run(
|
||||
proc = machine.target_host.run(
|
||||
[
|
||||
"bash",
|
||||
"-c",
|
||||
|
||||
Reference in New Issue
Block a user