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:
e2dc434
)
updated set_authority
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Mon, 10 Sep 2012 19:08:49 +0000
(15:08 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Mon, 10 Sep 2012 19:08:49 +0000
(15:08 -0400)
sfa/util/xrn.py
patch
|
blob
|
history
diff --git
a/sfa/util/xrn.py
b/sfa/util/xrn.py
index
2402de0
..
493cbba
100644
(file)
--- 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()
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):
self._normalize()
def urn_to_hrn(self):