Commit 19eca97d authored by Leigh B Stoller's avatar Leigh B Stoller

Use the slice urn from the resolve call instead of SLICEURN.

parent 8f948fb0
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -38,8 +38,8 @@ print "Got self credential"
#
# Lookup slice.
#
myslice = resolve_slice( SLICEURN, mycredential )
print "Resolved slice " + SLICEURN
myslice = resolve_slice( SLICENAME, mycredential )
print "Resolved slice " + myslice["urn"]
#
# Get the slice credential.
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -70,7 +70,7 @@ if debug: print str(mykeys)
#
# Lookup slice and get credential.
#
myslice = resolve_slice( SLICEURN, mycredential )
myslice = resolve_slice( SLICENAME, mycredential )
print "Asking for slice credential for " + SLICENAME
slicecredential = get_slice_credential( myslice, mycredential )
......@@ -82,7 +82,7 @@ print "Got the slice credential"
print "Creating the Sliver ..."
params = {}
params["credentials"] = (slicecredential,)
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["rspec"] = rspec
params["keys"] = mykeys
params["impotent"] = impotent
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -50,7 +50,7 @@ print "Got the slice credential"
print "Deleting the slice"
params = {}
params["credentials"] = (slicecred,)
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
rval,response = do_method("cm", "DeleteSlice", params, version="2.0")
if rval:
Fatal("Could not delete slice")
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -55,10 +55,10 @@ rval,response = do_method("cm", "Resolve", params, version="2.0")
if rval:
Fatal("Could not resolve slice")
pass
myslice = response["value"]
print str(myslice)
mysliver = response["value"]
print str(mysliver)
if not "sliver_urn" in myslice:
if not "sliver_urn" in mysliver:
Fatal("No sliver exists for slice")
pass
......@@ -67,7 +67,7 @@ if not "sliver_urn" in myslice:
#
params = {}
params["credentials"] = (slicecred,)
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
rval,response = do_method("cm", "GetSliver", params, version="2.0")
if rval:
Fatal("Could not get Sliver credential")
......@@ -80,7 +80,7 @@ print "Got the sliver credential, deleting the sliver";
#
params = {}
params["credentials"] = (slivercred,)
params["sliver_urn"] = myslice["sliver_urn"]
params["sliver_urn"] = mysliver["sliver_urn"]
rval,response = do_method("cm", "DeleteSliver", params, version="2.0")
if rval:
Fatal("Could not delete sliver")
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -82,7 +82,7 @@ print str(myslice)
#
print "Asking for sliver credential"
params = {}
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["credentials"] = (slicecred,)
rval,response = do_method("cm", "GetSliver", params, version="2.0")
if rval:
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -36,7 +36,7 @@ mycredential = get_self_credential()
#
# Lookup slice.
#
myslice = resolve_slice( SLICEURN, mycredential )
myslice = resolve_slice( SLICENAME, mycredential )
#
# Get the slice credential.
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -57,7 +57,7 @@ print "Got my SA credential, looking up " + SLICENAME
#
# Lookup slice and get credential.
#
myslice = resolve_slice( SLICEURN, mycredential )
myslice = resolve_slice( SLICENAME, mycredential )
print "Asking for slice credential for " + SLICENAME
slicecredential = get_slice_credential( myslice, mycredential )
......@@ -71,7 +71,7 @@ print "Got the slice credential"
print "Asking for a ticket from the local CM"
params = {}
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["credentials"] = (slicecredential,)
params["rspec"] = rspec
params["impotent"] = 0
......@@ -90,7 +90,7 @@ sys.exit(0)
#
print "Got the ticket, doing a update on it. "
params = {}
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["ticket"] = ticket
params["credentials"] = (slicecredential,)
params["rspec"] = rspec
......
......@@ -65,7 +65,7 @@ else:
print "Injecting the event ..."
params = {}
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["credentials"] = (slicecred,)
params["time"] = REQARGS[0]
params["name"] = REQARGS[1]
......
......@@ -81,10 +81,10 @@ rval,response = do_method("cm", "Resolve", params, version="2.0")
if rval:
Fatal("Could not resolve slice")
pass
myslice = response["value"]
print str(myslice)
mysliver = response["value"]
print str(mysliver)
if not "ticket_urn" in myslice:
if not "ticket_urn" in mysliver:
Fatal("No ticket exists for slice")
pass
......@@ -94,7 +94,7 @@ if not "ticket_urn" in myslice:
print "Asking for a copy of the ticket"
params = {}
params["credentials"] = (slicecred,)
params["urn"] = myslice["ticket_urn"]
params["urn"] = mysliver["ticket_urn"]
rval,response = do_method("cm", "Resolve", params, version="2.0")
if rval:
Fatal("Could not get the ticket")
......@@ -108,7 +108,7 @@ redeemcred = slicecred;
#
print "Asking for sliver credential"
params = {}
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["credentials"] = (slicecred,)
rval,response = do_method("cm", "GetSliver", params, version="2.0")
if not rval:
......@@ -122,7 +122,7 @@ print "Redeeming the ticket"
params = {}
params["credentials"] = (redeemcred,)
params["ticket"] = ticket
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["keys"] = mykeys
rval,response = do_method("cm", "RedeemTicket", params, version="2.0")
if rval:
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......
......@@ -87,7 +87,7 @@ print "Got the slice credential, attempting to renew the sliver...";
params = {}
params["credentials"] = (slicecred,)
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["valid_until"] = valid_until
rval,response = do_method("cm", "RenewSlice", params, version="2.0")
if rval:
......
......@@ -67,7 +67,7 @@ valid_until = time.strftime("%Y%m%dT%H:%M:%S",
params = {}
params["credentials"] = (slicecred,)
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["valid_until"] = valid_until
rval,response = do_method("cm", "RenewSlice", params, version="2.0")
if rval:
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -69,7 +69,7 @@ else:
#
params = {}
params["credentials"] = (slicecred,)
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
rval,response = do_method("cm", "GetSliver", params, version="2.0")
if rval:
Fatal("Could not get Sliver credential")
......@@ -93,7 +93,7 @@ params["credentials"] = (slivercred,)
if URN:
params["component_urns"] = (URN,)
else:
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
pass
rval,response = do_method("cm", method, params, version="2.0")
if rval:
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -48,7 +48,7 @@ print "Got the slice credential, asking for a sliver credential ..."
# Get the sliver credential.
#
params = {}
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["credentials"] = (slicecred,)
rval,response = do_method("cm", "GetSliver", params, version="2.0")
if rval:
......@@ -61,7 +61,7 @@ print "Got the sliver credential, asking for sliver status";
# Get the sliver status
#
params = {}
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["credentials"] = (slivercred,)
rval,response = do_method("cm", "SliverStatus", params, version="2.0")
if rval:
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -102,7 +102,7 @@ print str(myslice)
#
print "Asking for sliver credential"
params = {}
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["credentials"] = (slicecred,)
rval,response = do_method("cm", "GetSliver", params, version="2.0")
if rval:
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
......@@ -53,7 +53,7 @@ if debug:
#
params = {}
params["credentials"] = (slicecred,)
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
rval,response = do_method("cm", "GetSliver", params, version="2.0")
if rval:
Fatal("Could not get Sliver credential")
......@@ -68,9 +68,10 @@ if debug:
# subset).
#
params = {}
params["slice_urn"] = SLICEURN
params["slice_urn"] = myslice["urn"]
params["credentials"] = (slivercred,)
while True: # #@(%ing Python doesn't have do loops
# Python does not have do loops
while True:
rval,response = do_method("cm", "SliverStatus", params, version="2.0")
if rval:
Fatal("Could not get sliver status")
......@@ -88,7 +89,7 @@ if debug:
# Resolve the slice at the CM, to find the sliver URN.
#
params = {}
params["urn"] = SLICEURN
params["urn"] = myslice["urn"]
params["credentials"] = (slicecred,)
rval,response = do_method("cm", "Resolve", params, version="2.0")
if rval:
......
Markdown is supported
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