Subversion Repositories havirt

Rev

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

Rev 9 Rev 10
Line 51... Line 51...
51
   push @return, "domain list [--format|-f screen|tsv]";
51
   push @return, "domain list [--format|-f screen|tsv]";
52
   push @return, "\tLists all domains with some statistics about them as screen or tsv (default screen)";
52
   push @return, "\tLists all domains with some statistics about them as screen or tsv (default screen)";
53
   return join( "\n", @return ) . "\n";
53
   return join( "\n", @return ) . "\n";
54
}
54
}
55
 
55
 
56
sub loadVirtDB {
-
 
57
   return if $main::virtDB;
-
 
58
   $main::virtDB = &main::readDB( $main::domainDBName );
-
 
59
}
-
 
60
 
-
 
61
 
56
 
62
sub list {
57
sub list {
63
   &loadVirtDB();
58
   &main::loadVirtDB();
64
   &main::loadNodePopulations();
59
   &main::loadNodePopulations();
65
   print Dumper( $main::nodePopulations ) if $main::DEBUG > 2;
60
   print Dumper( $main::nodePopulations ) if $main::DEBUG > 2;
66
 
61
 
67
   my @header;
62
   my @header;
68
   my @data;
63
   my @data;
Line 87... Line 82...
87
   
82
   
88
   return &main::report( \@header, \@data );
83
   return &main::report( \@header, \@data );
89
}
84
}
90
 
85
 
91
sub update {
86
sub update {
92
   &loadVirtDB();
87
   &main::loadVirtDB();
93
   unless ( @_ ) {
88
   unless ( @_ ) {
94
      # they didn't pass in anything, so do everything
89
      # they didn't pass in anything, so do everything
95
      @_ = keys %{ $main::virtDB }
90
      @_ = keys %{ $main::virtDB }
96
   } # unless
91
   } # unless
97
   print "Preparing to update " . join( "\n", @_ ) . "\n" if $main::DEBUG > 1;
92
   print "Preparing to update " . join( "\n", @_ ) . "\n" if $main::DEBUG > 1;