Subversion Repositories havirt

Rev

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

Rev 7 Rev 8
Line 79... Line 79...
79
   return &main::report( \@header, \@data );
79
   return &main::report( \@header, \@data );
80
}
80
}
81
 
81
 
82
sub update {
82
sub update {
83
   &loadVirtDB();
83
   &loadVirtDB();
-
 
84
   unless ( @_ ) {
-
 
85
      # they didn't pass in anything, so do everything
-
 
86
      @_ = keys %{ $main::virtDB }
-
 
87
   } # unless
-
 
88
   print "Preparing to update " . join( "\n", @_ ) . "\n" if $main::DEBUG > 1;
-
 
89
   die;
84
   while ( my $virt = shift ) {
90
   while ( my $virt = shift ) {
85
      &parseDomain( $virt );
91
      &parseDomain( $virt );
86
   } # while
92
   } # while
87
   &writeDB( $domainDBName, $main::virtDB );
93
   &writeDB( $main::domainDBName, $main::virtDB );
88
}
94
}
89
 
95
 
90
sub getXMLValue {
96
sub getXMLValue {
91
   my ( $key, $string ) = @_;
97
   my ( $key, $string ) = @_;
92
   my $start = "<$key";
98
   my $start = "<$key";
Line 115... Line 121...
115
# get the XML definition file of a running domain off of whatever
121
# get the XML definition file of a running domain off of whatever
116
# node it is running on, and save it to disk
122
# node it is running on, and save it to disk
117
sub getVirtConfig {
123
sub getVirtConfig {
118
   my ($virt,$filename) = @_;
124
   my ($virt,$filename) = @_;
119
   my $return;
125
   my $return;
120
   print "In getVirtConfig looking for $virt with file $filename\n" if $DEBUG;
126
   print "In getVirtConfig looking for $virt with file $filename\n" if $main::DEBUG;
121
   if ( -f $filename ) {
127
   if ( -f $filename ) {
122
      open XML, "<$filename" or die "Could not read from $filename: $!\n";
128
      open XML, "<$filename" or die "Could not read from $filename: $!\n";
123
      $return = join( '', <XML> );
129
      $return = join( '', <XML> );
124
      close XML;
130
      close XML;
125
   } else {
131
   } else {