From ff4e5339d0103f73bf36f4b63f7ce8970d25e29f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 29 Apr 2021 15:10:08 +0200 Subject: capsman-rolling-upgrade: properly handle vanished cap --- capsman-rolling-upgrade | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/capsman-rolling-upgrade b/capsman-rolling-upgrade index 9e7aec0..4c3b1c7 100644 --- a/capsman-rolling-upgrade +++ b/capsman-rolling-upgrade @@ -24,9 +24,13 @@ $ScriptLock $0; :if ($Delay > 120) do={ :set Delay 120; } :foreach RemoteCap in=[ / caps-man remote-cap find where version!=$InstalledVersion ] do={ :local RemoteCapVal [ / caps-man remote-cap get $RemoteCap ]; - $LogPrintExit2 info $0 ("Starting upgrade for " . $RemoteCapVal->"name" . \ + :if ([ :len $RemoteCapVal ] > 1) do={ + $LogPrintExit2 info $0 ("Starting upgrade for " . $RemoteCapVal->"name" . \ " (" . $RemoteCapVal->"identity" . ")...") false; - / caps-man remote-cap upgrade [ find where name=$RemoteCapVal->"name" ]; + / caps-man remote-cap upgrade $RemoteCap; + } else={ + $LogPrintExit2 warning $0 ("Remote CAP vanished, skipping upgrade.") false; + } :delay ($Delay . "s"); } } -- cgit v1.2.3-70-g09d2