summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-06-03 18:14:04 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-06-03 18:14:04 -0700
commit0494d74dc72f2c40430b8a426fd55a71a4f02bd7 (patch)
tree776b8d0629b1bff69082a1f9ba0bd7ebdc494070 /lib
parent8a857b663dffa584dd53b6c8aeac0652ae61825b (diff)
downloadvyatta-cfg-0494d74dc72f2c40430b8a426fd55a71a4f02bd7.tar.gz
vyatta-cfg-0494d74dc72f2c40430b8a426fd55a71a4f02bd7.zip
implemented modified notation for pre-commit activate/deactivate. added check on modified nodes prior to
load. modified active directory check.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Config.pm4
-rwxr-xr-xlib/Vyatta/ConfigOutput.pm62
2 files changed, 59 insertions, 7 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm
index 0e71ccf..93a2478 100755
--- a/lib/Vyatta/Config.pm
+++ b/lib/Vyatta/Config.pm
@@ -594,7 +594,7 @@ sub existsOrig {
my ($status, undef) = $self->getDeactivated($ttmp);
#only return value if status is not disabled (i.e. local or both)
if (defined($status) && ($status eq 'both' || $status eq 'active')) { #if a .disable is in local or active or both then return false
- return undef;
+ return;
}
}
@@ -678,7 +678,7 @@ sub getDeactivated {
$node =~ s/ /\//g;
while (1) {
- my $filepath = "$self->{_changes_only_dir_base}/$node";
+ my $filepath = "$self->{_new_config_dir_base}/$node";
my $filepathActive = "$self->{_active_dir_base}/$node";
my $local = $filepath . "/.disable";
diff --git a/lib/Vyatta/ConfigOutput.pm b/lib/Vyatta/ConfigOutput.pm
index 0cfb42b..81ee92d 100755
--- a/lib/Vyatta/ConfigOutput.pm
+++ b/lib/Vyatta/ConfigOutput.pm
@@ -85,7 +85,7 @@ sub displayValues {
if ($is_multi) {
my @ovals = $config->returnOrigValues('','true');
- my @nvals = $config->returnValues('');
+ my @nvals = $config->returnValues('','true');
if ($is_text) {
@ovals = map { (txt_need_quotes($_)) ? "\"$_\"" : "$_"; } @ovals;
@nvals = map { (txt_need_quotes($_)) ? "\"$_\"" : "$_"; } @nvals;
@@ -209,7 +209,25 @@ sub displayDeletedOrigChildren {
my ($state, $n) = $config->getDeactivated($path);
if (defined $state) {
- $dis = '! ';
+ if ($state eq 'active') {
+ if (defined($dont_show_as_deleted)) {
+ $dis = '! ';
+ }
+ else {
+ $dis = 'A ';
+ }
+ }
+ elsif ($state eq 'local') {
+ if (defined($dont_show_as_deleted)) {
+ $dis = ' ';
+ }
+ else {
+ $dis = 'D ';
+ }
+ }
+ else {
+ $dis = '! ';
+ }
}
else {
$dis = '';
@@ -244,7 +262,25 @@ sub displayDeletedOrigChildren {
#need separate check here
my ($state, $n) = $config->getDeactivated($path);
if (defined $state) {
- $dis = '! ';
+ if ($state eq 'active') {
+ if (defined($dont_show_as_deleted)) {
+ $dis = '! ';
+ }
+ else {
+ $dis = 'A ';
+ }
+ }
+ elsif ($state eq 'local') {
+ if (defined($dont_show_as_deleted)) {
+ $dis = ' ';
+ }
+ else {
+ $dis = 'D ';
+ }
+ }
+ else {
+ $dis = '! ';
+ }
}
else {
$dis = '';
@@ -308,7 +344,15 @@ sub displayChildren {
my ($state, $n) = $config->getDeactivated($path);
if (defined $state) {
- $dis = '! ';
+ if ($state eq 'active') {
+ $dis = 'A ';
+ }
+ elsif ($state eq 'local') {
+ $dis = 'D ';
+ }
+ else {
+ $dis = '! ';
+ }
}
else {
$dis = '';
@@ -350,7 +394,15 @@ sub displayChildren {
my ($state, $n) = $config->getDeactivated($path);
if (defined $state) {
- $dis = '! ';
+ if ($state eq 'active') {
+ $dis = 'A ';
+ }
+ elsif ($state eq 'local') {
+ $dis = 'D ';
+ }
+ else {
+ $dis = '! ';
+ }
}
else {
$dis = '';