line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OpenStack::Client::Base; |
2
|
|
|
|
|
|
|
$Net::OpenStack::Client::Base::VERSION = '0.1.4'; |
3
|
7
|
|
|
7
|
|
3483
|
use strict; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
190
|
|
4
|
7
|
|
|
7
|
|
35
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
570
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Net::OpenStack::Client::Base provides basic class structure for Net::OpenStack::Client |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head2 Public methods |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=over |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=item new |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new |
20
|
|
|
|
|
|
|
{ |
21
|
9
|
|
|
9
|
1
|
9674
|
my $this = shift; |
22
|
9
|
|
33
|
|
|
66
|
my $class = ref($this) || $this; |
23
|
9
|
|
|
|
|
36
|
my $self = { |
24
|
|
|
|
|
|
|
versions => {}, |
25
|
|
|
|
|
|
|
services => {}, |
26
|
|
|
|
|
|
|
}; # here, it gives a reference on a hash |
27
|
9
|
|
|
|
|
22
|
bless $self, $class; |
28
|
|
|
|
|
|
|
|
29
|
9
|
50
|
|
|
|
43
|
return $self->_initialize(@_) ? $self : undef; |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item error, warn, info, debug |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Convenience methods to access the log instance that might |
35
|
|
|
|
|
|
|
be passed during initialisation and set to $self->{log}. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
7
|
|
|
7
|
|
42
|
no strict 'refs'; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
707
|
|
40
|
|
|
|
|
|
|
foreach my $i (qw(error warn info debug)) { |
41
|
|
|
|
|
|
|
*{$i} = sub { |
42
|
317
|
|
|
317
|
|
624
|
my ($self, @args) = @_; |
43
|
317
|
50
|
|
|
|
700
|
if ($self->{log}) { |
44
|
317
|
|
|
|
|
948
|
return $self->{log}->$i(@args); |
45
|
|
|
|
|
|
|
} else { |
46
|
0
|
|
|
|
|
0
|
return; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
7
|
|
|
7
|
|
45
|
use strict 'refs'; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
770
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item verbose |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Convenience method to access verbose method of log instance if it exists. |
55
|
|
|
|
|
|
|
When absent, this is an alias for debug. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub verbose |
60
|
|
|
|
|
|
|
{ |
61
|
145
|
|
|
145
|
1
|
274
|
my ($self, @args) = @_; |
62
|
145
|
50
|
|
|
|
290
|
if ($self->{log}) { |
63
|
145
|
50
|
|
|
|
448
|
my $method = $self->{log}->can('verbose') ? 'verbose' : 'debug'; |
64
|
145
|
|
|
|
|
362
|
return $self->{log}->$method(@args); |
65
|
|
|
|
|
|
|
} else { |
66
|
0
|
|
|
|
|
|
return; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=pod |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=back |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |