line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# (c) Jan Gehring |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Rex::Inventory::Hal::Object::Volume; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
17
|
use v5.12.5; |
|
1
|
|
|
|
|
4
|
|
8
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
29
|
|
9
|
1
|
|
|
1
|
|
6
|
use Data::Dumper; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.14.2.3'; # TRIAL VERSION |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
6
|
use Rex::Inventory::Hal::Object; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
14
|
1
|
|
|
1
|
|
25
|
use base qw(Rex::Inventory::Hal::Object); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
498
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
__PACKAGE__->has( |
17
|
|
|
|
|
|
|
[ |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
{ key => "block.device", accessor => "dev", }, |
20
|
|
|
|
|
|
|
{ key => "volume.size", accessor => "size", }, |
21
|
|
|
|
|
|
|
{ key => "volume.fstype", accessor => "fstype" }, |
22
|
|
|
|
|
|
|
{ key => "volume.uuid", accessor => "uuid" }, |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
] |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new { |
28
|
0
|
|
|
0
|
0
|
|
my $that = shift; |
29
|
0
|
|
0
|
|
|
|
my $proto = ref($that) || $that; |
30
|
0
|
|
|
|
|
|
my $self = {@_}; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
bless( $self, $proto ); |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return $self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub is_parition { |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
40
|
0
|
0
|
|
|
|
|
return $self->get('volume.is_partition') eq "true" ? 1 : 0; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub is_mounted { |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
47
|
0
|
0
|
|
|
|
|
return $self->get('volume.is_mounted') eq "true" ? 1 : 0; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub is_cdrom { |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
54
|
0
|
0
|
|
|
|
|
if ( grep { /^storage\.cdrom$/ } $self->get('info.capabilities') ) { |
|
0
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
return 1; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub is_volume { |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
63
|
0
|
0
|
|
|
|
|
if ( grep { !/^false$/ } $self->get('block.is_volume') ) { |
|
0
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
return 1; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub is_floppy { |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
72
|
0
|
0
|
|
|
|
|
if ( grep { /^floppy$/ } $self->get('storage.drive_type') ) { |
|
0
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
return 1; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |