"organizationalPerson", "posixAccount", \
"shadowAccount", "systemQuotas", \
"ldapPublicKey"]
-
- attrs['givenName'] = str(record['first_name']).lower().capitalize()
- attrs['sn'] = str(record['last_name']).lower().capitalize()
- attrs['cn'] = attrs['givenName'] + ' ' + attrs['sn']
- attrs['gecos'] = attrs['givenName'] + ' ' + attrs['sn']
+
+
attrs['uid'] = self.generate_login(record)
-
+ try:
+ attrs['givenName'] = str(record['first_name']).lower().capitalize()
+ attrs['sn'] = str(record['last_name']).lower().capitalize()
+ attrs['cn'] = attrs['givenName'] + ' ' + attrs['sn']
+ attrs['gecos'] = attrs['givenName'] + ' ' + attrs['sn']
+
+ except:
+ attrs['givenName'] = attrs['uid']
+ attrs['sn'] = attrs['uid']
+ attrs['cn'] = attrs['uid']
+ attrs['gecos'] = attrs['uid']
+
+
attrs['quota'] = self.ldapUserQuotaNFS
attrs['homeDirectory'] = self.ldapUserHomePath + attrs['uid']
attrs['loginShell'] = self.ldapShell
login, fixed_slicerec_dict = \
__get_slice_records(slice_filter, slice_filter_type)
logger.debug(" SLABDRIVER \tGetSlices login %s \
- slice record %s slice_filter %s"\
- %(login, fixed_slicerec_dict,slice_filter))
+ slice record %s slice_filter %s slice_filter_type %s "\
+ %(login, fixed_slicerec_dict,slice_filter, slice_filter_type))
#Now we have the slice record fixed_slicerec_dict, get the
for added_user_hrn in added_user_hrns:
added_user = users_dict[added_user_hrn]
#hrn, type = urn_to_hrn(added_user['urn'])
- try:
- person = {
-
- 'first_name': added_user['first_name'],
- 'last_name': added_user['last_name'],
- 'person_id': added_user['person_id'],
- 'peer_person_id': None,
- 'keys': added_user['keys'][0],
- 'key_ids': added_user.get('key_ids', []),
-
- }
- except KeyError:
- pass
+
+ person = {}
+ person['peer_person_id'] = None
+ k_list = ['first_name','last_name','person_id']
+ for k in k_list:
+ if k in added_user:
+ person[k] = added_user[k]
+
+ person['keys'] = added_user['keys'][0]
+ person['key_ids'] = added_user.get('key_ids', [])
+
+
+
person['person_id'] = self.driver.AddPerson(person)
if peer: