diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-03-03 13:31:02 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-03-03 13:31:02 -0800 |
commit | a3115836962b6607a3441f3eb7615ae324d83b1b (patch) | |
tree | 1de21af16eb42d516e3d9208b52669092c2838f8 | |
parent | 86f4250ae356e0e9755b8514a0222dccccdf387a (diff) | |
download | vyatta-cfg-qos-a3115836962b6607a3441f3eb7615ae324d83b1b.tar.gz vyatta-cfg-qos-a3115836962b6607a3441f3eb7615ae324d83b1b.zip |
change syntax checks for policy name
Only check syntax for policy names in syntax, check for name
conflicts later. Part of bug fix for policy name management.
-rw-r--r-- | templates/qos-policy/fair-queue/node.def | 7 | ||||
-rw-r--r-- | templates/qos-policy/traffic-shaper/node.def | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/templates/qos-policy/fair-queue/node.def b/templates/qos-policy/fair-queue/node.def index ba88e32..b45f93e 100644 --- a/templates/qos-policy/fair-queue/node.def +++ b/templates/qos-policy/fair-queue/node.def @@ -1,6 +1,7 @@ tag: type: txt help: Configure fair queueing policy -syntax:expression: exec " /opt/vyatta/sbin/vyatta-qos.pl --validate-name $VAR(../@) $VAR(@)" -update:expression: "/opt/vyatta/sbin/vyatta-qos.pl --update-policy $VAR(../@) $VAR(@)" -delete:expression: "/opt/vyatta/sbin/vyatta-qos.pl --delete-policy $VAR(@)" +syntax:expression: pattern $VAR(@) "^[[:alnum:]][-[:alnum:]]*$" + ; "invalid qos-policy name $VAR(@)" +update: /opt/vyatta/sbin/vyatta-qos.pl --update-policy $VAR(../@) $VAR(@) +delete: /opt/vyatta/sbin/vyatta-qos.pl --delete-policy $VAR(../@) $VAR(@) diff --git a/templates/qos-policy/traffic-shaper/node.def b/templates/qos-policy/traffic-shaper/node.def index f8a33f0..051c034 100644 --- a/templates/qos-policy/traffic-shaper/node.def +++ b/templates/qos-policy/traffic-shaper/node.def @@ -1,6 +1,7 @@ tag: type: txt help: Configure traffic shaping based policy -syntax:expression: exec " /opt/vyatta/sbin/vyatta-qos.pl --validate-name $VAR(../@) $VAR(@)" +syntax:expression: pattern $VAR(@) "^[[:alnum:]][-[:alnum:]]*$" + ; "invalid qos-policy name $VAR(@)" update:expression: "/opt/vyatta/sbin/vyatta-qos.pl --update-policy $VAR(../@) $VAR(@)" delete:expression: "/opt/vyatta/sbin/vyatta-qos.pl --delete-policy $VAR(@)" |