updated set_authority
[sfa.git] / sfa / util / xrn.py
index 9656304..493cbba 100644 (file)
@@ -177,9 +177,9 @@ class Xrn:
         update the authority section of an existing urn
         """
         authority_hrn = self.get_authority_hrn()
-        hrn = ".".join([authority, self.get_leaf()]) 
-        self.hrn = hrn 
-        self.hrn_to_urn()
+        if not authority_hrn.startswith(authority+"."):
+            self.hrn = authority + "." + self.hrn
+            self.hrn_to_urn()
         self._normalize()
         
     def urn_to_hrn(self):