summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-09-25 14:30:57 +0100
committerGitHub <noreply@github.com>2024-09-25 14:30:57 +0100
commit2ba5089fb2cca7e3e172ec5b4ce6a79cc521312b (patch)
treedb3c1102d45173b2fa8dfb4698e81193b7dc601f
parent9661e27d8bda3873370f7ae9bb6c42da3376bed1 (diff)
parent5034db86b8c43846475e9876116e55a189fe7d06 (diff)
downloadvyos-1x-2ba5089fb2cca7e3e172ec5b4ce6a79cc521312b.tar.gz
vyos-1x-2ba5089fb2cca7e3e172ec5b4ce6a79cc521312b.zip
Merge pull request #3876 from jestabro/uncaught-conf-script-err-as-commit-errT6732-reusable-build-image
configd: T6608: report uncaught config script exceptions as commit error
-rwxr-xr-xsrc/services/vyos-configd8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/services/vyos-configd b/src/services/vyos-configd
index 2c0244a81..cb23642dc 100755
--- a/src/services/vyos-configd
+++ b/src/services/vyos-configd
@@ -24,6 +24,7 @@ import json
import typing
import logging
import signal
+import traceback
import importlib.util
import io
from contextlib import redirect_stdout
@@ -136,9 +137,10 @@ def run_script(script_name, config, args) -> tuple[int, str]:
except ConfigError as e:
logger.error(e)
return R_ERROR_COMMIT, str(e)
- except Exception as e:
- logger.critical(e)
- return R_ERROR_DAEMON, str(e)
+ except Exception:
+ tb = traceback.format_exc()
+ logger.error(tb)
+ return R_ERROR_COMMIT, tb
return R_SUCCESS, ''