summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2024-07-14 15:00:40 +0100
committerDaniil Baturin <daniil@baturin.org>2024-07-14 15:00:40 +0100
commitd055f29dbd5b3851e9dc18b710bf759df410ad8d (patch)
treedbbe95cafcbfb9e71f1a2e1fe32783e0772edb4c
parent887de85b7a78dde370ddb71ddcb3f87557536e08 (diff)
downloadvyos-1x-d055f29dbd5b3851e9dc18b710bf759df410ad8d.tar.gz
vyos-1x-d055f29dbd5b3851e9dc18b710bf759df410ad8d.zip
op-mode: T6580: read active nodes directly from the config tree
without calling cli-shell-api
-rwxr-xr-xscripts/build-command-op-templates6
1 files changed, 4 insertions, 2 deletions
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 <maintainers@vyos.net>
+# Copyright (C) 2017-2024 VyOS maintainers <maintainers@vyos.net>
#
# 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: