From e4c8e7dab7b97bf0ab123b3cf788bba5475e2f58 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Thu, 12 Apr 2012 21:35:24 -0400 Subject: [PATCH] fix bug in get_sliver_id() --- sfa/util/xrn.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sfa/util/xrn.py b/sfa/util/xrn.py index c38fff50..20a11325 100644 --- a/sfa/util/xrn.py +++ b/sfa/util/xrn.py @@ -166,8 +166,12 @@ class Xrn: self._normalize() urn = self.get_urn() if authority: - tmp_hrn = ".".join([authority,self.get_authority_hrn(), self.get_leaf()]) - urn = Xrn(tmp_hrn, self.get_type()).get_urn() + authority_hrn = self.get_authority_hrn() + if not authority_hrn.startswith(authority): + hrn = ".".join([authority,self.get_authority_hrn(), self.get_leaf()]) + else: + hrn = ".".join([self.get_authority_hrn(), self.get_leaf()]) + urn = Xrn(hrn, self.get_type()).get_urn() return ":".join(map(str, [urn, slice_id, node_id, index])) def urn_to_hrn(self): -- 2.43.0