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:
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