From: Tony Mack Date: Tue, 17 Aug 2010 18:07:23 +0000 (+0000) Subject: the result of get_aggregates() has changed X-Git-Tag: sfa-1.0-0~37 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=d653224bbfa49d3837c96766ef1b0332b7967544 the result of get_aggregates() has changed --- diff --git a/sfa/managers/slice_manager_pl.py b/sfa/managers/slice_manager_pl.py index 199028b4..b3da52da 100644 --- a/sfa/managers/slice_manager_pl.py +++ b/sfa/managers/slice_manager_pl.py @@ -107,12 +107,14 @@ def get_ticket(api, xrn, creds, rspec, users): net_urn = hrn_to_urn(aggregate, 'authority') # we may have a peer that knows about this aggregate for agg in api.aggregates: - agg_info = api.aggregates[agg].get_aggregates(credential, net_urn) - if agg_info: - # send the request to this address - url = 'http://%s:%s' % (agg_info['addr'], agg_info['port']) - server = xmlrpcprotocol.get_server(url, api.key_file, api.cert_file) - break + target_aggs = api.aggregates[agg].get_aggregates(credential, net_urn) + if not target_aggs or not 'hrn' not target_aggs[0]: + continue + # send the request to this address + url = target_aggs[0]['url'] + server = xmlrpcprotocol.get_server(url, api.key_file, api.cert_file) + # aggregate found, no need to keep looping + break if server is None: continue threads.run(server.GetTicket, xrn, credential, aggregate_rspec, users)