diff options
author | Paul Kocialkowski | 2023-02-08 14:14:11 +0100 |
---|---|---|
committer | Paul Kocialkowski | 2023-02-08 14:14:32 +0100 |
commit | e32196f716343e392f6159a2b740056fd1e57e27 (patch) | |
tree | cbb6f57a5b6b0c76b4ebeb20839a44eced31468b | |
parent | c2bb38102286b56e60afdee13c1430c0ba994e26 (diff) |
host-control: Rework system update with hook
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rwxr-xr-x | host-control | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/host-control b/host-control index a7c3505..a7c8716 100755 --- a/host-control +++ b/host-control @@ -385,8 +385,14 @@ class host_control(): def system_update(self, host): address = self.ssh_address(host) - # TODO: Move update command in config. - arguments = [ "apt", "update", "&&", "apt", "upgrade" ] + + hook = self.hook_lookup(host, "system-update") + if hook == None: + return 1 + + arguments = self.hook_command(hook) + if arguments == None: + return 1 command = self.ssh_command(address, arguments) |