added email_to_hrn()
authorTony Mack <tmack@cs.princeton.edu>
Mon, 14 Sep 2009 23:11:37 +0000 (23:11 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 14 Sep 2009 23:11:37 +0000 (23:11 +0000)
sfa/util/misc.py

index b674cd5..e46d8de 100644 (file)
@@ -40,3 +40,10 @@ def slicename_to_hrn(auth_hrn, slicename):
 
     return slice_hrn
 
+def email_to_hrn(auth_hrn, email):
+    parts = email.split("@")
+    username = parts[0]
+    username = username.replace(".", "_") 
+    person_hrn = ".".join([auth_hrn, username])
+    
+    return person_hrn