git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4fa19b3
)
fix bug in hrn_to_urn()
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 5 Jul 2012 14:01:58 +0000
(10:01 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 5 Jul 2012 14:01:58 +0000
(10:01 -0400)
sfa/util/xrn.py
patch
|
blob
|
history
diff --git
a/sfa/util/xrn.py
b/sfa/util/xrn.py
index
ff60571
..
367d868
100644
(file)
--- 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 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]
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)
else:
self.authority = Xrn.hrn_auth_list(self.hrn)
name = Xrn.hrn_leaf(self.hrn)