summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-12-02 15:13:34 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2010-12-02 15:13:34 -0800
commit11b0a437451fcd39c6ab9a45ccd5bd35eb5f3cac (patch)
tree4fe1723c442cdef4f8fb8d2b48a6aa56331670c6 /scripts
parent7296a5d1517d4f7abf2858ae6bf6fe1cdc5c6bfa (diff)
downloadvyatta-cfg-11b0a437451fcd39c6ab9a45ccd5bd35eb5f3cac.tar.gz
vyatta-cfg-11b0a437451fcd39c6ab9a45ccd5bd35eb5f3cac.zip
remove comment/activate/deactivate from load-config.pl.
* remove broken comment handling from script. "comment" for load is now handled in the library. * remove activate/deactivate handling from script. need to reimplement pending re-design.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-load-config.pl59
1 files changed, 0 insertions, 59 deletions
diff --git a/scripts/vyatta-load-config.pl b/scripts/vyatta-load-config.pl
index 2767d9f..fe119cf 100755
--- a/scripts/vyatta-load-config.pl
+++ b/scripts/vyatta-load-config.pl
@@ -186,9 +186,6 @@ if ( scalar( keys %cfg_hier ) == 0 ) {
my %cfg_diff = Vyatta::ConfigLoad::getConfigDiff(\%cfg_hier);
my @set_list = @{ $cfg_diff{'set'} };
-my @deactivate_list = @{ $cfg_diff{'deactivate'} };
-my @activate_list = @{ $cfg_diff{'activate'} };
-my @comment_list = @{ $cfg_diff{'comment'} };
if (!defined($merge)) {
my @delete_list = @{ $cfg_diff{'delete'} };
@@ -216,62 +213,6 @@ foreach (@set_list) {
}
}
-
-
-
-foreach (@activate_list) {
- my $cmd = "$sbindir/my_activate $_";
- system("$cmd 1>/dev/null");
- #ignore error on complaint re: nested nodes
-}
-
-my $cobj = new Vyatta::Config;
-foreach (@deactivate_list) {
- if ($cobj->isLeafValue($_)) {
- # a leaf value. go up 1 level by removing the last comp.
- s/\s+\S+$//;
- }
- my $cmd = "$sbindir/my_deactivate $_";
- system("$cmd 1>/dev/null");
- #ignore error on complaint re: nested nodes
-}
-
-foreach (@comment_list) {
- my ( $cmd_ref ) = $_;
- #apply comment if it doesn't have an empty element at the array and a .comment file exists and this is not a merge
- if (!defined($merge) && $cmd_ref =~ /\"\"$/) {
- my @cmd_array = split(" ",$cmd_ref);
- pop(@cmd_array);
- my $rel_path = join '/', @cmd_array;
- my $path = "/opt/vyatta/config/active/" . $rel_path . "/.comment";
- if (-e $path) {
- my @cmd = ( "$sbindir/my_comment ", $cmd_ref );
- my $cmd_str = join ' ', @cmd;
- system("$cmd_str 1>/dev/null");
- }
- else {
- #not found, maybe a leaf?
- pop(@cmd_array);
- $rel_path = join '/', @cmd_array;
- my $leaf = "/opt/vyatta/config/active/" . $rel_path . "/node.val";
- if (-e $leaf) {
- $path = "/opt/vyatta/config/active/" . $rel_path . "/.comment";
- if (-e $path) {
- my @cmd = ( "$sbindir/my_comment ", $cmd_ref );
- my $cmd_str = join ' ', @cmd;
- system("$cmd_str 1>/dev/null");
- }
- }
- }
- }
- else {
- my @cmd = ( "$sbindir/my_comment ", $cmd_ref );
- my $cmd_str = join ' ', @cmd;
- system("$cmd_str 1>/dev/null");
- }
- #ignore error on complaint re: nested nodes
-}
-
my $rc = system("cli-shell-api sessionChanged");
if (defined $rc and $rc > 0) {
print "No configuration changes to commit\n";