Merge pull request 'don't show stacktrace if an update fail' (#2333) from deployment into main

This commit is contained in:
clan-bot
2024-11-08 14:48:57 +00:00
2 changed files with 3 additions and 7 deletions

View File

@@ -395,9 +395,8 @@ class Host:
ret = p.wait(timeout=max(0, timeout - (time.time() - start)))
if ret != 0:
if check:
raise subprocess.CalledProcessError(
ret, cmd=cmd, output=stdout_data, stderr=stderr_data
)
msg = f"Command {shlex.join(cmd)} failed with return code {ret}"
raise ClanError(msg)
cmdlog.warning(
f"[Command failed: {ret}] {displayed_cmd}",
extra={"command_prefix": self.command_prefix},
@@ -602,7 +601,6 @@ def _worker(
try:
results[idx] = HostResult(host, func(host))
except Exception as e:
kitlog.exception(e)
results[idx] = HostResult(host, e)
@@ -644,7 +642,6 @@ class HostGroup:
)
results.append(HostResult(host, proc))
except Exception as e:
kitlog.exception(e)
results.append(HostResult(host, e))
def _run_remote(
@@ -677,7 +674,6 @@ class HostGroup:
)
results.append(HostResult(host, proc))
except Exception as e:
kitlog.exception(e)
results.append(HostResult(host, e))
def _reraise_errors(self, results: list[HostResult[Any]]) -> None:

View File

@@ -364,7 +364,7 @@ def generate_vars(
raise ClanError(msg) from errors[0]
if not was_regenerated:
print("All secrets and facts are already up to date")
print("All vars are already up to date")
return was_regenerated