From: Tony Mack Date: Thu, 7 Jul 2011 20:27:19 +0000 (-0400) Subject: added urn_to_sliver_id() method X-Git-Tag: sfa-1.0-27~9 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ed7a92df8d6737c0982b87b26d9986a71c6cef51;p=sfa.git added urn_to_sliver_id() method --- diff --git a/sfa/util/xrn.py b/sfa/util/xrn.py index 752e7a9e..76c55be0 100644 --- 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