Subversion Repositories havirt

Rev

Rev 17 | Rev 19 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17 Rev 18
Line 102... Line 102...
102
# reads information off of the stack (@_), but will add to that if --target
102
# reads information off of the stack (@_), but will add to that if --target
103
# was defined
103
# was defined
104
sub update {
104
sub update {
105
   &main::readDB( 1 ); # open and lock so we can write to it later
105
   &main::readDB( 1 ); # open and lock so we can write to it later
106
   my $return;
106
   my $return;
-
 
107
   my @requiredFields = ( 'maintenance' );
107
   my @targets;
108
   my @targets;
108
   if ( $main::targetNode ) {
109
   if ( $main::targetNode ) {
109
      push @_, $main::targetNode;
110
      push @_, $main::targetNode;
110
   }
111
   }
111
   @_ = keys %{$main::statusDB->{'node'}} unless @_;
112
   @_ = keys %{$main::statusDB->{'node'}} unless @_;
Line 120... Line 121...
120
            $value = $1;
121
            $value = $1;
121
         }
122
         }
122
         $key = $conversion{$key} if exists( $conversion{$key} );
123
         $key = $conversion{$key} if exists( $conversion{$key} );
123
         $main::statusDB->{'node'}->{$nodename}->{$key} = $value;
124
         $main::statusDB->{'node'}->{$nodename}->{$key} = $value;
124
      } # for
125
      } # for
-
 
126
      foreach my $field ( @requiredFields ) {
-
 
127
         $main::statusDB->{'node'}->{$nodename}->{$field} = '' 
-
 
128
            unless defined ( $main::statusDB->{'node'}->{$nodename}->{$field} );
-
 
129
      } # foreach
125
   } # while
130
   } # while
126
   print "main::statusDB->{'node'} state after update\n" . Dumper( $main::statusDB->{'node'} ) if $main::DEBUG;
131
   print "main::statusDB->{'node'} state after update\n" . Dumper( $main::statusDB->{'node'} ) if $main::DEBUG;
127
   &main::writeDB();
132
   &main::writeDB();
128
   return "Node has been updated\n";
133
   return "Node has been updated\n";
129
}      
134
}