except Exception as e:
logger.debug('Could not locate %s: %s' % (i, e))
if not container_path:
- errors.append('Unable to locate any of %s' % CONTAINER_PREFERENCE)
+ errors.append('ERROR: Unable to locate a supported container engine ({})'.format(' or '.join(CONTAINER_PREFERENCE)))
else:
logger.info('podman|docker (%s) is present' % container_path)
find_program(command)
logger.info('%s is present' % command)
except ValueError:
- errors.append('%s binary does not appear to be installed' % command)
+ errors.append('ERROR: %s binary does not appear to be installed' % command)
# check for configured+running chronyd or ntp
if not check_time_sync():
- errors.append('No time synchronization is active')
+ errors.append('ERROR: No time synchronization is active')
if 'expect_hostname' in args and args.expect_hostname:
if get_hostname().lower() != args.expect_hostname.lower():
- errors.append('hostname "%s" does not match expected hostname "%s"' % (
+ errors.append('ERROR: hostname "%s" does not match expected hostname "%s"' % (
get_hostname(), args.expect_hostname))
logger.info('Hostname "%s" matches what is expected.',
args.expect_hostname)
addr=spec.addr,
error_ok=True, no_fsid=True)
if code:
- raise OrchestratorError('New host %s (%s) failed check: %s' % (
- spec.hostname, spec.addr, err))
+ # err will contain stdout and stderr, so we filter on the message text to
+ # only show the errors
+ errors = [_i.replace("ERROR: ", "") for _i in err if _i.startswith('ERROR')]
+ raise OrchestratorError('New host %s (%s) failed check(s): %s' % (
+ spec.hostname, spec.addr, errors))
self.inventory.add_host(spec)
self.cache.prime_empty_host(spec.hostname)