summaryrefslogtreecommitdiff
path: root/src/services/vyos-configd
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-07-18 13:15:27 +0100
committerGitHub <noreply@github.com>2024-07-18 13:15:27 +0100
commita64e2cebb07e782330b43298b655d0aff65dbcda (patch)
tree6b51390845b54f14de0ea49590f62883c414abe2 /src/services/vyos-configd
parent360a3a73b6d5e9a238ab4ba86879b1c27fa86104 (diff)
parentecd125d9cc9efd0fcf19dcbe26bdcc97cde32617 (diff)
downloadvyos-1x-a64e2cebb07e782330b43298b655d0aff65dbcda.tar.gz
vyos-1x-a64e2cebb07e782330b43298b655d0aff65dbcda.zip
Merge pull request #3822 from vyos/mergify/bp/circinus/pr-3813
configdep: T6559: fix regression in dependent script error under configd (backport #3813)
Diffstat (limited to 'src/services/vyos-configd')
-rwxr-xr-xsrc/services/vyos-configd19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/services/vyos-configd b/src/services/vyos-configd
index d92b539c8..87f7c0e25 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)
@@ -219,6 +220,7 @@ def process_node_data(config, data, last: bool = False) -> int:
script_name = None
args = []
+ config.dependency_list.clear()
res = re.match(r'^(VYOS_TAGNODE_VALUE=[^/]+)?.*\/([^/]+).py(.*)', data)
if res.group(1):
@@ -234,17 +236,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