summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-06-25 13:10:27 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-06-25 13:10:27 -0700
commit92fefe6e3fea41f98593073466dbfc47853cb7b6 (patch)
tree79fd03f2c242aba249e78ccd713c9bd9fbb6c2d1 /scripts
parentdda7139aa3f37f93726962b0bf35464ceeffc8b5 (diff)
downloadvyatta-cfg-92fefe6e3fea41f98593073466dbfc47853cb7b6.tar.gz
vyatta-cfg-92fefe6e3fea41f98593073466dbfc47853cb7b6.zip
correct error message when attempting to deactivate a leaf or multi node.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta-activate-config.pl12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/vyatta-activate-config.pl b/scripts/vyatta-activate-config.pl
index 6226f81..87791f3 100644
--- a/scripts/vyatta-activate-config.pl
+++ b/scripts/vyatta-activate-config.pl
@@ -71,7 +71,10 @@ if (!defined $ARGV[1] || $ARGV[1] eq '') {
#adjust for leaf node
my $i = 0;
-my @path = @ARGV[1..$#ARGV];
+my $arg_ct = $#ARGV;
+my @path = @ARGV[1..$arg_ct];
+my @parent_path = @ARGV[1..($arg_ct-1)];
+
foreach my $elem (@path) {
$elem =~ s/\//%2F/g;
$elem =~ s/\s+/\//g;
@@ -90,6 +93,13 @@ if (-e $full_path) {
}
}
else {
+ #check if this is a leaf node with value
+ my $parent_path_leaf = $ENV{VYATTA_TEMP_CONFIG_DIR} . "/" . join('/', @parent_path) . "/node.val";
+ if (-e $parent_path_leaf) {
+ #prevent setting on leaf or multi, check for node.val
+ printf("Cannot deactivate end node\n");
+ exit 1;
+ }
printf("This configuration element does not exist: " . join(' ', @path) . "\n");
exit 1;
}