From 8ff060c5890625b5cebfcc9d4bf36c141116289a Mon Sep 17 00:00:00 2001 From: Qubasa Date: Sat, 20 Sep 2025 16:18:14 +0200 Subject: [PATCH] clan_lib: Remote add to arguments override func --- pkgs/clan-cli/clan_lib/machines/update.py | 2 +- pkgs/clan-cli/clan_lib/ssh/remote.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/clan-cli/clan_lib/machines/update.py b/pkgs/clan-cli/clan_lib/machines/update.py index c2dfb5503..8289f6656 100644 --- a/pkgs/clan-cli/clan_lib/machines/update.py +++ b/pkgs/clan-cli/clan_lib/machines/update.py @@ -122,7 +122,7 @@ def upload_sources(machine: Machine, ssh: Host, upload_inputs: bool) -> str: def run_machine_update( machine: Machine, target_host: Remote | LocalHost, - build_host: Remote | LocalHost | None, + build_host: Remote | LocalHost | None = None, upload_inputs: bool = False, ) -> None: """Update an existing machine using nixos-rebuild or darwin-rebuild. diff --git a/pkgs/clan-cli/clan_lib/ssh/remote.py b/pkgs/clan-cli/clan_lib/ssh/remote.py index 6540302c4..e2e80a3ad 100644 --- a/pkgs/clan-cli/clan_lib/ssh/remote.py +++ b/pkgs/clan-cli/clan_lib/ssh/remote.py @@ -64,6 +64,8 @@ class Remote: def override( self, *, + user: str | None = None, + address: str | None = None, host_key_check: HostKeyCheck | None = None, private_key: Path | None = None, password: str | None = None, @@ -75,8 +77,8 @@ class Remote: ) -> "Remote": """Returns a new Remote instance with the same data but with a different host_key_check.""" return Remote( - address=self.address, - user=self.user, + address=address or self.address, + user=user or self.user, command_prefix=command_prefix or self.command_prefix, port=port or self.port, private_key=private_key if private_key is not None else self.private_key,