Commit e8382c26 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Option to lookup and bind alternate user.

parent baa30a3e
...@@ -25,9 +25,14 @@ import xmlrpclib ...@@ -25,9 +25,14 @@ import xmlrpclib
from M2Crypto import X509 from M2Crypto import X509
ACCEPTSLICENAME=1 ACCEPTSLICENAME=1
OtherUser = None
execfile( "test-common.py" ) 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. # Get a credential for myself, that allows me to do things at the SA.
# #
...@@ -72,29 +77,32 @@ myslice = response["value"] ...@@ -72,29 +77,32 @@ myslice = response["value"]
print "New slice created" print "New slice created"
if debug: print str(myslice) 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 ..."
# #
## # Lookup another user so we can bind them to the slice.
## And bind the user to the slice so that he can get his own cred. #
## if OtherUser:
#params = {} params = {}
#params["uuid"] = leebee["uuid"] params["hrn"] = OtherUser;
#params["credential"] = myslice params["credential"] = mycredential
#rval,response = do_method("sa", "BindToSlice", params) params["type"] = "User"
#if rval: rval,response = do_method("sa", "Resolve", params)
# Fatal("Could not bind leebee to slice") if rval:
# pass Fatal("Could not resolve other user")
#leebee = response["value"] pass
#print "Bound leebee to slice at the SA" 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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment