Merge "Add check for disable_upgrade_deployment flag in roles_data"

This commit is contained in:
Jenkins 2017-07-22 02:59:11 +00:00 committed by Gerrit Code Review
commit 564a2969b9
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,8 @@
---
upgrade:
- If the operator specifies a roles_data.yaml for the deployment or upgrade
this adds a check that the disable_upgrade_deployment flag is set at least
once in that file and otherwise logs a warning. If the
validation-warnings-fatal parameter is set to True (default is False) then
this check will also raise an InvalidConfiguration exception.

View File

@ -567,6 +567,25 @@ class DeployOvercloud(command.Command):
"Error: The following files were not found: {0}".format(
", ".join(nonexisting_envs)))
# Check if disable_upgrade_deployment is set once
self.log.debug("Checking that the disable_upgrade_deployment flag "
"is set at least once in the roles file")
if parsed_args.roles_file:
roles_data = yaml.safe_load(open(parsed_args.roles_file).read())
disable_upgrade_deployment_set = False
for r in roles_data:
if r.get("disable_upgrade_deployment"):
disable_upgrade_deployment_set = True
break
if not disable_upgrade_deployment_set:
self.log.warning(
"The disable_upgrade_deployment flag is not set in the "
"roles file. This flag is expected when you have a "
"nova-compute or swift-storage role. Please check the "
"contents of the roles file: %s" % roles_data)
if parsed_args.validation_warnings_fatal:
raise exceptions.InvalidConfiguration()
def _get_default_role_counts(self, parsed_args):
if parsed_args.roles_file: