From b76e4c808c954dcf498b510aaa9c8d6c91850991 Mon Sep 17 00:00:00 2001 From: erkin Date: Mon, 20 Nov 2023 08:01:59 +0300 Subject: op-mode: T4038: Python rewrite of image tools --- scripts/build-command-op-templates | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/build-command-op-templates') 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 \"\"") 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: -- cgit v1.2.3