re-store controllmaster in various places where it got removed.

This commit is contained in:
Jörg Thalheim
2025-05-27 15:39:09 +02:00
parent f3cdcef523
commit ddab4b5b94
7 changed files with 28 additions and 35 deletions

View File

@@ -149,15 +149,14 @@ class SecretStore(StoreBase):
def needs_upload(self, host: Remote) -> bool:
local_hash = self.generate_hash()
with host.ssh_control_master() as ssh:
remote_hash = ssh.run(
# TODO get the path to the secrets from the machine
[
"cat",
f"{self.machine.deployment['password-store']['secretLocation']}/.{self._store_backend}_info",
],
RunOpts(log=Log.STDERR, check=False),
).stdout.strip()
remote_hash = host.run(
# TODO get the path to the secrets from the machine
[
"cat",
f"{self.machine.deployment['password-store']['secretLocation']}/.{self._store_backend}_info",
],
RunOpts(log=Log.STDERR, check=False),
).stdout.strip()
if not remote_hash:
print("remote hash is empty")

View File

@@ -28,8 +28,8 @@ def upload_command(args: argparse.Namespace) -> None:
populate_secret_vars(machine, directory)
return
host = machine.target_host()
upload_secret_vars(machine, host)
with machine.target_host().ssh_control_master() as host:
upload_secret_vars(machine, host)
def register_upload_parser(parser: argparse.ArgumentParser) -> None: