summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-07-14 16:29:18 -0500
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-07-17 13:04:07 +0000
commit71f4d7c721d4b9ebfd005e8429f1d6f5c907a5ff (patch)
treecd7e789a4e7b2fc9690ac8b499c060e25e874c17 /src/services
parent95d345c6600aa83abd6d3138ab5ef49abb73b0f3 (diff)
downloadvyos-1x-71f4d7c721d4b9ebfd005e8429f1d6f5c907a5ff.tar.gz
vyos-1x-71f4d7c721d4b9ebfd005e8429f1d6f5c907a5ff.zip
configdep: T6559: drop global redundancy removal to fix error reporting
(cherry picked from commit 7249d10f1fbb3f90a4bdbcd0223926d0380ddd3a)
Diffstat (limited to 'src/services')
-rwxr-xr-xsrc/services/vyos-configd18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/services/vyos-configd b/src/services/vyos-configd
index d92b539c8..cfbf7c03d 100755
--- a/src/services/vyos-configd
+++ b/src/services/vyos-configd
@@ -30,7 +30,6 @@ from vyos.defaults import directories
from vyos.utils.boot import boot_configuration_complete
from vyos.configsource import ConfigSourceString
from vyos.configsource import ConfigSourceError
-from vyos.configdep import call_dependents
from vyos.config import Config
from vyos import ConfigError
@@ -134,7 +133,8 @@ def explicit_print(path, mode, msg):
except OSError:
logger.critical("error explicit_print")
-def run_script(script, config, args) -> int:
+def run_script(script_name, config, args) -> int:
+ script = conf_mode_scripts[script_name]
script.argv = args
config.set_level([])
try:
@@ -143,8 +143,9 @@ def run_script(script, config, args) -> int:
script.generate(c)
script.apply(c)
except ConfigError as e:
- logger.critical(e)
- explicit_print(session_out, session_mode, str(e))
+ s = f'{script_name}: {repr(e)}'
+ logger.error(s)
+ explicit_print(session_out, session_mode, s)
return R_ERROR_COMMIT
except Exception as e:
logger.critical(e)
@@ -234,17 +235,10 @@ def process_node_data(config, data, last: bool = False) -> int:
args.insert(0, f'{script_name}.py')
if script_name not in include_set:
- # call dependents now if last element of prio queue is run
- # independent of configd
- if last:
- call_dependents(dependent_func=config.dependent_func)
return R_PASS
with stdout_redirected(session_out, session_mode):
- result = run_script(conf_mode_scripts[script_name], config, args)
-
- if last and result == R_SUCCESS:
- call_dependents(dependent_func=config.dependent_func)
+ result = run_script(script_name, config, args)
return result