Commit 1a1a75a7 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Remove the code that deletes the slice at the SA; no longer allowed to

do that, so do not try.

Also set the expiration time when registering (to six hours). Mostly
for demonstration purposes.
parent 23dfea4e
......@@ -19,13 +19,15 @@
import sys
import pwd
import getopt
import time
import os
import re
import xmlrpclib
from M2Crypto import X509
ACCEPTSLICENAME=1
OtherUser = None
OtherUser = None
Expiration = (60 * 60 * 6)
execfile( "test-common.py" )
......@@ -40,7 +42,7 @@ mycredential = get_self_credential()
print "Got my SA credential"
#
# Lookup slice, delete before proceeding.
# Lookup slice.
#
params = {}
params["credential"] = mycredential
......@@ -48,17 +50,16 @@ params["type"] = "Slice"
params["hrn"] = SLICENAME
rval,response = do_method("sa", "Resolve", params)
if rval == 0:
print "Deleting previously registered slice";
params = {}
params["credential"] = mycredential
params["type"] = "Slice"
params["hrn"] = SLICENAME
rval,response = do_method("sa", "Remove", params)
if rval:
Fatal("Could not remove slice record")
pass
print "Slice already exists."
sys.exit(0)
pass
#
# Set up expiration.
#
valid_until = time.strftime("%Y%m%dT%H:%M:%S",
time.gmtime(time.time() + Expiration))
#
# Create a slice.
#
......@@ -67,6 +68,7 @@ params = {}
params["credential"] = mycredential
params["type"] = "Slice"
params["hrn"] = SLICENAME
params["expiration"] = valid_until
rval,response = do_method("sa", "Register", params)
if rval:
Fatal("Could not get my slice")
......
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