From a66bd2ce796f884fca0218d6ab5a786ba92fcd1c Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 19 Jan 2011 15:01:53 -0500 Subject: [PATCH] preserve node's full hostname in urn/hrn --- sfa/util/plxrn.py | 4 +++- sfa/util/xrn.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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 -- 2.43.0