line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# (c) Jan Gehring |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Rex::Virtualization::Base; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
38
|
use v5.12.5; |
|
3
|
|
|
|
|
11
|
|
8
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
615
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '1.14.2.2'; # TRIAL VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
0
|
|
|
0
|
0
|
0
|
my $that = shift; |
14
|
0
|
|
0
|
|
|
0
|
my $proto = ref($that) || $that; |
15
|
0
|
|
|
|
|
0
|
my $self = {@_}; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
0
|
bless( $self, $proto ); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
0
|
return $self; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub execute { |
23
|
2
|
|
|
2
|
0
|
31
|
my ( $self, $action, $vmname, @opt ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
6
|
my $mod = ref($self) . "::$action"; |
26
|
2
|
|
|
1
|
|
123
|
eval "use $mod;"; |
|
1
|
|
|
1
|
|
11
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
27
|
|
|
|
|
|
|
|
28
|
2
|
50
|
|
|
|
37
|
if ($@) { |
29
|
0
|
|
|
|
|
0
|
Rex::Logger::info("No action $action available."); |
30
|
0
|
|
|
|
|
0
|
die("No action $action available."); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
2
|
|
|
|
|
11
|
return $mod->execute( $vmname, @opt ); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |