From 9b53ca0fbecc8c92fb9d9db80f8e7562e46f55fb Mon Sep 17 00:00:00 2001 From: ajragusa Date: Tue, 28 Aug 2018 13:09:58 +0000 Subject: [PATCH] getting ready to create 1.2.5a branch --- .../OESS/lib/OESS/MPLS/Device/Juniper/MX.pm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/perl-lib/OESS/lib/OESS/MPLS/Device/Juniper/MX.pm b/perl-lib/OESS/lib/OESS/MPLS/Device/Juniper/MX.pm index cb43903cb..208000328 100644 --- a/perl-lib/OESS/lib/OESS/MPLS/Device/Juniper/MX.pm +++ b/perl-lib/OESS/lib/OESS/MPLS/Device/Juniper/MX.pm @@ -258,6 +258,7 @@ B model => 'vmx' os_name => 'junos' version => '15.1F6.9' + major_rev => 15 } =cut @@ -294,6 +295,9 @@ sub get_system_information{ my $os_name = $xp->findvalue('/x:rpc-reply/x:system-information/x:os-name'); my $version = $xp->findvalue('/x:rpc-reply/x:system-information/x:os-version'); + my $major_rev = $version; + $major_rev =~ s/^(\d+)\..+$/$1/; + $self->{logger}->info("Using firmware version $version."); #also need to fetch the interfaces and find lo0.X @@ -366,7 +370,8 @@ sub get_system_information{ } $self->{'loopback_addr'} = $loopback_addr; - return {model => $model, version => $version, os_name => $os_name, host_name => $host_name, loopback_addr => $loopback_addr}; + $self->{'major_rev'} = $major_rev; + return {model => $model, version => $version, os_name => $os_name, host_name => $host_name, loopback_addr => $loopback_addr, major_rev => $major_rev}; } =head2 get_routed_lsps @@ -1448,7 +1453,7 @@ sub verify_connection{ } my $sysinfo = $self->get_system_information(); - if (($sysinfo->{"os_name"} eq "junos") && ($sysinfo->{"version"} eq "13.3R1.6" || $sysinfo->{"version"} eq '15.1F6-S6.4' || $sysinfo->{"version"} eq '15.1F6.9' || $sysinfo->{"version"} eq '15.1F6-S7.2' || $sysinfo->{version} eq '15.1I20171208_1648_amahale')){ + if (($sysinfo->{"os_name"} eq "junos") && ($sysinfo->{"version"} eq "13.3R1.6" || $sysinfo->{"version"} eq '15.1F6-S6.4' || $sysinfo->{"version"} eq '15.1F6.9' || $sysinfo->{"version"} eq '15.1F6-S7.2' || $sysinfo->{version} eq '15.1I20171208_1648_amahale' || $sysinfo->{"version"} eq '17.3R3.9')){ # print "Connection verified, proceeding\n"; return 1; } @@ -1659,8 +1664,12 @@ sub get_lsp_paths{ foreach my $path (@{$paths}) { if ($xp->exists('./r:path-active', $path)) { - my $next_hops = $xp->find('./r:explicit-route/r:address', $path); - + my $next_hops; + if ( $self->{'major_rev'} < 17 ) { + $next_hops = $xp->find('./r:explicit-route/r:address', $path); + } else { + $next_hops = $xp->find('./r:explicit-route/r:explicit-route-element/r:address', $path); + } foreach my $nh (@{$next_hops}) { push(@{$lsp_routes->{$name}}, $nh->textContent); }