From 3295f8160006ca627b9656711d2961e89e4285d9 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Thu, 5 Jul 2012 10:01:58 -0400 Subject: [PATCH] fix bug in hrn_to_urn() --- sfa/util/xrn.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sfa/util/xrn.py b/sfa/util/xrn.py index ff605714..367d868e 100644 --- a/sfa/util/xrn.py +++ b/sfa/util/xrn.py @@ -225,14 +225,15 @@ class Xrn: if self.type and self.type.startswith('authority'): self.authority = Xrn.hrn_auth_list(self.hrn) leaf = self.get_leaf() - if not self.authority: - self.authority = [self.hrn] + #if not self.authority: + # self.authority = [self.hrn] type_parts = self.type.split("+") self.type = type_parts[0] name = 'sa' if len(type_parts) > 1: name = type_parts[1] - authority_string = ":".join([self.get_authority_urn(), leaf]) + auth_parts = [part for part in [self.get_authority_urn(), leaf] if part] + authority_string = ":".join(auth_parts) else: self.authority = Xrn.hrn_auth_list(self.hrn) name = Xrn.hrn_leaf(self.hrn) -- 2.43.0