local_records = dbsession.query(RegRecord).filter(RegRecord.hrn.in_(local_hrns))
if type:
local_records = local_records.filter_by(type=type)
- local_records=local_records.all()
+ local_records=local_records.all()
logger.info("Resolve: local_records=%s (type=%s)"%(local_records,type))
local_dicts = [ record.__dict__ for record in local_records ]
# in full mode we get as much info as we can, which involves contacting the
# testbed for getting implementation details about the record
self.driver.augment_records_with_testbed_info(local_dicts)
+ #logger.debug("Resolve: local_dicts =%s "%(local_dicts))
# also we fill the 'url' field for known authorities
# used to be in the driver code, sounds like a poorman thing though
def solve_neighbour_url (record):
+ logger.debug("\r\n \t\t solve_neighbour_url: record = %s "%(record))
if not record.type.startswith('authority'): return
hrn=record.hrn
for neighbour_dict in [ api.aggregates, api.registries ]:
record.url=neighbour_dict[hrn].get_url()
return
for record in local_records: solve_neighbour_url (record)
-
+ #logger.debug("\solve_neighbour_url = OK ")
# 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
# records.extend( [ dict(record) for record in local_records ] )
- records.extend( [ record.todict() for record in local_records ] )
+ records.extend( [ record.todict() for record in local_records ] )
+ #logger.debug("\RESOLVE = records %s " %(records))
if not records:
raise RecordNotFound(str(hrns))
api.auth.hierarchy.create_auth(hrn_to_urn(hrn,'authority'))
# get the GID from the newly created authority
+ auth_info = api.auth.get_auth_info(hrn)
gid = auth_info.get_gid_object()
record.gid=gid.save_to_string(save_parents=True)
if isinstance (record, RegSlice):
researcher_hrns = getattr(new_record,'researcher',None)
if researcher_hrns is not None: record.update_researchers (researcher_hrns)
+ dbsession.commit()
elif isinstance (record, RegAuthority):
pi_hrns = getattr(new_record,'pi',None)
if pi_hrns is not None: record.update_pis (pi_hrns)
+ dbsession.commit()
# update the PLC information that was specified with the record
+ # xxx oddly enough, without this useless statement,
+ # record.__dict__ as received by the driver seems to be off
+ # anyway the driver should receive an object
+ # (and then extract __dict__ itself if needed)
+ print "DO NOT REMOVE ME before driver.update, record=%s"%record
if not self.driver.update (record.__dict__, new_record.__dict__, hrn, new_key):
logger.warning("driver.update failed")