+ caller_hrn, caller_type = urn_to_hrn(caller_xrn)
+ caller_filter = {'hrn': caller_hrn}
+ if caller_type:
+ caller_filter['type'] = caller_type
+ caller_record = dbsession.query(RegRecord).filter_by(**caller_filter).first()
+ if not caller_record:
+ raise RecordNotFound("Unable to associated caller (hrn=%s, type=%s) with credential for (hrn: %s, type: %s)"%(caller_hrn, caller_type, hrn, type))
+ caller_gid = GID(string=caller_record.gid)