elif object.has_key('site_ids') and object['site_ids']:
site_ids.extend(object['site_ids'])
else:
- raise Exception
+ return login_bases
# get the login bases
for site_id in site_ids:
parent_hrn = authority + "." + login_base
if type in ['person', 'user']:
name_parts = object['email'].split("@")
- hrn = parent_hrn + "." + name_parts[:1]
+ hrn = parent_hrn + "." + name_parts[:1][0]
elif type in ['slice']:
name_parts = object['name'].split("_")
- hrn = parent_hrn + "." + name_parts[-1:]
+ hrn = parent_hrn + "." + name_parts[-1:][0]
elif type in ['node']:
hrn = hostname_to_hrn(self.authority, login_base, object['hostname'])
# add the record to sfa
if not self.sfa_record_exists(object['hrn'], type):
self.registry.register(self.credential, record)
+ else:
+ self.registry.update(self.credential, record)
@wrap_exception
@required_packages_imported