summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorerkin <me@erkin.party>2023-11-20 08:01:59 +0300
committererkin <me@erkin.party>2024-01-25 17:38:55 +0300
commitb76e4c808c954dcf498b510aaa9c8d6c91850991 (patch)
tree00ce70d54f94ec03e42c34458404c8bc7220b658 /scripts
parent59b432b97e361f3f5670302f51881ee596afe2f8 (diff)
downloadvyos-1x-b76e4c808c954dcf498b510aaa9c8d6c91850991.tar.gz
vyos-1x-b76e4c808c954dcf498b510aaa9c8d6c91850991.zip
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: