From 1c7dd6d5cd94c92ebec0a0fda789f4bfffa23472 Mon Sep 17 00:00:00 2001 From: Samuel Munilla Date: Thu, 6 Oct 2016 13:28:15 -0400 Subject: a-o-i: Separate install and scaleup workflows In order to simplify the quick installer logic, this moves the scaleup workflow into its own subcommand. Fixes: Bug 1339621 --- utils/src/ooinstall/utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'utils/src/ooinstall/utils.py') diff --git a/utils/src/ooinstall/utils.py b/utils/src/ooinstall/utils.py index eb27a57e4..85a77c75e 100644 --- a/utils/src/ooinstall/utils.py +++ b/utils/src/ooinstall/utils.py @@ -1,4 +1,6 @@ import logging +import re + installer_log = logging.getLogger('installer') @@ -8,3 +10,12 @@ def debug_env(env): if k.startswith("OPENSHIFT") or k.startswith("ANSIBLE") or k.startswith("OO"): installer_log.debug("{key}: {value}".format( key=k, value=env[k])) + + +def is_valid_hostname(hostname): + if not hostname or len(hostname) > 255: + return False + if hostname[-1] == ".": + hostname = hostname[:-1] # strip exactly one dot from the right, if present + allowed = re.compile(r"(?!-)[A-Z\d-]{1,63}(?