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
9aa974b0
Commit
9aa974b0
authored
Jul 19, 2005
by
Timothy Stack
Browse files
Add an experiment.nsfile method so you can get the nsfile for an
experiment.
parent
7539770a
Changes
1
Hide whitespace changes
Inline
Side-by-side
xmlrpc/emulabserver.py.in
View file @
9aa974b0
...
...
@@ -2313,6 +2313,52 @@ class experiment:
value
=
result
,
output
=
"ok"
)
#
# Return the nsfile for the experiment.
#
def
nsfile
(
self
,
version
,
argdict
):
if
version
!=
self
.
VERSION
:
return
EmulabResponse
(
RESPONSE_BADVERSION
,
output
=
"Client version mismatch!"
)
try
:
checknologins
()
pass
except
NoLoginsError
,
e
:
return
EmulabResponse
(
RESPONSE_REFUSED
,
output
=
str
(
e
))
# Check for valid arguments.
argerror
=
CheckRequiredArgs
(
argdict
,
(
"proj"
,
"exp"
))
if
(
argerror
):
return
argerror
if
not
(
re
.
match
(
"^[-\w]*$"
,
argdict
[
"proj"
])
and
re
.
match
(
"^[-\w]*$"
,
argdict
[
"exp"
])):
return
EmulabResponse
(
RESPONSE_BADARGS
,
output
=
"Improperly formed proj/exp!"
)
#
# Check permission. This will check proj/exp for illegal chars.
#
permerror
=
CheckExptPermission
(
self
.
uid
,
argdict
[
"proj"
],
argdict
[
"exp"
])
if
(
permerror
):
return
permerror
dbres
=
DBQueryFatal
(
"select nsfile from nsfiles where pid=%s and eid=%s"
,
(
argdict
[
"proj"
],
argdict
[
"exp"
]))
if
len
(
dbres
)
==
0
:
return
EmulabResponse
(
RESPONSE_ERROR
,
output
=
"No such experiment!"
)
result
=
dbres
[
0
][
0
]
return
EmulabResponse
(
RESPONSE_SUCCESS
,
value
=
result
,
output
=
"ok"
)
#
# Control the event system.
#
...
...
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