From 5a672ac9ae3345f012b97045d9772e860941a330 Mon Sep 17 00:00:00 2001 From: Anil-Kumar Vengalil Date: Tue, 15 Sep 2009 15:37:57 +0000 Subject: [PATCH] if there are two accounts with the same e-mail on a remote peer, use the one with peer_id set --- sfa/plc/slices.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sfa/plc/slices.py b/sfa/plc/slices.py index 1e486a5b..c8905b04 100644 --- a/sfa/plc/slices.py +++ b/sfa/plc/slices.py @@ -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: -- 2.43.0