- for registry in registries:
- if hrn.startswith(registry) and registry not in [self.api.hrn]:
- record_list = registries[registry].list(credential, hrn)
- for record in record_list:
- records.append(record.as_dict())
- return records
+ try:
+ request_hash=None
+ record_list = registries[registry_hrn].list(credential, hrn, request_hash, caller_cred)
+ records = [GeniRecord(dict=record).as_dict() for record in record_list]
+ except:
+ arg_list = [credential, hrn]
+ request_hash = self.api.key.compute_hash(arg_list)
+ record_list = registries[registry_hrn].list(credential, hrn, request_hash, origin_hrn)
+ records = [GeniRecord(dict=record).as_dict() for record in record_list]
+
+ if records:
+ return records
+
+ # if we still havnt found the record yet, try the local registry
+ if not self.api.auth.hierarchy.auth_exists(hrn):
+ raise MissingAuthority(hrn)
+
+ table = GeniTable()
+ records = table.find({'authority': hrn})