Commit d5c719b7 authored by Leigh B Stoller's avatar Leigh B Stoller

Allow extra argument, which should be a policy credential that

overrides the CM max_sliver_lifetime.
parent 3be88cd1
#! /usr/bin/env python
#
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# Copyright (c) 2008-2014 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -47,15 +47,23 @@ from M2Crypto import X509
ACCEPTSLICENAME=1
minutes = 60
extracred = None;
execfile( "test-common.py" )
if len(REQARGS) != 1:
if len(REQARGS) < 1:
print >> sys.stderr, "Must provide number of minutes to renew for"
sys.exit(1)
else:
minutes = REQARGS[0]
pass
# Always first argument.
minutes = REQARGS[0]
if len(REQARGS) == 2:
f = open(REQARGS[1])
extracred = f.read()
f.close()
pass
#
# Get a credential for myself, that allows me to do things at the SA.
#
......@@ -100,7 +108,11 @@ slicecred = get_slice_credential( myslice, mycredential )
print "Got the slice credential, attempting to renew the sliver...";
params = {}
params["credentials"] = (slicecred,)
if extracred:
params["credentials"] = (slicecred,extracred)
else:
params["credentials"] = (slicecred,)
pass
params["slice_urn"] = myslice["urn"]
params["valid_until"] = valid_until
rval,response = do_method("cm", "RenewSlice", params, version="2.0")
......
#! /usr/bin/env python
#
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# Copyright (c) 2008-2014 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -45,16 +45,24 @@ from M2Crypto import X509
ACCEPTSLICENAME=1
minutes = 60
minutes = 60
extracred = None;
execfile( "test-common.py" )
if len(REQARGS) != 1:
if len(REQARGS) < 1:
print >> sys.stderr, "Must provide number of minutes to renew for"
sys.exit(1)
else:
minutes = REQARGS[0]
pass
# Always first argument.
minutes = REQARGS[0]
if len(REQARGS) == 2:
f = open(REQARGS[1])
extracred = f.read()
f.close()
pass
#
# Get a credential for myself, that allows me to do things at the SA.
#
......@@ -80,7 +88,11 @@ valid_until = time.strftime("%Y%m%dT%H:%M:%S",
time.gmtime(time.time() + (60 * int(minutes))))
params = {}
params["credentials"] = (slicecred,)
if extracred:
params["credentials"] = (slicecred,extracred)
else:
params["credentials"] = (slicecred,)
pass
params["slice_urn"] = myslice["urn"]
params["valid_until"] = valid_until
rval,response = do_method("cm", "RenewSlice", params, version="2.0")
......
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