X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fplc%2Fslices.py;h=89312961514df62202324219fa5c2492ac2b44b4;hb=db84b3ddccc2a04da661a384734c510eb55729c6;hp=a74687ef9e331775f6e1cb35c414a2bf5069e83c;hpb=d14c664694ef3dad22faa2a1bf988fc55180b1f9;p=sfa.git diff --git a/sfa/plc/slices.py b/sfa/plc/slices.py index a74687ef..89312961 100644 --- a/sfa/plc/slices.py +++ b/sfa/plc/slices.py @@ -19,7 +19,7 @@ from sfa.server.registry import Registries class Slices(SimpleStorage): - def __init__(self, api, ttl = .5): + def __init__(self, api, ttl = .5, caller_cred=None): self.api = api self.ttl = ttl self.threshold = None @@ -30,6 +30,7 @@ class Slices(SimpleStorage): SimpleStorage.__init__(self, self.slices_file) self.policy = Policy(self.api) self.load() + self.caller_cred=caller_cred def get_peer(self, hrn): @@ -138,7 +139,7 @@ class Slices(SimpleStorage): aggregates = Aggregates(self.api) for aggregate in aggregates: try: - aggregates[aggregate].delete_slice(credential, hrn) + aggregates[aggregate].delete_slice(credential, hrn, caller_cred=self.caller_cred) except: print >> log, "Error calling list nodes at aggregate %s" % aggregate traceback.print_exc(log) @@ -339,9 +340,9 @@ class Slices(SimpleStorage): try: # send the whloe rspec to the local aggregate if aggregate in [self.api.hrn]: - aggregates[aggregate].create_slice(credential, hrn, rspec) + aggregates[aggregate].create_slice(credential, hrn, rspec, caller_cred=self.caller_cred) else: - aggregates[aggregate].create_slice(credential, hrn, rspecs[aggregate]) + aggregates[aggregate].create_slice(credential, hrn, rspecs[aggregate], caller_cred=self.caller_cred) except: print >> log, "Error creating slice %(hrn)s at aggregate %(aggregate)s" % locals() traceback.print_exc()