From 2e958dfd2787cb7a347213d6c665fd03ab976a63 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 17 Nov 2010 20:42:38 -0800 Subject: Cleanup bond-group syntax and commit checks Move check for address and state of slave to commit which allows for better error message. --- templates/interfaces/ethernet/node.tag/bond-group/node.def | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'templates/interfaces/ethernet') diff --git a/templates/interfaces/ethernet/node.tag/bond-group/node.def b/templates/interfaces/ethernet/node.tag/bond-group/node.def index cb339a42..3fe9ddbe 100644 --- a/templates/interfaces/ethernet/node.tag/bond-group/node.def +++ b/templates/interfaces/ethernet/node.tag/bond-group/node.def @@ -1,15 +1,12 @@ priority: 319 type: txt help: Assign interface to bonding group -commit:expression: exec \ - "${vyatta_sbindir}/vyatta-interfaces.pl --dev=$VAR(@) --check=bonding" - allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show=bonding +syntax:expression: pattern $VAR(@) "^bond[0-9]+$" \ + ; "bond-group $VAR(@): not a valid name" + +commit:expression: exec "${vyatta_sbindir}/vyatta-bonding.pl --dev=$VAR(@) --check=$VAR(../@)" -update: OLDG=`${vyatta_sbindir}/vyatta-cli-expand-var.pl \\$VAR\(/interfaces/ethernet/$VAR(../@)/bond-group/@\)` - if [ -n "$OLDG" ]; then - sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$OLDG --remove=$VAR(../@) - fi - sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$VAR(@) --add=$VAR(../@) +update: sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$VAR(@) --add=$VAR(../@) delete: sudo ${vyatta_sbindir}/vyatta-bonding.pl --dev=$VAR(@) --remove=$VAR(../@) -- cgit v1.2.3