Add some logging for the preflight checks

Currently, the preflight checks are run without any output.
This can be misleading, especially if we get an error on one
of the checks - no real way to know WHAT failed in the current

This easy log output helps the operator to know what's going on.

Change-Id: Ifbdbdb37431ad28fbd86993f9800bee8b3fbdd4a
Closes-Bug: 1783787
Cédric Jeanneret 4 years ago
parent 54e5ae9be6
commit 766b3e3dda
  1. 19

@ -481,6 +481,10 @@ def _validate_architecure_options():
def _checking_status(item):'Checking %s...') % item)
def check(verbose_level, upgrade=False):
# Fetch configuration and use its log file param to add logging to a file
utils.load_config(CONF, constants.UNDERCLOUD_CONF_PATH)
@ -489,25 +493,40 @@ def check(verbose_level, upgrade=False):
# data = { CONF[] for opt in _opts}
# Other validations
_checking_status('Disk space')
_checking_status('Password file')
# Heat templates validations
if CONF.get('custom_env_files'):
_checking_status('Custom env file')
# Networking validations
_checking_status('Networking values')
for subnet in CONF.subnets:
s = CONF.get(subnet)
_checking_status('Subnet "%s" is in CIDR' % subnet)
_validate_in_cidr(s, subnet)
_checking_status('DHCP range is in subnet "%s"' % subnet)
_checking_status('Inspection range for subnet "%s"' % subnet)
_checking_status('Subnet "%s" has no overlap' % subnet)
_checking_status('IP addresses')
_checking_status('Network interfaces')
_checking_status('Provisionning IP change')
except KeyError as e:
LOG.error(_('Key error in configuration: {error}\n'