Provide stdin to IOSXR.pm when none available (#462)

* See issue #461 for a detailed description
This commit is contained in:
Christian Ramseyer
2018-12-28 15:33:02 +01:00
committed by Oliver Gorwits
parent 9f8dd0039b
commit f5622929e0

View File

@@ -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");