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
- for record in local_dicts: logger.info("resolve augment %s"%record)
+ for record in local_dicts: logger.debug("resolve augment %s"%record)
self.driver.augment_records_with_testbed_info(local_dicts)
# # also we fill the 'url' field for known authorities
# # used to be in the driver code, sounds like a poorman thing though
raise ExistingRecord(hrn)
assert ('type' in record_dict)
- record = RegRecord("undefined")
- record.set_from_dict(record_dict)
+ record = RegRecord(dict=record_dict)
record.just_created()
record.authority = get_authority(record.hrn)
auth_info = api.auth.get_auth_info(record.authority)
def Update(self, api, record_dict):
assert ('type' in record_dict)
- new_record=RegRecord(type="unknown")
- new_record.set_from_dict(record_dict)
+ new_record=RegRecord(dict=record_dict)
type = new_record.type
hrn = new_record.hrn
return 1
- # This is a PLC-specific thing...
+ # This is a PLC-specific thing, won't work with other platforms
def get_key_from_incoming_ip (self, api):
# verify that the callers's ip address exist in the db and is an interface
# for a node in the db
node = nodes[0]
# look up the sfa record
- table = SfaTable()
- records = table.findObjects({'type': 'node', 'pointer': node['node_id']})
- if not records:
- raise RecordNotFound("pointer:" + str(node['node_id']))
- record = records[0]
+ record=dbsession.query(RegRecord).filter_by(type='node',pointer=node['node_id']).first()
+ if not record:
+ raise RecordNotFound("node with pointer %s"%node['node_id'])
# generate a new keypair and gid
uuid = create_uuid()
pkey = Keypair(create=True)
- urn = hrn_to_urn(record['hrn'], record['type'])
+ urn = hrn_to_urn(record.hrn, record.type)
gid_object = api.auth.hierarchy.create_gid(urn, uuid, pkey)
gid = gid_object.save_to_string(save_parents=True)
- record['gid'] = gid
- record.set_gid(gid)
+ record.gid = gid
# update the record
- table.update(record)
+ dbsession.commit()
# attempt the scp the key
# and gid onto the node