Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
05dc48bc
Commit
05dc48bc
authored
Aug 30, 2017
by
Leigh B Stoller
Browse files
Restore (not) dead code I over-zealously pruned.
parent
a9bfb282
Changes
1
Show whitespace changes
Inline
Side-by-side
xmlrpc/emulabserver.py.in
View file @
05dc48bc
...
@@ -5058,7 +5058,7 @@ class elabinelab:
...
@@ -5058,7 +5058,7 @@ class elabinelab:
#
#
# First map the mac to a node by looking in the interfaces table.
# First map the mac to a node by looking in the interfaces table.
#
#
dbres
=
DBQueryFatal
(
"select node_id from interfaces "
dbres
=
DBQueryFatal
(
"select node_id
,role,IP
from interfaces "
"where mac=%s"
,
"where mac=%s"
,
(
argdict
[
"mac"
],))
(
argdict
[
"mac"
],))
...
@@ -5066,12 +5066,44 @@ class elabinelab:
...
@@ -5066,12 +5066,44 @@ class elabinelab:
if
len
(
dbres
)
==
0
:
if
len
(
dbres
)
==
0
:
return
EmulabResponse
(
RESPONSE_ERROR
,
return
EmulabResponse
(
RESPONSE_ERROR
,
output
=
"Cannot map MAC to nodeid"
)
output
=
"Cannot map MAC to nodeid"
)
#
# This is all the inner boss cares about now.
#
nodeid
=
dbres
[
0
][
0
]
nodeid
=
dbres
[
0
][
0
]
dbres
=
DBQueryFatal
(
"select i.mac,i.role,i.IP "
" from interfaces as i "
"where node_id=%s "
,
(
nodeid
,))
result
=
{}
result
=
{}
result
[
"nodeid"
]
=
nodeid
result
[
"nodeid"
]
=
nodeid
result
[
"type"
]
=
""
interfaces
=
{}
for
res
in
dbres
:
tmp
=
{}
#
# The current control network becomes the outer control network.
# The experimental network with an IP assigned becomes the
# inner control network.
#
imac
=
res
[
0
]
role
=
res
[
1
]
IP
=
res
[
2
]
if
role
==
"ctrl"
:
role
=
"outer_ctrl"
pass
elif
role
==
"expt"
and
IP
!=
""
:
role
=
"ctrl"
pass
tmp
[
"role"
]
=
role
tmp
[
"IP"
]
=
IP
interfaces
[
imac
]
=
tmp
pass
result
[
"interfaces"
]
=
interfaces
return
EmulabResponse
(
RESPONSE_SUCCESS
,
result
,
output
=
str
(
result
))
return
EmulabResponse
(
RESPONSE_SUCCESS
,
result
,
output
=
str
(
result
))
pass
pass
...
...
Write
Preview
Supports
Markdown
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