from sfa.trust.certificate import Certificate, Keypair, convert_public_key
from sfa.trust.gid import create_uuid
from sfa.trust.certificate import Certificate, Keypair, convert_public_key
from sfa.trust.gid import create_uuid
# verify_cancreate_credential requires that the member lists
# (researchers, pis, etc) be filled in
# verify_cancreate_credential requires that the member lists
# (researchers, pis, etc) be filled in
- def Resolve(self, api, xrns, intype=None, full=True):
+ def Resolve(self, api, xrns, type=None, full=True):
if not isinstance(xrns, types.ListType):
xrns = [xrns]
# try to infer type if not set and we get a single input
if not isinstance(xrns, types.ListType):
xrns = [xrns]
# try to infer type if not set and we get a single input
hrns = [urn_to_hrn(xrn)[0] for xrn in xrns]
# load all known registry names into a prefix tree and attempt to find
hrns = [urn_to_hrn(xrn)[0] for xrn in xrns]
# load all known registry names into a prefix tree and attempt to find
credential = api.getCredential()
interface = api.registries[registry_hrn]
server_proxy = api.server_proxy(interface, credential)
credential = api.getCredential()
interface = api.registries[registry_hrn]
server_proxy = api.server_proxy(interface, credential)
records.extend(peer_records)
# try resolving the remaining unfound records at the local registry
local_hrns = list ( set(hrns).difference([record['hrn'] for record in records]) )
#
local_records = dbsession.query(RegRecord).filter(RegRecord.hrn.in_(local_hrns))
records.extend(peer_records)
# try resolving the remaining unfound records at the local registry
local_hrns = list ( set(hrns).difference([record['hrn'] for record in records]) )
#
local_records = dbsession.query(RegRecord).filter(RegRecord.hrn.in_(local_hrns))
local_dicts = [ record.__dict__ for record in local_records ]
if full:
# in full mode we get as much info as we can, which involves contacting the
# testbed for getting implementation details about the record
local_dicts = [ record.__dict__ for record in local_records ]
if full:
# in full mode we get as much info as we can, which involves contacting the
# testbed for getting implementation details about the record
-# # also we fill the 'url' field for known authorities
-# # used to be in the driver code, sounds like a poorman thing though
+ # also we fill the 'url' field for known authorities
+ # used to be in the driver code, sounds like a poorman thing though
# convert local record objects to dicts for xmlrpc
# xxx somehow here calling dict(record) issues a weird error
# however record.todict() seems to work fine
# convert local record objects to dicts for xmlrpc
# xxx somehow here calling dict(record) issues a weird error
# however record.todict() seems to work fine
interface = api.registries[registry_hrn]
server_proxy = api.server_proxy(interface, credential)
record_list = server_proxy.List(xrn, credential)
interface = api.registries[registry_hrn]
server_proxy = api.server_proxy(interface, credential)
record_list = server_proxy.List(xrn, credential)
# make sure the record exists
record = dbsession.query(RegRecord).filter_by(type=type,hrn=hrn).first()
if not record:
# make sure the record exists
record = dbsession.query(RegRecord).filter_by(type=type,hrn=hrn).first()
if not record:
if type not in ['authority', 'slice', 'node', 'user']:
raise UnknownSfaType(type)
if type not in ['authority', 'slice', 'node', 'user']:
raise UnknownSfaType(type)