Merge "Remove container_registry param from package update action"
This commit is contained in:
commit
eec7d684e5
@ -28,11 +28,9 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
class UpdateStackAction(templates.ProcessTemplatesAction):
|
||||
|
||||
def __init__(self, timeout, container_registry,
|
||||
container=constants.DEFAULT_CONTAINER_NAME):
|
||||
def __init__(self, timeout, container=constants.DEFAULT_CONTAINER_NAME):
|
||||
super(UpdateStackAction, self).__init__(container)
|
||||
self.timeout_mins = timeout
|
||||
self.container_registry = container_registry
|
||||
|
||||
def run(self, context):
|
||||
# get the stack. Error if doesn't exist
|
||||
@ -55,8 +53,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': {
|
||||
@ -76,10 +72,6 @@ class UpdateStackAction(templates.ProcessTemplatesAction):
|
||||
noop_env['resource_registry'].update(role_env)
|
||||
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'])
|
||||
plan_utils.update_in_env(swift, env, 'parameter_defaults', parameters)
|
||||
|
||||
# process all plan files and create or update a stack
|
||||
processed_data = super(UpdateStackAction, self).run(context)
|
||||
|
@ -98,23 +98,12 @@ 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)
|
||||
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')
|
||||
|
@ -11,7 +11,7 @@ workflows:
|
||||
|
||||
input:
|
||||
- container
|
||||
- container_registry
|
||||
- container_registry: ''
|
||||
- timeout: 240
|
||||
- queue_name: tripleo
|
||||
- skip_deploy_identifier: False
|
||||
@ -26,7 +26,6 @@ workflows:
|
||||
input:
|
||||
timeout: <% $.timeout %>
|
||||
container: <% $.container %>
|
||||
container_registry: <% $.container_registry %>
|
||||
on-success: send_message
|
||||
on-error: set_update_failed
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user