Netconf/Manager.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 33 CC 4 SCAR 28.0
CC
4
Cov
0%
new
20.0
BEGIN
2.0
CRAP 16.4
1 package Net::Netconf::Manager;
2  
3 use Carp;
4 our $VERSION ='1.02';
5  
6 # This instantiates a Junoscript or a Netconf device depending on the 'server'
7 # specified. Default is Netconf.
8 sub new
9 {
10 my($class, %args) = @_;
11 my $self = { %args };
12 my $device = undef;
13  
14 # Junoscript session
15 if (defined $self->{'server'} && $self->{'server'} eq 'junoscript') {
16 eval 'require JUNOS::Device';
17 if ($@) {
18 croak 'Error: ' . $@;
19 }
20 $device = new JUNOS::Device(%args);
21 } else { # Netconf session
22 eval 'require Net::Netconf::Device';
23 if ($@) {
24 croak 'Error: ' . $@;
25 }
26 $device = new Net::Netconf::Device(%args);
27 }
28 $device;
29 }
30  
31 1;
32  
33 __END__