merge from geni-api branch
authorTony Mack <tmack@cs.princeton.edu>
Mon, 12 Jul 2010 15:33:40 +0000 (15:33 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 12 Jul 2010 15:33:40 +0000 (15:33 +0000)
sfa/util/namespace.py

index e898f3c..c771d71 100644 (file)
@@ -75,8 +75,9 @@ def urn_to_hrn(urn):
     # join list elements using '.'
     hrn = '.'.join([part.replace(':', '.') for part in hrn_parts if part]) 
     
+    # Remove the authority name (e.g. '.sa')
     if type == 'authority':
-        hrn = hrn.replace ('.sa', '')
+        hrn = hrn[:hrn.rindex('.')]        
    
     return str(hrn), str(type)