From: Tony Mack Date: Wed, 19 Jan 2011 20:01:53 +0000 (-0500) Subject: preserve node's full hostname in urn/hrn X-Git-Tag: sfa-1.0-12~10 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a66bd2ce796f884fca0218d6ab5a786ba92fcd1c;p=sfa.git preserve node's full hostname in urn/hrn --- diff --git a/sfa/util/plxrn.py b/sfa/util/plxrn.py index 12e32d02..e5389021 100644 --- a/sfa/util/plxrn.py +++ b/sfa/util/plxrn.py @@ -30,7 +30,9 @@ class PlXrn (Xrn): if hostname is not None: self.type='node' # keep only the first part of the DNS name - self.hrn='.'.join( [auth,hostname.split(".")[0] ] ) + #self.hrn='.'.join( [auth,hostname.split(".")[0] ] ) + # escape the '.' in the hostname + self.hrn='.'.join( [auth,Xrn.escape(hostname)] ) self.hrn_to_urn() #def slicename_to_hrn(auth_hrn, slicename): elif slicename is not None: diff --git a/sfa/util/xrn.py b/sfa/util/xrn.py index d33bc4ea..d5ad2d45 100644 --- a/sfa/util/xrn.py +++ b/sfa/util/xrn.py @@ -153,9 +153,9 @@ class Xrn: authority_string = self.get_authority_urn() if self.type == None: - urn = "+".join(['',authority_string,name]) + urn = "+".join(['',authority_string,Xrn.unescape(name)]) else: - urn = "+".join(['',authority_string,self.type,name]) + urn = "+".join(['',authority_string,self.type,Xrn.unescape(name)]) self.urn = Xrn.URN_PREFIX + urn