From: Tony Mack Date: Sun, 21 Feb 2010 15:32:49 +0000 (+0000) Subject: comments X-Git-Tag: sfa-0.9-11~75 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b23bab8eaf9239f92ae2ae0eaa5dd27f15d8d59e;p=sfa.git comments --- diff --git a/sfa/managers/registry_manager_pl.py b/sfa/managers/registry_manager_pl.py index 91760f32..d3c1a95e 100644 --- a/sfa/managers/registry_manager_pl.py +++ b/sfa/managers/registry_manager_pl.py @@ -76,6 +76,7 @@ def resolve(api, xrns, type=None, origin_hrn=None): # create a dict whre key is an registry hrn and its value is a # hrns at that registry (determined by the known prefix tree). xrn_dict = {} + # XX Preload this into the api module registries = Registries(api) tree = prefixTree() registry_hrns = registries.keys() @@ -107,16 +108,8 @@ def resolve(api, xrns, type=None, origin_hrn=None): remaining_hrns = [hrn for hrn in remaining_hrns] table = SfaTable() local_records = table.findObjects({'hrn': remaining_hrns}) - for record in local_records: - try: - api.fill_record_info(record) - records.append(dict(record)) - except PlanetLabRecordDoesNotExist: - # silently drop the ones that are missing in PL - api.logger.info("ignoring SFA record %s because pl record \ - does not exist" % record['hrn']) - table.remove(record) - + api.fill_record_info(local_records) + records.extend(local_records) if not records: raise RecordNotFound(str(hrns))