def __init__ (self, auth_hierarchy, logger):
self.auth_hierarchy = auth_hierarchy
def __init__ (self, auth_hierarchy, logger):
self.auth_hierarchy = auth_hierarchy
def add_options (self, parser):
# we don't have any options for now
def add_options (self, parser):
# we don't have any options for now
if record.pointer != -1] )
# initialize record.stale to True by default, then mark stale=False on the ones that are in use
if record.pointer != -1] )
# initialize record.stale to True by default, then mark stale=False on the ones that are in use
# return a tuple pubkey (a plc key object) and pkey (a Keypair object)
def init_person_key (person, plc_keys):
# return a tuple pubkey (a plc key object) and pkey (a Keypair object)
def init_person_key (person, plc_keys):
plc_keys = keys_by_person_id.get(person['person_id'],[])
if not user_record:
(pubkey, pkey) = init_person_key (person, plc_keys )
plc_keys = keys_by_person_id.get(person['person_id'],[])
if not user_record:
(pubkey, pkey) = init_person_key (person, plc_keys )
- person_gid = self.auth_hierarchy.create_gid(person_urn, create_uuid(), pkey, email=person['email'])
+ person_gid = self.auth_hierarchy.create_gid(person_urn, create_uuid(), pkey,
+ email=person['email'])
user_record = RegUser (hrn=person_hrn, gid=person_gid,
pointer=person['person_id'],
authority=get_authority(person_hrn),
user_record = RegUser (hrn=person_hrn, gid=person_gid,
pointer=person['person_id'],
authority=get_authority(person_hrn),
sfa_keys = user_record.reg_keys
def sfa_key_in_list (sfa_key,plc_keys):
for plc_key in plc_keys:
sfa_keys = user_record.reg_keys
def sfa_key_in_list (sfa_key,plc_keys):
for plc_key in plc_keys:
person_gid = self.auth_hierarchy.create_gid(person_urn, create_uuid(), pkey)
person_gid.set_email(person['email'])
if not pubkey:
person_gid = self.auth_hierarchy.create_gid(person_urn, create_uuid(), pkey)
person_gid.set_email(person['email'])
if not pubkey:
user_record.gid = person_gid
user_record.just_updated()
self.logger.info("PlImporter: updated person: {}".format(user_record))
user_record.email = person['email']
global_dbsession.commit()
user_record.gid = person_gid
user_record.just_updated()
self.logger.info("PlImporter: updated person: {}".format(user_record))
user_record.email = person['email']
global_dbsession.commit()
# accumulate PIs - PLCAPI has a limitation that when someone has PI role
# this is valid for all sites she is in..
# accumulate PIs - PLCAPI has a limitation that when someone has PI role
# this is valid for all sites she is in..
slice_record.reg_researchers = \
[ self.locate_by_type_pointer ('user',user_id) for user_id in slice['person_ids'] ]
global_dbsession.commit()
slice_record.reg_researchers = \
[ self.locate_by_type_pointer ('user',user_id) for user_id in slice['person_ids'] ]
global_dbsession.commit()
system_hrns = [interface_hrn, root_auth, interface_hrn + '.slicemanager']
for record in all_records:
if record.hrn in system_hrns:
system_hrns = [interface_hrn, root_auth, interface_hrn + '.slicemanager']
for record in all_records:
if record.hrn in system_hrns:
if ".vini" in interface_hrn and interface_hrn.endswith('vini') and \
record.hrn.endswith("internet2"):
if ".vini" in interface_hrn and interface_hrn.endswith('vini') and \
record.hrn.endswith("internet2"):
self.logger.warning("stale not found with {}".format(record))
if stale:
self.logger.info("PlImporter: deleting stale record: {}".format(record))
self.logger.warning("stale not found with {}".format(record))
if stale:
self.logger.info("PlImporter: deleting stale record: {}".format(record))