From: Tony Mack Date: Mon, 10 Sep 2012 19:08:49 +0000 (-0400) Subject: updated set_authority X-Git-Tag: sfa-2.1-14~8 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8f2102fc4f7ecf269bdf62480a63b9b044544098;p=sfa.git updated set_authority --- diff --git a/sfa/util/xrn.py b/sfa/util/xrn.py index 2402de01..493cbba8 100644 --- a/sfa/util/xrn.py +++ b/sfa/util/xrn.py @@ -177,11 +177,9 @@ class Xrn: update the authority section of an existing urn """ authority_hrn = self.get_authority_hrn() - old_hrn_parts = Xrn.hrn_split(self.hrn) - old_hrn_parts[0] = authority - hrn = ".".join(old_hrn_parts) - 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):