Merge "Update prepare using an environment file"
This commit is contained in:
commit
90830a7381
|
@ -51,5 +51,7 @@ MAJOR_UPGRADE_PLAYBOOKS = ["upgrade_steps_playbook.yaml",
|
||||||
MAJOR_UPGRADE_SKIP_TAGS = ['validation', 'pre-upgrade']
|
MAJOR_UPGRADE_SKIP_TAGS = ['validation', 'pre-upgrade']
|
||||||
# upgrade environment files expected by the client in the --templates
|
# upgrade environment files expected by the client in the --templates
|
||||||
# tripleo-heat-templates default above $TRIPLEO_HEAT_TEMPLATES
|
# tripleo-heat-templates default above $TRIPLEO_HEAT_TEMPLATES
|
||||||
|
UPDATE_PREPARE_ENV = "environments/lifecycle/update-prepare.yaml"
|
||||||
|
UPDATE_CONVERGE_ENV = "environments/lifecycle/update-converge.yaml"
|
||||||
UPGRADE_PREPARE_ENV = "environments/lifecycle/upgrade-prepare.yaml"
|
UPGRADE_PREPARE_ENV = "environments/lifecycle/upgrade-prepare.yaml"
|
||||||
UPGRADE_CONVERGE_ENV = "environments/lifecycle/upgrade-converge.yaml"
|
UPGRADE_CONVERGE_ENV = "environments/lifecycle/upgrade-converge.yaml"
|
||||||
|
|
|
@ -66,14 +66,18 @@ class TestOvercloudUpdatePrepare(fakes.TestOvercloudUpdatePrepare):
|
||||||
]
|
]
|
||||||
|
|
||||||
parsed_args = self.check_parser(self.cmd, argslist, verifylist)
|
parsed_args = self.check_parser(self.cmd, argslist, verifylist)
|
||||||
self.cmd.take_action(parsed_args)
|
with mock.patch('os.path.exists') as mock_exists, \
|
||||||
mock_update.assert_called_once_with(
|
mock.patch('os.path.isfile') as mock_isfile:
|
||||||
self.app.client_manager,
|
mock_exists.return_value = True
|
||||||
container='mystack',
|
mock_isfile.return_value = True
|
||||||
container_registry={'fake_container': 'fake_value'},
|
self.cmd.take_action(parsed_args)
|
||||||
ceph_ansible_playbook='/usr/share/ceph-ansible'
|
mock_update.assert_called_once_with(
|
||||||
'/site-docker.yml.sample'
|
self.app.client_manager,
|
||||||
)
|
container='mystack',
|
||||||
|
container_registry={'fake_container': 'fake_value'},
|
||||||
|
ceph_ansible_playbook='/usr/share/ceph-ansible'
|
||||||
|
'/site-docker.yml.sample'
|
||||||
|
)
|
||||||
|
|
||||||
@mock.patch('tripleoclient.workflows.package_update.update',
|
@mock.patch('tripleoclient.workflows.package_update.update',
|
||||||
autospec=True)
|
autospec=True)
|
||||||
|
@ -97,8 +101,12 @@ class TestOvercloudUpdatePrepare(fakes.TestOvercloudUpdatePrepare):
|
||||||
]
|
]
|
||||||
parsed_args = self.check_parser(self.cmd, argslist, verifylist)
|
parsed_args = self.check_parser(self.cmd, argslist, verifylist)
|
||||||
|
|
||||||
self.assertRaises(exceptions.DeploymentError,
|
with mock.patch('os.path.exists') as mock_exists, \
|
||||||
self.cmd.take_action, parsed_args)
|
mock.patch('os.path.isfile') as mock_isfile:
|
||||||
|
mock_exists.return_value = True
|
||||||
|
mock_isfile.return_value = True
|
||||||
|
self.assertRaises(exceptions.DeploymentError,
|
||||||
|
self.cmd.take_action, parsed_args)
|
||||||
|
|
||||||
|
|
||||||
class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun):
|
class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun):
|
||||||
|
|
|
@ -82,6 +82,14 @@ class UpdatePrepare(DeployOvercloud):
|
||||||
# update_plan_only. The heat stack update is done by the
|
# update_plan_only. The heat stack update is done by the
|
||||||
# packag_update mistral action
|
# packag_update mistral action
|
||||||
parsed_args.update_plan_only = True
|
parsed_args.update_plan_only = True
|
||||||
|
|
||||||
|
# Add the upgrade-prepare.yaml environment to set noops etc
|
||||||
|
templates_dir = (parsed_args.templates or
|
||||||
|
constants.TRIPLEO_HEAT_TEMPLATES)
|
||||||
|
parsed_args.environment_files = oooutils.prepend_environment(
|
||||||
|
parsed_args.environment_files, templates_dir,
|
||||||
|
constants.UPDATE_PREPARE_ENV)
|
||||||
|
|
||||||
super(UpdatePrepare, self).take_action(parsed_args)
|
super(UpdatePrepare, self).take_action(parsed_args)
|
||||||
package_update.update(clients, container=stack_name,
|
package_update.update(clients, container=stack_name,
|
||||||
container_registry=registry,
|
container_registry=registry,
|
||||||
|
|
Loading…
Reference in New Issue