From 07268ba360b1a79ab62aa4b2b94693ade727dfc0 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Fri, 7 Sep 2012 10:37:16 -0400 Subject: [PATCH] fix set_authority(). replace invalid char in sliver_id with '-' --- sfa/util/xrn.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sfa/util/xrn.py b/sfa/util/xrn.py index e548fa56..414a8a68 100644 --- a/sfa/util/xrn.py +++ b/sfa/util/xrn.py @@ -124,7 +124,7 @@ class Xrn: self.hrn=None self.urn=xrn if id: - self.urn = "%s:%s" % (self.urn, str(id)) + self.urn = "%s-%s" % (self.urn, str(id)) self.urn_to_hrn() else: self.urn=None @@ -173,11 +173,7 @@ class Xrn: update the authority section of an existing urn """ authority_hrn = self.get_authority_hrn() - if not authority_hrn.startswith(authority): - hrn = ".".join([authority,authority_hrn, self.get_leaf()]) - else: - hrn = ".".join([authority_hrn, self.get_leaf()]) - + hrn = ".".join([authority, self.get_leaf()]) self.hrn = hrn self.hrn_to_urn() self._normalize() -- 2.43.0