@staticmethod
def site_hrn (auth, login_base):
- return '.'.join(auth,login_base)
+ return '.'.join([auth,login_base])
def __init__ (self, auth=None, hostname=None, slicename=None, email=None, **kwargs):
#def hostname_to_hrn(auth_hrn, login_base, hostname):
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:
def pl_slicename (self):
self._normalize()
leaf = self.leaf
- leaf = re.sub('[^a-zA-Z0-9]', '', leaf)
+ leaf = re.sub('[^a-zA-Z0-9_]', '', leaf)
return self.pl_login_base() + '_' + leaf
#def hrn_to_pl_authname(hrn):