Merge pull request 'don't show stacktrace if an update fail' (#2333) from deployment into main
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ def generate_vars(
|
|||||||
raise ClanError(msg) from errors[0]
|
raise ClanError(msg) from errors[0]
|
||||||
|
|
||||||
if not was_regenerated:
|
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
|
return was_regenerated
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user