From: Tony Mack Date: Thu, 31 Dec 2009 00:04:05 +0000 (+0000) Subject: in create_slice() and delete_slice() set the right gid_object_caller on the credentia... X-Git-Tag: sfa-0.9-7~62 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=34cec259e25a3a5f8d67629787d32e7fe779703c;p=sfa.git in create_slice() and delete_slice() set the right gid_object_caller on the credential, no longer pass origin_hrn to calls --- diff --git a/sfa/plc/nodes.py b/sfa/plc/nodes.py index cfa17b3e..b78d5ec6 100644 --- a/sfa/plc/nodes.py +++ b/sfa/plc/nodes.py @@ -31,9 +31,7 @@ class Nodes(SimpleStorage): SimpleStorage.__init__(self, self.nodes_file) self.policy = Policy(api) self.load() - self.origin_hrn = None - if origin_gid_caller: - self.origin_hrn=origin_gid_caller.get_hrn() + self.origin_gid_caller = origin_gid_caller def refresh(self): @@ -112,19 +110,19 @@ class Nodes(SimpleStorage): rspecs = {} networks = [] rspec = RSpec() - credential = self.api.getCredential() + credential = self.api.getCredential() + credential.set_gid_origin_caller(self.gid_origin_caller) for aggregate in aggregates: if aggregate not in [self.api.auth.client_cred.get_gid_caller().get_hrn()]: try: - origin_hrn = self.origin_hrn # get the rspec from the aggregate try: request_hash=None - agg_rspec = aggregates[aggregate].get_resources(credential, hrn, request_hash, origin_hrn) + agg_rspec = aggregates[aggregate].get_resources(credential, hrn, request_hash) except: arg_list = [credential, hrn] request_hash = self.api.key.compute_hash(arg_list) - agg_rspec = aggregates[aggregate].get_resources(credential, hrn, request_hash, origin_hrn) + agg_rspec = aggregates[aggregate].get_resources(credential, hrn, request_hash) # extract the netspec from each aggregates rspec rspec.parseString(agg_rspec) networks.extend([{'NetSpec': rspec.getDictsByTagName('NetSpec')}])