diff options
author | Christian Breunig <christian@breunig.cc> | 2024-07-17 14:56:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-17 14:56:05 +0200 |
commit | 918be5713ad088a304be9b9d71c701887b769fc6 (patch) | |
tree | 266fbdcaed90bcaad27e567f259072dddddc12f2 | |
parent | 1564005b69137830ef8168dcce2e0701f85bb92e (diff) | |
parent | d055f29dbd5b3851e9dc18b710bf759df410ad8d (diff) | |
download | vyos-1x-918be5713ad088a304be9b9d71c701887b769fc6.tar.gz vyos-1x-918be5713ad088a304be9b9d71c701887b769fc6.zip |
Merge pull request #3811 from dmbaturin/T6580-op-mode-path-completion
op-mode: T6580: read active nodes directly from the config tree without calling cli-shell-api
-rwxr-xr-x | scripts/build-command-op-templates | 6 |
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: |