diff options
| author | Daniil Baturin <daniil@baturin.org> | 2017-09-07 03:26:56 +0200 | 
|---|---|---|
| committer | Daniil Baturin <daniil@baturin.org> | 2017-09-07 03:26:56 +0200 | 
| commit | 08ecdea5e7b838e94b6654eb165f0f652ebbb584 (patch) | |
| tree | a46f3bdfbd03230d0cb1d7b96838ad5eb6232ae9 /scripts/build-command-templates | |
| parent | 38051ef6a3e4bab7928fb16537771e395ff30619 (diff) | |
| download | vyos-1x-08ecdea5e7b838e94b6654eb165f0f652ebbb584.tar.gz vyos-1x-08ecdea5e7b838e94b6654eb165f0f652ebbb584.zip  | |
Add support for priority tags. In 1.x, there's no way around using it.
Diffstat (limited to 'scripts/build-command-templates')
| -rwxr-xr-x | scripts/build-command-templates | 14 | 
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/build-command-templates b/scripts/build-command-templates index 70020ecc6..3c95bde21 100755 --- a/scripts/build-command-templates +++ b/scripts/build-command-templates @@ -79,7 +79,7 @@ def get_properties(p):      try:          props["help"] = p.find("help").text      except: -        props["help"] = None +        pass      # Get value help strings      try: @@ -91,9 +91,18 @@ def get_properties(p):      except:          props["val_help"] = [] +    # Get priority +    try: +        props["priority"] = p.find("priority").text +    except: +        pass +      return props  def make_node_def(props): +    # XXX: replace with a template processor if it grows +    #      out of control +      node_def = ""      if "tag" in props: @@ -101,6 +110,9 @@ def make_node_def(props):      node_def += "type: {0}\n".format(props["type"]) +    if "priority" in props: +        node_def += "priority: {0}\n".format(props["priority"]) +      if "help" in props:          node_def += "help: {0}\n".format(props["help"])  | 
