From: Tony Mack Date: Mon, 23 Mar 2009 20:13:45 +0000 (+0000) Subject: add add foreign users public keys when needed in createSlice X-Git-Tag: sfa-0.9-0@14641~550 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=69dfdb2b270c9ccfe054ec7704cc8e739f5a5e51;p=sfa.git add add foreign users public keys when needed in createSlice --- diff --git a/geni/aggregate.py b/geni/aggregate.py index 1e718598..5ae2c6fd 100644 --- a/geni/aggregate.py +++ b/geni/aggregate.py @@ -394,13 +394,16 @@ class Aggregate(GeniServer): person_record = person_records[0] person_dict = person_record.as_dict()['plc_info'] persons = self.shell.GetPersons(self.auth, [person_dict['email']], ['person_id', 'key_ids']) + + # Create the person record if not persons: self.shell.AddPerson(self.auth, person_dict) - else: - person = persons[0] self.shell.AddPersonToSlice(self.auth, person_dict['email'], login_base) - # XX Dont forget to add this person's public keys - + # Add this person's public keys + for personkey in person_dict['keys']: + key = {'type': 'ssh', 'key': personkey} + self.shellAddPersonKey(self.auth, person_dict['email'], key) + # find out where this slice is currently running nodelist = self.shell.GetNodes(self.auth, slice['node_ids'], ['hostname']) hostnames = [node['hostname'] for node in nodelist]