Skip to content
GitLab
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
a5e8a6c9
Commit
a5e8a6c9
authored
Aug 10, 2004
by
Leigh B. Stoller
Browse files
Minor bug fix to statewait.
Add waitforactive() to avoid waiting for state='active' on the client.
parent
297994eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
xmlrpc/emulabserver.py.in
View file @
a5e8a6c9
...
...
@@ -1233,7 +1233,7 @@ class experiment:
argdict
[
"state"
]
=
[
argdict
[
"state"
],]
pass
res
=
DBQueryFatal
(
"select state
,gid
from experiments "
res
=
DBQueryFatal
(
"select state from experiments "
"where pid=%s and eid=%s"
,
(
argdict
[
"proj"
],
argdict
[
"exp"
]))
...
...
@@ -1252,6 +1252,7 @@ class experiment:
#
# First, see if the experiment is already in the desired state,
#
state
=
res
[
0
][
0
]
if
(
state
in
argdict
[
"state"
]):
return
EmulabResponse
(
RESPONSE_SUCCESS
,
value
=
state
,
output
=
state
)
...
...
@@ -1330,6 +1331,14 @@ class experiment:
del
(
mc
)
return
EmulabResponse
(
RESPONSE_SUCCESS
,
value
=
retval
,
output
=
retval
)
#
# Wrap up above for a simple "waitforactive" to avoid leaking more
# goo out then needed (eventstates).
#
def
waitforactive
(
self
,
version
,
argdict
):
argdict
[
"state"
]
=
"active"
;
return
self
.
statewait
(
version
,
argdict
);
#
# Return the node/link mappings for an experiment.
...
...
xmlrpc/xmlrpcapi.php3
View file @
a5e8a6c9
...
...
@@ -722,7 +722,48 @@ experiments.
<td>
The Emulab ID of the experiment
</td>
</tr>
</table>
<br>
<li><tt><b>
waitforactive
</b></tt>
: Wait for an experiment to reach
the
<em>
active
</em>
state. Typically, you would use this if you
launched a swapin asynchronously, and then wanted to wait later for
the swapin to complete.
<table
cellpadding=
2
>
<tr>
<th>
Name
</th><th>
Type
</th><th>
Description
</th>
</tr>
<tr></tr>
<tr>
<td><tt>
proj
</tt></td>
<td>
string
</td>
<td>
The Emulab project ID in which the experiment was created
</td>
</tr>
<tr>
<td><tt>
exp
</tt></td>
<td>
string
</td>
<td>
The Emulab ID of the experiment
</td>
</tr>
</table>
<br>
The optional arguments are:
<br><br>
<table
cellpadding=
2
>
<tr>
<th>
Name
</th><th>
Type
</th><th>
Default
</th><th>
Description
</th>
</tr>
<tr></tr>
<tr>
<td><tt>
timeout
</tt></td>
<td>
integer
</td>
<td><i>
forever
</i></td>
<td>
Timeout after this many
<b>
seconds
</b>
. The return code is
is
<tt>
RESPONSE_SUCCESS
</tt>
if experiment reaches the active state or
<tt>
RESPONSE_TIMEDOUT
</tt>
if the timer expires.
</td>
</tr>
</table>
<br>
<li><tt><b>
statewait
</b></tt>
: Wait for an experiment to reach a particular
state. State is one of swapped, active, swapping, activating, etc. If the
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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