Removed _ from hostnames (no valid)

This commit is contained in:
Adolfo Gómez García 2020-07-08 19:39:37 +02:00
parent c286beac9f
commit 416a11c0ed

View File

@ -156,7 +156,7 @@ def checkValidBasename(baseName: str, length: int = -1) -> None:
Returns:
None -- [description]
"""
if re.match(r'^[a-zA-Z0-9-]+$', baseName) is None:
if re.match(r'^[a-zA-Z0-9][a-zA-Z0-9-]*$', baseName) is None:
raise services.Service.ValidationException(ugettext('The basename is not a valid for a hostname'))
if length == 0: