Commit 36f81cec authored by Leigh Stoller's avatar Leigh Stoller

Replace card with iface since snmpit groks node:iface syntax.

parent 6385f62a
......@@ -174,6 +174,7 @@ sub logical($) { return field($_[0], 'logical'); }
sub speed($) { return field($_[0], 'current_speed'); }
sub trunk_mode($) { return field($_[0], 'trunk_mode'); }
sub trunk($) { return field($_[0], 'trunk'); }
sub whol($) { return field($_[0], 'whol'); }
sub current_speed($) { return field($_[0], 'current_speed'); }
sub mask($) { return field($_[0], 'mask'); }
sub uuid($) { return field($_[0], 'uuid'); }
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2004-2011 University of Utah and the Flux Group.
# Copyright (c) 2004-2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -38,6 +38,7 @@ use Exporter;
use lib "@prefix@/lib";
use libdb;
use Interface;
#
# Commands we run
......@@ -81,18 +82,27 @@ sub wholctrl($$@) {
# Find the boss interface while we are at it
#
for my $node (@nodes) {
my $result =
DBQueryFatal("select card,mac from interfaces ".
"where role='expt' and whol=1 and node_id='$node'");
if ($result->num_rows() == 0) {
my $interface;
my @interfaces = ();
if (Interface->LookupAll($node, \@interfaces)) {
warn "Could not lookup interfaces for $node, skipping\n";
$exitval++;
next;
}
foreach my $i (@interfaces) {
if ($i->IsExperimental() and $i->whol()) {
$interface = $i;
last;
}
}
if (!defined($interface)) {
warn "No WhOL interface for $node, skipping\n";
$exitval++;
next;
}
($card, $mac) = $result->fetchrow();
$portinfo{$node}{card} = $card;
$portinfo{$node}{mac} = $mac;
print STDERR "WhOL: $node: $card, $mac\n"
$portinfo{$node}{"iface"} = $interface->iface();
$portinfo{$node}{"mac"} = $interface->mac();
print STDERR "WhOL: $node: $iface, $mac\n"
if ($debug);
}
......@@ -122,7 +132,7 @@ sub whacksome($@) {
my ($iface, @nodelist) = @_;
my $failed = 0;
my @portlist = map { "$_:$portinfo{$_}{card}" } @nodelist;
my @portlist = map { "$_:" . $portinfo{$_}{"iface"} } @nodelist;
my $portstr = join(" ", @portlist);
if ($debug) {
......
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