- server = None
- if aggregate in api.aggregates:
- server = api.aggregates[aggregate]
- else:
- net_urn = hrn_to_urn(aggregate, 'authority')
- # we may have a peer that knows about this aggregate
- for agg in api.aggregates:
- target_aggs = api.aggregates[agg].get_aggregates(credential, net_urn)
- if not target_aggs or not 'hrn' in 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, timeout=30)
- # aggregate found, no need to keep looping
- break
- if server is None:
- continue
- threads.run(server.GetTicket, xrn, credential, aggregate_rspec, users)
+
+ interface = api.aggregates[aggregate]
+ server = api.get_server(interface, cred)
+ threads.run(server.GetTicket, xrn, [cred], aggregate_rspec, users)