line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Backup::Omni::Session::Results; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1151
|
use Params::Validate ':all'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
224
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Backup::Omni::Class |
8
|
1
|
|
|
|
|
10
|
version => $VERSION, |
9
|
|
|
|
|
|
|
base => 'Backup::Omni::Base', |
10
|
|
|
|
|
|
|
utils => 'omni2dt trim', |
11
|
|
|
|
|
|
|
constants => 'OMNIDB', |
12
|
|
|
|
|
|
|
constant => { |
13
|
|
|
|
|
|
|
COMMAND => '%s -rpt %s -detail', |
14
|
|
|
|
|
|
|
}, |
15
|
|
|
|
|
|
|
vars => { |
16
|
|
|
|
|
|
|
PARAMS => { |
17
|
|
|
|
|
|
|
-session => 1, |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
} |
20
|
1
|
|
|
1
|
|
6
|
; |
|
1
|
|
|
|
|
8
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Params::Validate::validation_options( |
23
|
|
|
|
|
|
|
on_fail => sub { |
24
|
|
|
|
|
|
|
my $params = shift; |
25
|
|
|
|
|
|
|
my $class = __PACKAGE__; |
26
|
|
|
|
|
|
|
Backup::Omni::Base::validation_exception($params, $class); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
31
|
|
|
|
|
|
|
# Public Methods |
32
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
35
|
|
|
|
|
|
|
# Private Methods |
36
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub init { |
39
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $self = $class->SUPER::init(@_); |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
my $command = sprintf(COMMAND, OMNIDB, $self->session); |
44
|
0
|
|
|
|
|
|
my @result = `$command`; |
45
|
0
|
|
|
|
|
|
my $rc = $?; |
46
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
unless (grep(/SessionID/, @result)) { |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
$self->throw_msg( |
50
|
|
|
|
|
|
|
'backup.omni.session.results', |
51
|
|
|
|
|
|
|
'noresults', |
52
|
|
|
|
|
|
|
$self->session |
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
foreach my $line (@result) { |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
chomp($line); |
60
|
0
|
0
|
|
|
|
|
next if ($line eq ''); |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
$line =~ m/^(.*): (.*)/; |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my $key = $1; |
65
|
0
|
|
|
|
|
|
my $value = $2; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
$key = trim($key); |
68
|
0
|
|
|
|
|
|
$key =~ s/ /_/g; |
69
|
0
|
|
|
|
|
|
$key = lc($key); |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
$value = trim($value); |
72
|
0
|
0
|
|
|
|
|
$value = omni2dt($value) if ($value =~ /\w\w\w \d\d \w\w\w \d\d\d\d/); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# order is important here. Don't change |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
$self->class->accessors($key); # may cause redefintaion errors |
77
|
0
|
|
|
|
|
|
$self->{$key} = $value; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
return $self; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__END__ |