From 91634d82d7d71c59b80e2b3e06ae778f976c1d82 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Fri, 24 Mar 2017 14:54:15 +0000 Subject: [PATCH] Validate NtpServers during plan processing Moving this to an earlier function allows us to decouple the plan processing from the heat_deploy which deploys the plan. In future it would be good to move this to a mistral validation instead of a client-side special case. Change-Id: If9e9fceb85408221cebbbacb8908f73b42268c19 Partial-Bug: #1635409 --- tripleoclient/v1/overcloud_deploy.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tripleoclient/v1/overcloud_deploy.py b/tripleoclient/v1/overcloud_deploy.py index d674502e2..3ba9306ab 100644 --- a/tripleoclient/v1/overcloud_deploy.py +++ b/tripleoclient/v1/overcloud_deploy.py @@ -221,14 +221,6 @@ class DeployOvercloud(command.Command): files = dict(list(template_files.items()) + list(env_files.items())) - number_controllers = int(parameters.get('ControllerCount', 0)) - if number_controllers > 1: - if not env.get('parameter_defaults').get('NtpServer'): - raise exceptions.InvalidConfiguration( - 'Specify --ntp-server as parameter or NtpServer in ' - 'environments when using multiple controllers ' - '(with HA).') - moved_files = self._upload_missing_files( stack_name, files, tht_root) self._process_and_upload_environment( @@ -434,6 +426,16 @@ class DeployOvercloud(command.Command): if stack: update.add_breakpoints_cleanup_into_env(env) + # FIXME(shardy) It'd be better to validate this via mistral + # e.g part of the plan create/update workflow + number_controllers = int(parameters.get('ControllerCount', 0)) + if number_controllers > 1: + if not env.get('parameter_defaults').get('NtpServer'): + raise exceptions.InvalidConfiguration( + 'Specify --ntp-server as parameter or NtpServer in ' + 'environments when using multiple controllers ' + '(with HA).') + self._try_overcloud_deploy_with_compat_yaml( tht_root, stack, parsed_args.stack, parameters, env_files, parsed_args.timeout, env, parsed_args.update_plan_only,