don't show stacktrace if update fail

This commit is contained in:
Jörg Thalheim
2024-11-08 15:17:04 +01:00
parent 4da648bf0a
commit d3abedafa9

View File

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