Commit f85b65b1 authored by Mike Hibler's avatar Mike Hibler

Minor fixes for snmpit_remote:

Add missing argument to RecordVlanInsertion().

Don't return 1 from RemoteDoList() on error.  The caller is expecting a list
and not any sort of error.  Instead, on error we tbdie() which is what other
backend modules do on errors.
parent 7b805ae9
......@@ -20,6 +20,7 @@ use lib '@prefix@/lib';
use English;
use libdb;
use libtestbed;
use libtblog qw(tbdie);
use snmpit_lib;
use Lan;
use libxmlrpc;
......@@ -85,7 +86,6 @@ sub commonTail($$)
defined($response->{"output"}) && $response->{"output"} ne "") {
print $response->{"output"};
}
print STDERR $response->{"output"};
return $response;
}
......@@ -334,7 +334,8 @@ sub RemoteDoList(@)
$arg->{"vlans"} = [ @vlans ];
my $response = commonTail("list",$arg);
return 1
tbdie({cause => 'hardware'},
"elabinelab::vlansv2 returns '" . $response->{"code"} . "'\n")
if ($response->{"code"});
my $xmlback = $response->{"output"};
if (!defined($xmlback)) { return @list; }
......@@ -346,6 +347,9 @@ sub RemoteDoList(@)
#
foreach my $vlres (split ',', $xmlback) {
my ($name, $num, $mems) = split '#', $vlres;
tbdie({cause => 'hardware'},
"elabinelab::vlansv2 returned bogus info: '$xmlback'\n")
if (!defined($num) || !defined($mems));
$Names{$num} = $name;
@{$Members{$num}} = ();
foreach my $mem (split " ", $mems) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment