From: Thierry Parmentelat Date: Tue, 18 Nov 2014 22:31:11 +0000 (+0100) Subject: fix for Brecht; when forging the email we were adding a hrn that had backslashes... X-Git-Tag: sfa-3.1-13~1 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=3a453109b0b85e0f1ad1cf7c1743ddd6828d6385 fix for Brecht; when forging the email we were adding a hrn that had backslashes; get rid of those --- diff --git a/sfa/planetlab/plslices.py b/sfa/planetlab/plslices.py index 197ffcab..decb5464 100644 --- a/sfa/planetlab/plslices.py +++ b/sfa/planetlab/plslices.py @@ -422,6 +422,8 @@ class PlSlices: # the value to use if 'user' has no 'email' attached - or if the attached email already exists # typically ( auth_hrn, _ , leaf ) = user_hrn.rpartition('.') + # somehow this has backslashes, get rid of them + auth_hrn = auth_hrn.replace('\\','') default_email = "%s@%s.stub"%(leaf,auth_hrn) person_record = { @@ -443,6 +445,7 @@ class PlSlices: # so we first try with the accurate email person_id = int (self.driver.shell.AddPerson(person_record)) except: + logger.log_exc("caught during first attempt at AddPerson") # and if that fails we start again with the email based on the hrn, which this time is unique.. person_record['email']=default_email logger.debug ("second chance with email=%s"%person_record['email'])