summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-02-08 16:11:50 +0000
committerGitHub <noreply@github.com>2024-02-08 16:11:50 +0000
commit632c9d9f3d52e2c9571018553b5b45d9a3fe6ffd (patch)
tree0034b94a17e45192995749ed73b08054d2187b8d /scripts
parent98c6434e7433e6a0aa1034b39c9130d390bbe591 (diff)
parentb76e4c808c954dcf498b510aaa9c8d6c91850991 (diff)
downloadvyos-1x-632c9d9f3d52e2c9571018553b5b45d9a3fe6ffd.tar.gz
vyos-1x-632c9d9f3d52e2c9571018553b5b45d9a3fe6ffd.zip
Merge pull request #2507 from erkin/image-tools
op-mode: T4038: Python rewrite of image tools
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-command-op-templates7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/build-command-op-templates b/scripts/build-command-op-templates
index b008596dc..46ad634b9 100755
--- a/scripts/build-command-op-templates
+++ b/scripts/build-command-op-templates
@@ -100,6 +100,7 @@ def get_properties(p):
scripts = c.findall("script")
paths = c.findall("path")
lists = c.findall("list")
+ comptype = c.find("imagePath")
# Current backend doesn't support multiple allowed: tags
# so we get to emulate it
@@ -110,8 +111,12 @@ def get_properties(p):
comp_exprs.append("/bin/cli-shell-api listActiveNodes {0} | sed -e \"s/'//g\" && echo".format(i.text))
for i in scripts:
comp_exprs.append("{0}".format(i.text))
+ if comptype is not None:
+ props["comp_type"] = "imagefiles"
+ comp_exprs.append("echo -n \"<imagefiles>\"")
comp_help = " && ".join(comp_exprs)
props["comp_help"] = comp_help
+
except:
props["comp_help"] = []
@@ -127,6 +132,8 @@ def make_node_def(props, command):
help = props["help"]
help = fill(help, width=64, subsequent_indent='\t\t\t')
node_def += f'help: {help}\n'
+ if "comp_type" in props:
+ node_def += f'comptype: {props["comp_type"]}\n'
if "comp_help" in props:
node_def += f'allowed: {props["comp_help"]}\n'
if command is not None: