Subversion Repositories havirt

Rev

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

Rev 5 Rev 6
Line 45... Line 45...
45
 
45
 
46
BEGIN {
46
BEGIN {
47
   use FindBin;
47
   use FindBin;
48
   use File::Spec;
48
   use File::Spec;
49
   # use libraries from the directory this script is in
49
   # use libraries from the directory this script is in
-
 
50
   use Cwd 'abs_path';
-
 
51
   use File::Basename;
50
   use lib File::Spec->catdir($FindBin::Bin);
52
   use lib dirname( abs_path( __FILE__ ) );
51
}
53
}
52
 
54
 
-
 
55
 
-
 
56
 
-
 
57
 
-
 
58
 
53
use havirt; # Load all our shared stuff
59
use havirt; # Load all our shared stuff
54
 
60
 
55
use Data::Dumper;
61
use Data::Dumper;
56
use YAML::Tiny;
62
use YAML::Tiny;
57
 
63
 
Line 252... Line 258...
252
   'debug|d+' => \$DEBUG,
258
   'debug|d+' => \$DEBUG,
253
   'help|h' => \$help,
259
   'help|h' => \$help,
254
   'version|v' => \$version
260
   'version|v' => \$version
255
) or die "Error parsing command line\n";
261
) or die "Error parsing command line\n";
256
 
262
 
-
 
263
my $command = shift; # the first one is the actual subsection
-
 
264
my $action = shift; # second is action to run
257
                  
265
                  
258
if ( $help ) { &help() ; exit; }
266
if ( $help || ! $command ) { &help() ; exit; }
259
if ( $version ) { use File::Basename; print basename($0) . " v$VERSION\n"; exit; }
267
if ( $version ) { use File::Basename; print basename($0) . " v$VERSION\n"; exit; }
260
 
268
 
261
my $command = shift; # the first one is the actual subsection
-
 
262
my $action = shift; # second is action to run
-
 
263
 
269
 
264
print "Parameters are\nreportFormat\t$reportFormat\ntargetNode\t$targetNode\ndryRun\t$dryRun\nDEBUG\t$DEBUG\n" if $DEBUG;
270
print "Parameters are\nreportFormat\t$reportFormat\ntargetNode\t$targetNode\ndryRun\t$dryRun\nDEBUG\t$DEBUG\n" if $DEBUG;
265
print "Command = $command\nAction = $action\n" if $DEBUG;
271
print "Command = $command\nAction = $action\n" if $DEBUG;
266
 
272
 
267
if ( $command eq 'node' ) {
273
if ( $command eq 'node' ) {