Don't validate stack when creating/updating plan
There may be resource mappings in user_environment. Change-Id: Ia2299698dfb5d7afb374e9ac2d7908c7cc6bbc22 Closes-Bug: #1817539 Depends-On: https://review.openstack.org/639072
This commit is contained in:
parent
52c2cf14c2
commit
eae703d52d
|
@ -228,7 +228,8 @@ class TestOvercloudCreatePlan(utils.TestCommand):
|
|||
'tripleo.plan_management.v1.create_deployment_plan',
|
||||
workflow_input={
|
||||
'container': 'overcast',
|
||||
'generate_passwords': True
|
||||
'generate_passwords': True,
|
||||
'validate_stack': False
|
||||
})
|
||||
|
||||
@mock.patch("tripleoclient.workflows.plan_management.tarball")
|
||||
|
@ -285,7 +286,8 @@ class TestOvercloudCreatePlan(utils.TestCommand):
|
|||
'tripleo.plan_management.v1.create_deployment_plan',
|
||||
workflow_input={
|
||||
'container': 'overcast',
|
||||
'generate_passwords': True
|
||||
'generate_passwords': True,
|
||||
'validate_stack': False
|
||||
})
|
||||
|
||||
self.swift.get_account.assert_called_once()
|
||||
|
@ -330,7 +332,8 @@ class TestOvercloudCreatePlan(utils.TestCommand):
|
|||
'tripleo.plan_management.v1.create_deployment_plan',
|
||||
workflow_input={
|
||||
'container': 'overcast',
|
||||
'generate_passwords': True
|
||||
'generate_passwords': True,
|
||||
'validate_stack': False
|
||||
})
|
||||
|
||||
mock_open_context.assert_has_calls(
|
||||
|
|
|
@ -51,7 +51,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
plan_management.create_plan_from_templates(
|
||||
self.app.client_manager,
|
||||
'test-overcloud',
|
||||
'/tht-root/')
|
||||
'/tht-root/',
|
||||
validate_stack=False)
|
||||
|
||||
self.workflow.action_executions.create.assert_called_once_with(
|
||||
'tripleo.plan.create_container',
|
||||
|
@ -61,7 +62,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
self.workflow.executions.create.assert_called_once_with(
|
||||
'tripleo.plan_management.v1.create_deployment_plan',
|
||||
workflow_input={'container': 'test-overcloud',
|
||||
'generate_passwords': True})
|
||||
'generate_passwords': True,
|
||||
'validate_stack': False})
|
||||
|
||||
@mock.patch('tripleoclient.workflows.plan_management.tarball',
|
||||
autospec=True)
|
||||
|
@ -76,7 +78,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
plan_management.create_plan_from_templates,
|
||||
self.app.client_manager,
|
||||
'test-overcloud',
|
||||
'/tht-root/')
|
||||
'/tht-root/',
|
||||
validate_stack=False)
|
||||
|
||||
self.workflow.action_executions.create.assert_called_once_with(
|
||||
'tripleo.plan.create_container',
|
||||
|
@ -102,7 +105,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
self.app.client_manager,
|
||||
'test-overcloud',
|
||||
'/tht-root/',
|
||||
'the_roles_file.yaml')
|
||||
'the_roles_file.yaml',
|
||||
validate_stack=False)
|
||||
|
||||
self.workflow.action_executions.create.assert_called_once_with(
|
||||
'tripleo.plan.create_container',
|
||||
|
@ -112,7 +116,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
self.workflow.executions.create.assert_called_once_with(
|
||||
'tripleo.plan_management.v1.create_deployment_plan',
|
||||
workflow_input={'container': 'test-overcloud',
|
||||
'generate_passwords': True})
|
||||
'generate_passwords': True,
|
||||
'validate_stack': False})
|
||||
|
||||
self.assertIn(mock.call('the_roles_file.yaml', '/tht-root/'),
|
||||
mock_norm_path.call_args_list)
|
||||
|
@ -135,7 +140,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
self.app.client_manager,
|
||||
'test-overcloud',
|
||||
'/tht-root/',
|
||||
plan_env_file='the-plan-environment.yaml')
|
||||
plan_env_file='the-plan-environment.yaml',
|
||||
validate_stack=False)
|
||||
|
||||
self.workflow.action_executions.create.assert_called_once_with(
|
||||
'tripleo.plan.create_container',
|
||||
|
@ -145,7 +151,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
self.workflow.executions.create.assert_called_once_with(
|
||||
'tripleo.plan_management.v1.create_deployment_plan',
|
||||
workflow_input={'container': 'test-overcloud',
|
||||
'generate_passwords': True})
|
||||
'generate_passwords': True,
|
||||
'validate_stack': False})
|
||||
|
||||
mock_open_context.assert_has_calls(
|
||||
[mock.call('the-plan-environment.yaml')])
|
||||
|
@ -168,7 +175,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
self.app.client_manager,
|
||||
'test-overcloud',
|
||||
'/tht-root/',
|
||||
networks_file='the-network-data.yaml')
|
||||
networks_file='the-network-data.yaml',
|
||||
validate_stack=False)
|
||||
|
||||
self.workflow.action_executions.create.assert_called_once_with(
|
||||
'tripleo.plan.create_container',
|
||||
|
@ -178,7 +186,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
self.workflow.executions.create.assert_called_once_with(
|
||||
'tripleo.plan_management.v1.create_deployment_plan',
|
||||
workflow_input={'container': 'test-overcloud',
|
||||
'generate_passwords': True})
|
||||
'generate_passwords': True,
|
||||
'validate_stack': False})
|
||||
|
||||
mock_open_context.assert_has_calls(
|
||||
[mock.call('the-network-data.yaml')])
|
||||
|
@ -214,7 +223,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
self.app.client_manager,
|
||||
'test-overcloud',
|
||||
'/tht-root/',
|
||||
generate_passwords=False)
|
||||
generate_passwords=False,
|
||||
validate_stack=False)
|
||||
|
||||
self.workflow.action_executions.create.assert_called_once_with(
|
||||
'tripleo.plan.create_container',
|
||||
|
@ -224,7 +234,8 @@ class TestPlanCreationWorkflows(utils.TestCommand):
|
|||
self.workflow.executions.create.assert_called_once_with(
|
||||
'tripleo.plan_management.v1.create_deployment_plan',
|
||||
workflow_input={'container': 'test-overcloud',
|
||||
'generate_passwords': False})
|
||||
'generate_passwords': False,
|
||||
'validate_stack': False})
|
||||
|
||||
|
||||
class TestPlanUpdateWorkflows(base.TestCommand):
|
||||
|
@ -285,7 +296,8 @@ class TestPlanUpdateWorkflows(base.TestCommand):
|
|||
self.app.client_manager,
|
||||
'test-overcloud',
|
||||
'/tht-root/',
|
||||
keep_env=True)
|
||||
keep_env=True,
|
||||
validate_stack=False)
|
||||
|
||||
mock_empty_container.assert_called_once_with(
|
||||
self.object_store, 'test-overcloud')
|
||||
|
@ -313,7 +325,8 @@ class TestPlanUpdateWorkflows(base.TestCommand):
|
|||
self.workflow.executions.create.assert_called_once_with(
|
||||
'tripleo.plan_management.v1.update_deployment_plan',
|
||||
workflow_input={'container': 'test-overcloud',
|
||||
'generate_passwords': True, 'source_url': None})
|
||||
'generate_passwords': True, 'source_url': None,
|
||||
'validate_stack': False})
|
||||
|
||||
@mock.patch('tripleoclient.workflows.plan_management.tarball',
|
||||
autospec=True)
|
||||
|
@ -325,7 +338,8 @@ class TestPlanUpdateWorkflows(base.TestCommand):
|
|||
plan_management.update_plan_from_templates(
|
||||
self.app.client_manager,
|
||||
'test-overcloud',
|
||||
'/tht-root/')
|
||||
'/tht-root/',
|
||||
validate_stack=False)
|
||||
|
||||
mock_empty_container.assert_called_once_with(
|
||||
self.object_store, 'test-overcloud')
|
||||
|
@ -340,7 +354,8 @@ class TestPlanUpdateWorkflows(base.TestCommand):
|
|||
self.workflow.executions.create.assert_called_once_with(
|
||||
'tripleo.plan_management.v1.update_deployment_plan',
|
||||
workflow_input={'container': 'test-overcloud',
|
||||
'generate_passwords': True, 'source_url': None})
|
||||
'generate_passwords': True, 'source_url': None,
|
||||
'validate_stack': False})
|
||||
|
||||
|
||||
class TestUpdatePasswords(base.TestCase):
|
||||
|
|
|
@ -387,13 +387,15 @@ class DeployOvercloud(command.Command):
|
|||
parsed_args.roles_file, generate_passwords,
|
||||
parsed_args.plan_environment_file,
|
||||
parsed_args.networks_file,
|
||||
type(self)._keep_env_on_update)
|
||||
type(self)._keep_env_on_update,
|
||||
validate_stack=False)
|
||||
else:
|
||||
plan_management.create_plan_from_templates(
|
||||
self.clients, parsed_args.stack, tht_root,
|
||||
parsed_args.roles_file, generate_passwords,
|
||||
parsed_args.plan_environment_file,
|
||||
parsed_args.networks_file)
|
||||
parsed_args.networks_file,
|
||||
validate_stack=False)
|
||||
|
||||
# Get any missing (e.g j2 rendered) files from the plan to tht_root
|
||||
self._download_missing_files_from_plan(
|
||||
|
|
|
@ -126,7 +126,8 @@ class CreatePlan(command.Command):
|
|||
plan_management.create_plan_from_templates(
|
||||
clients, name, parsed_args.templates,
|
||||
generate_passwords=generate_passwords,
|
||||
plan_env_file=parsed_args.plan_environment_file)
|
||||
plan_env_file=parsed_args.plan_environment_file,
|
||||
validate_stack=False)
|
||||
else:
|
||||
plan_management.create_deployment_plan(
|
||||
clients, container=name,
|
||||
|
|
|
@ -151,7 +151,7 @@ def create_container(workflow_client, **input_):
|
|||
|
||||
def create_plan_from_templates(clients, name, tht_root, roles_file=None,
|
||||
generate_passwords=True, plan_env_file=None,
|
||||
networks_file=None):
|
||||
networks_file=None, validate_stack=True):
|
||||
workflow_client = clients.workflow_engine
|
||||
swift_client = clients.tripleoclient.object_store
|
||||
|
||||
|
@ -170,7 +170,8 @@ def create_plan_from_templates(clients, name, tht_root, roles_file=None,
|
|||
|
||||
try:
|
||||
create_deployment_plan(clients, container=name,
|
||||
generate_passwords=generate_passwords)
|
||||
generate_passwords=generate_passwords,
|
||||
validate_stack=validate_stack)
|
||||
except exceptions.WorkflowServiceError:
|
||||
swiftutils.delete_container(swift_client, name)
|
||||
raise
|
||||
|
@ -178,7 +179,8 @@ def create_plan_from_templates(clients, name, tht_root, roles_file=None,
|
|||
|
||||
def update_plan_from_templates(clients, name, tht_root, roles_file=None,
|
||||
generate_passwords=True, plan_env_file=None,
|
||||
networks_file=None, keep_env=False):
|
||||
networks_file=None, keep_env=False,
|
||||
validate_stack=True):
|
||||
swift_client = clients.tripleoclient.object_store
|
||||
passwords = None
|
||||
keep_file_contents = {}
|
||||
|
@ -232,7 +234,8 @@ def update_plan_from_templates(clients, name, tht_root, roles_file=None,
|
|||
|
||||
update_deployment_plan(clients, container=name,
|
||||
generate_passwords=generate_passwords,
|
||||
source_url=None)
|
||||
source_url=None,
|
||||
validate_stack=validate_stack)
|
||||
|
||||
|
||||
def _load_content_or_file(swift_client, container, remote_and_local_map):
|
||||
|
|
Loading…
Reference in New Issue