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
e8382c26
Commit
e8382c26
authored
Dec 16, 2009
by
Leigh B. Stoller
Browse files
Option to lookup and bind alternate user.
parent
baa30a3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
protogeni/test/registerslice.py
View file @
e8382c26
...
...
@@ -25,9 +25,14 @@ import xmlrpclib
from
M2Crypto
import
X509
ACCEPTSLICENAME
=
1
OtherUser
=
None
execfile
(
"test-common.py"
)
if
len
(
REQARGS
)
==
1
:
OtherUser
=
REQARGS
[
0
]
pass
#
# Get a credential for myself, that allows me to do things at the SA.
#
...
...
@@ -72,29 +77,32 @@ myslice = response["value"]
print
"New slice created"
if
debug
:
print
str
(
myslice
)
##
## Lookup another user so we can bind them to the slice.
##
#params = {}
#params["hrn"] = "leebee"
#params["credential"] = mycredential
#params["type"] = "User"
#rval,response = do_method("sa", "Resolve", params)
#if rval:
# Fatal("Could not resolve leebee")
# pass
#leebee = response["value"]
#print "Found leebee record at the SA, binding to slice ..."
#
##
## And bind the user to the slice so that he can get his own cred.
##
#params = {}
#params["uuid"] = leebee["uuid"]
#params["credential"] = myslice
#rval,response = do_method("sa", "BindToSlice", params)
#if rval:
# Fatal("Could not bind leebee to slice")
# pass
#leebee = response["value"]
#print "Bound leebee to slice at the SA"
# Lookup another user so we can bind them to the slice.
#
if
OtherUser
:
params
=
{}
params
[
"hrn"
]
=
OtherUser
;
params
[
"credential"
]
=
mycredential
params
[
"type"
]
=
"User"
rval
,
response
=
do_method
(
"sa"
,
"Resolve"
,
params
)
if
rval
:
Fatal
(
"Could not resolve other user"
)
pass
user
=
response
[
"value"
]
print
"Found other user record at the SA, binding to slice ..."
#
# And bind the user to the slice so that he can get his own cred.
#
params
=
{}
params
[
"uuid"
]
=
user
[
"uuid"
]
params
[
"credential"
]
=
myslice
rval
,
response
=
do_method
(
"sa"
,
"BindToSlice"
,
params
)
if
rval
:
Fatal
(
"Could not bind other user to slice"
)
pass
binding
=
response
[
"value"
]
print
"Bound other user to slice at the SA"
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