Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
36f81cec
Commit
36f81cec
authored
Aug 22, 2017
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace card with iface since snmpit groks node:iface syntax.
parent
6385f62a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
db/Interface.pm.in
db/Interface.pm.in
+1
-0
tbsetup/power_whol.pm.in
tbsetup/power_whol.pm.in
+20
-10
No files found.
db/Interface.pm.in
View file @
36f81cec
...
...
@@ -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'
);
}
...
...
tbsetup/power_whol.pm.in
View file @
36f81cec
#
!/usr/bin/perl -wT
#
#
Copyright
(
c
)
2004
-
201
1
University
of
Utah
and
the
Flux
Group
.
#
Copyright
(
c
)
2004
-
201
7
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment