X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmanagers%2Fslice_manager_pl.py;h=43d3392fd883f3f02b56bc78505ecabda3134d69;hb=0cf0d31c313a366e3f272f830bdb4f2a7308e11f;hp=55256e0f7df5ee2d4f11799d8c91c6e658360b61;hpb=2dda62603e6bbb266a885092429ea184ee6740aa;p=sfa.git diff --git a/sfa/managers/slice_manager_pl.py b/sfa/managers/slice_manager_pl.py index 55256e0f..43d3392f 100644 --- a/sfa/managers/slice_manager_pl.py +++ b/sfa/managers/slice_manager_pl.py @@ -21,7 +21,6 @@ from sfa.util.sfaticket import * from sfa.trust.credential import Credential from sfa.util.threadmanager import ThreadManager import sfa.util.xmlrpcprotocol as xmlrpcprotocol -from sfa.util.debug import log import sfa.plc.peers as peers from copy import copy @@ -61,8 +60,8 @@ def create_slice(api, xrn, creds, rspec, users): raise InvalidRSpec(message) # get the callers hrn - valid_cred = self.api.auth.checkCredentials(creds, 'createsliver', hrn)[0] - caller_hrn = valid_cred.get_gid_caller().get_hrn() + valid_cred = api.auth.checkCredentials(creds, 'createsliver', hrn)[0] + caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn() # attempt to use delegated credential first credential = api.getDelegatedCredential(creds) @@ -72,7 +71,7 @@ def create_slice(api, xrn, creds, rspec, users): for aggregate in api.aggregates: # prevent infinite loop. Dont send request back to caller # unless the caller is the aggregate's SM - if caller_hrn == aggrgate and aggregate != api.hrn: + if caller_hrn == aggregate and aggregate != api.hrn: continue # Just send entire RSpec to each aggregate @@ -85,8 +84,8 @@ def create_slice(api, xrn, creds, rspec, users): def renew_slice(api, xrn, creds, expiration_time): # get the callers hrn - valid_cred = self.api.auth.checkCredentials(creds, 'renewesliver', hrn)[0] - caller_hrn = valid_cred.get_gid_caller().get_hrn() + valid_cred = api.auth.checkCredentials(creds, 'renewesliver', hrn)[0] + caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn() # attempt to use delegated credential first credential = api.getDelegatedCredential(creds) @@ -96,7 +95,7 @@ def renew_slice(api, xrn, creds, expiration_time): for aggregate in api.aggregates: # prevent infinite loop. Dont send request back to caller # unless the caller is the aggregate's SM - if caller_hrn == aggrgate and aggregate != api.hrn: + if caller_hrn == aggregate and aggregate != api.hrn: continue server = api.aggregates[aggregate] @@ -115,8 +114,8 @@ def get_ticket(api, xrn, creds, rspec, users): aggregate_rspecs[aggregate_hrn] = rspec # get the callers hrn - valid_cred = self.api.auth.checkCredentials(creds, 'getticket', hrn)[0] - caller_hrn = valid_cred.get_gid_caller().get_hrn() + valid_cred = api.auth.checkCredentials(creds, 'getticket', hrn)[0] + caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn() # attempt to use delegated credential first credential = api.getDelegatedCredential(creds) @@ -126,7 +125,7 @@ def get_ticket(api, xrn, creds, rspec, users): for aggregate, aggregate_rspec in aggregate_rspecs.items(): # prevent infinite loop. Dont send request back to caller # unless the caller is the aggregate's SM - if caller_hrn == aggrgate and aggregate != api.hrn: + if caller_hrn == aggregate and aggregate != api.hrn: continue server = None if aggregate in api.aggregates: @@ -184,8 +183,8 @@ def get_ticket(api, xrn, creds, rspec, users): def delete_slice(api, xrn, creds): # get the callers hrn - valid_cred = self.api.auth.checkCredentials(creds, 'deletesliver', hrn)[0] - caller_hrn = valid_cred.get_gid_caller().get_hrn() + valid_cred = api.auth.checkCredentials(creds, 'deletesliver', hrn)[0] + caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn() # attempt to use delegated credential first credential = api.getDelegatedCredential(creds) @@ -195,7 +194,7 @@ def delete_slice(api, xrn, creds): for aggregate in api.aggregates: # prevent infinite loop. Dont send request back to caller # unless the caller is the aggregate's SM - if caller_hrn == aggrgate and aggregate != api.hrn: + if caller_hrn == aggregate and aggregate != api.hrn: continue server = api.aggregates[aggregate] threads.run(server.DeleteSliver, xrn, credential) @@ -204,8 +203,8 @@ def delete_slice(api, xrn, creds): def start_slice(api, xrn, creds): # get the callers hrn - valid_cred = self.api.auth.checkCredentials(creds, 'startslice', hrn)[0] - caller_hrn = valid_cred.get_gid_caller().get_hrn() + valid_cred = api.auth.checkCredentials(creds, 'startslice', hrn)[0] + caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn() # attempt to use delegated credential first credential = api.getDelegatedCredential(creds) @@ -215,7 +214,7 @@ def start_slice(api, xrn, creds): for aggregate in api.aggregates: # prevent infinite loop. Dont send request back to caller # unless the caller is the aggregate's SM - if caller_hrn == aggrgate and aggregate != api.hrn: + if caller_hrn == aggregate and aggregate != api.hrn: continue server = api.aggregates[aggregate] threads.run(server.Start, xrn, credential) @@ -224,8 +223,8 @@ def start_slice(api, xrn, creds): def stop_slice(api, xrn, creds): # get the callers hrn - valid_cred = self.api.auth.checkCredentials(creds, 'stopslice', hrn)[0] - caller_hrn = valid_cred.get_gid_caller().get_hrn() + valid_cred = api.auth.checkCredentials(creds, 'stopslice', hrn)[0] + caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn() # attempt to use delegated credential first credential = api.getDelegatedCredential(creds) @@ -235,7 +234,7 @@ def stop_slice(api, xrn, creds): for aggregate in api.aggregates: # prevent infinite loop. Dont send request back to caller # unless the caller is the aggregate's SM - if caller_hrn == aggrgate and aggregate != api.hrn: + if caller_hrn == aggregate and aggregate != api.hrn: continue server = api.aggregates[aggregate] threads.run(server.Stop, xrn, credential) @@ -269,8 +268,8 @@ def get_slices(api, creds): return slices # get the callers hrn - valid_cred = self.api.auth.checkCredentials(creds, 'listslices', hrn)[0] - caller_hrn = valid_cred.get_gid_caller().get_hrn() + valid_cred = api.auth.checkCredentials(creds, 'listslices', hrn)[0] + caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn() # attempt to use delegated credential first credential = api.getDelegatedCredential(creds) @@ -281,7 +280,7 @@ def get_slices(api, creds): for aggregate in api.aggregates: # prevent infinite loop. Dont send request back to caller # unless the caller is the aggregate's SM - if caller_hrn == aggrgate and aggregate != api.hrn: + if caller_hrn == aggregate and aggregate != api.hrn: continue server = api.aggregates[aggregate] threads.run(server.ListSlices, credential) @@ -319,8 +318,8 @@ def get_rspec(api, creds, options): rspec = None # get the callers hrn - valid_cred = self.api.auth.checkCredentials(creds, 'listnodes', hrn)[0] - caller_hrn = valid_cred.get_gid_caller().get_hrn() + valid_cred = api.auth.checkCredentials(creds, 'listnodes', hrn)[0] + caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn() # attempt to use delegated credential first credential = api.getDelegatedCredential(creds) @@ -330,7 +329,7 @@ def get_rspec(api, creds, options): for aggregate in api.aggregates: # prevent infinite loop. Dont send request back to caller # unless the caller is the aggregate's SM - if caller_hrn == aggrgate and aggregate != api.hrn: + if caller_hrn == aggregate and aggregate != api.hrn: continue # get the rspec from the aggregate server = api.aggregates[aggregate]