blob: 46500e427d62435fcfcd859a4a778c787aa7971a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
package INF;
use INF::APC;
use INF::DSRx020;
use INF::ILO;
#$infs = [
# {
# host => 'ms2.foo.com',
# nice_name => 'ms2',
# community => 'write_cty_name',
# inf_type => 'apc'
# },
# {
# host => 'kvm2.foo.com',
# nice_name => 'kvm2',
# user => 'Admin',
# password => 'password',
# inf_type => 'dsr'
# },
#];
require 'INF/INF.pm';
sub new ($;$) {
my ( $class, $inf ) = @_;
if ( $inf->{inf_type} eq 'dsr' ) {
return INF::DSRx020->new($inf);
}
elsif ( $inf->{inf_type} eq 'apc' ) {
return INF::APC->new($inf);
}
elsif ( $inf->{inf_type} eq 'ilo' ) {
return INF::ILO->new($inf);
}
else {
return undef;
}
}
1;
|