From 8f2102fc4f7ecf269bdf62480a63b9b044544098 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 10 Sep 2012 15:08:49 -0400 Subject: [PATCH] updated set_authority --- sfa/util/xrn.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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): -- 2.47.0