From f5622929e01a6578461639afb70e12ab72b5aca7 Mon Sep 17 00:00:00 2001 From: Christian Ramseyer Date: Fri, 28 Dec 2018 15:33:02 +0100 Subject: [PATCH] Provide stdin to IOSXR.pm when none available (#462) * See issue #461 for a detailed description --- lib/App/Netdisco/SSHCollector/Platform/IOSXR.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/App/Netdisco/SSHCollector/Platform/IOSXR.pm b/lib/App/Netdisco/SSHCollector/Platform/IOSXR.pm index 37d44e00..a3b1210c 100644 --- a/lib/App/Netdisco/SSHCollector/Platform/IOSXR.pm +++ b/lib/App/Netdisco/SSHCollector/Platform/IOSXR.pm @@ -36,6 +36,11 @@ Returns a list of hashrefs in the format C<{ mac => MACADDR, ip => IPADDR }>. sub arpnip { my ($self, $hostlabel, $ssh, $args) = @_; + # IOSXR show commands seem to depend on an available STDIN + unless (-t STDIN){ + open STDIN, "<", "/dev/zero" or warn "Failed to fake stdin: $!"; + } + debug "$hostlabel $$ arpnip()"; my @data = $ssh->capture("show arp vrf all");