line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cisco::UCS::FEX; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp qw(croak); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
7
|
1
|
|
|
1
|
|
6
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
124
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ATTRIBUTES = qw(discovery dn id model operability perf power presence |
10
|
|
|
|
|
|
|
revision serial side thermal vendor voltage); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our %ATTRIBUTES = ( |
13
|
|
|
|
|
|
|
chassis_id => 'chassisId', |
14
|
|
|
|
|
|
|
config_state => 'configState', |
15
|
|
|
|
|
|
|
oper_state => 'operState', |
16
|
|
|
|
|
|
|
peer_status => 'peerCommStatus', |
17
|
|
|
|
|
|
|
switch_id => 'switchId', |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
{ |
21
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
357
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
while ( my ( $pseudo, $attribute ) = each %ATTRIBUTES ) { |
24
|
|
|
|
|
|
|
*{ __PACKAGE__ . '::' . $pseudo } = sub { |
25
|
0
|
|
|
0
|
|
|
my $self = shift; |
26
|
0
|
|
|
|
|
|
return $self->{$attribute} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
foreach my $attribute ( @ATTRIBUTES ) { |
31
|
|
|
|
|
|
|
*{ __PACKAGE__ . '::' . $attribute } = sub { |
32
|
0
|
|
|
0
|
|
|
my $self = shift; |
33
|
0
|
|
|
|
|
|
return $self->{$attribute} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new { |
40
|
0
|
|
|
0
|
0
|
|
my ( $class, %args ) = @_; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my $self = {}; |
43
|
0
|
|
|
|
|
|
bless $self, $class; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
defined $args{dn} |
46
|
|
|
|
|
|
|
? $self->{dn} = $args{dn} |
47
|
0
|
0
|
|
|
|
|
: croak 'dn not defined'; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
defined $args{ucs} |
50
|
|
|
|
|
|
|
? weaken($self->{ucs} = $args{ucs}) |
51
|
0
|
0
|
|
|
|
|
: croak 'ucs not defined'; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my %attr = %{ $self->{ucs}->resolve_dn( |
54
|
|
|
|
|
|
|
dn => $self->{dn} |
55
|
0
|
|
|
|
|
|
)->{outConfig}->{equipmentIOCard}}; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
while ( my ($k, $v) = each %attr ) { $self->{$k} = $v } |
|
0
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
return $self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |