From d055f29dbd5b3851e9dc18b710bf759df410ad8d Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 14 Jul 2024 15:00:40 +0100 Subject: op-mode: T6580: read active nodes directly from the config tree without calling cli-shell-api --- scripts/build-command-op-templates | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/build-command-op-templates') diff --git a/scripts/build-command-op-templates b/scripts/build-command-op-templates index 46ad634b9..d203fdcef 100755 --- a/scripts/build-command-op-templates +++ b/scripts/build-command-op-templates @@ -3,7 +3,7 @@ # build-command-template: converts new style command definitions in XML # to the old style (bunch of dirs and node.def's) command templates # -# Copyright (C) 2017 VyOS maintainers +# Copyright (C) 2017-2024 VyOS maintainers # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -20,6 +20,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 # USA +import re import sys import os import argparse @@ -108,7 +109,8 @@ def get_properties(p): for i in lists: comp_exprs.append("echo \"{0}\"".format(i.text)) for i in paths: - comp_exprs.append("/bin/cli-shell-api listActiveNodes {0} | sed -e \"s/'//g\" && echo".format(i.text)) + path = re.sub(r'\s+', '/', i.text) + comp_exprs.append("ls /opt/vyatta/config/active/{0} 2>/dev/null".format(path)) for i in scripts: comp_exprs.append("{0}".format(i.text)) if comptype is not None: -- cgit v1.2.3