From 40d4c37bf21dbece595e04ffb8ddefcbfe250a65 Mon Sep 17 00:00:00 2001 From: mandreou Date: Wed, 30 May 2018 15:06:55 +0300 Subject: [PATCH] Remove container_registry param from package update action The package_update_plan mistrl workflow is invoked in upgrade|update| ceph-upgrade|ffwd-upgrade prepare clis. The container registry parameter is being removed and we will use treat it as a regular environment file (see depends-on). This removes it from the Mistral action and keeps it defaulted in the workflow to prevent chicken-and-egg issues with CI. We'll remove the workflow parameter in a follow-up patch. Partial-Bug: #1785825 Co-Authored-By: Jiri Stransky Related: https://review.openstack.org/570893 python-tripleoclient Change-Id: I4130dd1eea6caec82dcb4a699875f2951693148f (cherry picked from commit c837491161c24ca7bb9fbfcbb3b51d88c8d7b9d1) --- tripleo_common/actions/package_update.py | 7 +------ tripleo_common/tests/actions/test_package_update.py | 13 +------------ workbooks/package_update.yaml | 3 +-- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/tripleo_common/actions/package_update.py b/tripleo_common/actions/package_update.py index d7969c9a9..498cdc581 100644 --- a/tripleo_common/actions/package_update.py +++ b/tripleo_common/actions/package_update.py @@ -28,11 +28,10 @@ LOG = logging.getLogger(__name__) class UpdateStackAction(templates.ProcessTemplatesAction): - def __init__(self, timeout, container_registry, ceph_ansible_playbook, + def __init__(self, timeout, ceph_ansible_playbook, container=constants.DEFAULT_CONTAINER_NAME): super(UpdateStackAction, self).__init__(container) self.timeout_mins = timeout - self.container_registry = container_registry self.ceph_ansible_playbook = ceph_ansible_playbook def run(self, context): @@ -56,8 +55,6 @@ class UpdateStackAction(templates.ProcessTemplatesAction): return actions.Result(error=err_msg) update_env = {} - if self.container_registry is not None: - update_env.update(self.container_registry) noop_env = { 'resource_registry': { @@ -78,8 +75,6 @@ class UpdateStackAction(templates.ProcessTemplatesAction): update_env.update(noop_env) template_utils.deep_update(env, update_env) parameters = {} - if self.container_registry is not None: - parameters.update(self.container_registry['parameter_defaults']) if self.ceph_ansible_playbook: parameters.update({'CephAnsiblePlaybook': '%s' % self.ceph_ansible_playbook}) diff --git a/tripleo_common/tests/actions/test_package_update.py b/tripleo_common/tests/actions/test_package_update.py index 63e2ec859..0fbf0619d 100644 --- a/tripleo_common/tests/actions/test_package_update.py +++ b/tripleo_common/tests/actions/test_package_update.py @@ -98,24 +98,13 @@ class UpdateStackActionTest(base.TestCase): update_env = {'resource_registry': {'OS::TripleO::DeploymentSteps': 'OS::Heat::None'}} mock_getenv.return_value = env - fake_registry = {'parameter_defaults': - {'DockerKeystoneImage': '192.168.24.1:8787/' - 'keystone-docker:latest', - 'DockerHeatApiImage:': '192.168.24.1:8787/' - 'heat-api-docker:latest'}} - update_env.update(fake_registry) mock_swift.get_object.return_value = ({}, env) mock_object_client.return_value = mock_swift - action = package_update.UpdateStackAction(self.timeout, fake_registry, + action = package_update.UpdateStackAction(self.timeout, container=self.container, ceph_ansible_playbook=None) action.run(mock_ctx) - mock_updateinenv.assert_called_once_with( - mock_swift, env, 'parameter_defaults', - fake_registry['parameter_defaults'] - ) - mock_deepupdate.assert_called_once_with(env, update_env) heat.stacks.update.assert_called_once_with('stack_id') diff --git a/workbooks/package_update.yaml b/workbooks/package_update.yaml index 4ad972c23..407db5abe 100644 --- a/workbooks/package_update.yaml +++ b/workbooks/package_update.yaml @@ -11,7 +11,7 @@ workflows: input: - container - - container_registry + - container_registry: '' - ceph_ansible_playbook - timeout: 240 - queue_name: tripleo @@ -27,7 +27,6 @@ workflows: input: timeout: <% $.timeout %> container: <% $.container %> - container_registry: <% $.container_registry %> ceph_ansible_playbook: <% $.ceph_ansible_playbook %> on-success: clean_plan on-error: set_update_failed