Initial checkin of a new method to remove objects from PLCDB of federrated aggregtes...
[sfa.git] / sfa / plc / slices.py
index f9e102b..c8905b0 100644 (file)
@@ -243,7 +243,11 @@ class Slices(SimpleStorage):
             if not person_record:
                 pass
             person_dict = person_record.as_dict()
-            persons = self.api.plshell.GetPersons(self.api.plauth, [person_dict['email']], ['person_id', 'key_ids'])
+           if peer:
+              peer_id=self.api.plshell.GetPeers(self.api.plauth, {'shortname' : peer}, ['peer_id'])[0]['peer_id']
+               persons = self.api.plshell.GetPersons(self.api.plauth, {'email' : [person_dict['email']], 'peer_id' : peer_id}, ['person_id', 'key_ids'])
+           else:
+               persons = self.api.plshell.GetPersons(self.api.plauth, [person_dict['email']], ['person_id', 'key_ids'])
 
             # Create the person record 
             if not persons:
@@ -342,7 +346,7 @@ class Slices(SimpleStorage):
         netspecs = spec.getDictsByTagName('NetSpec')
         for netspec in netspecs:
             net_hrn = netspec['name']
-            resources = {'start_time': start_time, 'end_time': end_time, 'networks': net_hrn}
+            resources = {'start_time': start_time, 'end_time': end_time, 'networks': netspec}
             resourceDict = {'Rspec': resources}
             tempspec.parseDict(resourceDict)
             rspecs[net_hrn] = tempspec.toxml()