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:
219a0fd
)
added urn_to_sliver_id() method
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 7 Jul 2011 20:27:19 +0000
(16:27 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 7 Jul 2011 20:27:19 +0000
(16:27 -0400)
sfa/util/xrn.py
patch
|
blob
|
history
diff --git
a/sfa/util/xrn.py
b/sfa/util/xrn.py
index
752e7a9
..
76c55be
100644
(file)
--- a/
sfa/util/xrn.py
+++ b/
sfa/util/xrn.py
@@
-8,6
+8,9
@@
def get_authority(hrn): return Xrn(hrn).get_authority_hrn()
def urn_to_hrn(urn): xrn=Xrn(urn); return (xrn.hrn, xrn.type)
def hrn_to_urn(hrn,type): return Xrn(hrn, type=type).urn
+def urn_to_sliver_id(urn, slice_id, node_id, index=0):
+ return ":".join([urn, slice_id, node_id, index])
+
class Xrn:
########## basic tools on HRNs