# verify_cancreate_credential requires that the member lists
# (researchers, pis, etc) be filled in
# verify_cancreate_credential requires that the member lists
# (researchers, pis, etc) be filled in
if record['type']=='user':
if not record['enabled']:
raise AccountNotEnabled(": PlanetLab account %s is not enabled. Please contact your site PI" %(record['email']))
if record['type']=='user':
if not record['enabled']:
raise AccountNotEnabled(": PlanetLab account %s is not enabled. Please contact your site PI" %(record['email']))
# get the GID from the newly created authority
gid = auth_info.get_gid_object()
record.set_gid(gid.save_to_string(save_parents=True))
# get the GID from the newly created authority
gid = auth_info.get_gid_object()
record.set_gid(gid.save_to_string(save_parents=True))
- pl_record = api.sfa_fields_to_pl_fields(type, hrn, record)
- sites = api.plshell.GetSites(api.plauth, [pl_record['login_base']])
+ pl_record = api.driver.sfa_fields_to_pl_fields(type, hrn, record)
+ sites = api.driver.GetSites([pl_record['login_base']])
elif (type == "slice"):
acceptable_fields=['url', 'instantiation', 'name', 'description']
elif (type == "slice"):
acceptable_fields=['url', 'instantiation', 'name', 'description']
else:
pointer = slices[0]['slice_id']
record.set_pointer(pointer)
record['pointer'] = pointer
elif (type == "user"):
else:
pointer = slices[0]['slice_id']
record.set_pointer(pointer)
record['pointer'] = pointer
elif (type == "user"):
# add this persons to the site only if he is being added for the first
# time by sfa and doesont already exist in plc
if not persons or not persons[0]['site_ids']:
login_base = get_leaf(record['authority'])
# add this persons to the site only if he is being added for the first
# time by sfa and doesont already exist in plc
if not persons or not persons[0]['site_ids']:
login_base = get_leaf(record['authority'])
- api.plshell.AddPersonKey(api.plauth, pointer, {'key_type' : 'ssh', 'key' : pub_key})
+ api.driver.AddPersonKey(pointer, {'key_type' : 'ssh', 'key' : pub_key})
record['record_id'] = record_id
# update membership for researchers, pis, owners, operators
record['record_id'] = record_id
# update membership for researchers, pis, owners, operators
# Update_membership needs the membership lists in the existing record
# filled in, so it can see if members were added or removed
# Update_membership needs the membership lists in the existing record
# filled in, so it can see if members were added or removed
# Use the pointer from the existing record, not the one that the user
# gave us. This prevents the user from inserting a forged pointer
# Use the pointer from the existing record, not the one that the user
# gave us. This prevents the user from inserting a forged pointer
'password', 'phone', 'url', 'bio', 'accepted_aup',
'enabled']:
update_fields[key] = all_fields[key]
'password', 'phone', 'url', 'bio', 'accepted_aup',
'enabled']:
update_fields[key] = all_fields[key]
if 'key' in new_record and new_record['key']:
# must check this key against the previous one if it exists
if 'key' in new_record and new_record['key']:
# must check this key against the previous one if it exists
key_exists = False
if isinstance(new_record['key'], types.ListType):
new_key = new_record['key'][0]
key_exists = False
if isinstance(new_record['key'], types.ListType):
new_key = new_record['key'][0]
- api.plshell.AddPersonKey(api.plauth, pointer, {'key_type': 'ssh', 'key': new_key})
+ api.driver.AddPersonKey(pointer, {'key_type': 'ssh', 'key': new_key})
else:
raise UnknownSfaType(type)
# update membership for researchers, pis, owners, operators
else:
raise UnknownSfaType(type)
# update membership for researchers, pis, owners, operators
# only delete this person if he has site ids. if he doesnt, it probably means
# he was just removed from a site, not actually deleted
if persons and persons[0]['site_ids']:
# only delete this person if he has site ids. if he doesnt, it probably means
# he was just removed from a site, not actually deleted
if persons and persons[0]['site_ids']:
- if api.plshell.GetSlices(api.plauth, record['pointer']):
- api.plshell.DeleteSlice(api.plauth, record['pointer'])
+ if api.driver.GetSlices(record['pointer']):
+ api.driver.DeleteSlice(record['pointer'])
- if api.plshell.GetNodes(api.plauth, record['pointer']):
- api.plshell.DeleteNode(api.plauth, record['pointer'])
+ if api.driver.GetNodes(record['pointer']):
+ api.driver.DeleteNode(record['pointer'])
- if api.plshell.GetSites(api.plauth, record['pointer']):
- api.plshell.DeleteSite(api.plauth, record['pointer'])
+ if api.driver.GetSites(record['pointer']):
+ api.driver.DeleteSite(record['pointer'])