From b66ce82f8654f708c3de0ba7ae98f7267304442e Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 26 Mar 2018 14:54:28 +0200 Subject: [PATCH] Alter default http boot path for containerized Ironic Containerization is a default choice from now on. Alter the --http-boot path defaults from /httpboot to /var/lib/ironic/httpboot as it is configured via puppet and t-h-t. Change-Id: I9ec403eba10488a51ac40348e76dd47c1b7b9c2b Signed-off-by: Bogdan Dobrelya --- ...ault_ironic_http_boot-4b1d3769635b829f.yaml | 6 ++++++ tripleoclient/constants.py | 1 + .../v1/overcloud_image/test_overcloud_image.py | 18 ++++++++++++------ tripleoclient/v1/overcloud_image.py | 5 ++++- 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/default_ironic_http_boot-4b1d3769635b829f.yaml diff --git a/releasenotes/notes/default_ironic_http_boot-4b1d3769635b829f.yaml b/releasenotes/notes/default_ironic_http_boot-4b1d3769635b829f.yaml new file mode 100644 index 000000000..dbf9520fb --- /dev/null +++ b/releasenotes/notes/default_ironic_http_boot-4b1d3769635b829f.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - | + The default value of `--http-boot` changed from `/httpboot` to + `/var/lib/ironic/httpboot` as containerized Ironic services + expect. diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index fee4a9a7a..676b99d90 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -42,6 +42,7 @@ UPGRADE_QUEUE = 'upgrade' FFWD_UPGRADE_QUEUE = 'ffwdupgrade' STACK_TIMEOUT = 240 +IRONIC_HTTP_BOOT_BIND_MOUNT = '/var/lib/ironic/httpboot' # The default ffwd upgrade ansible playbooks generated from heat stack output FFWD_UPGRADE_PLAYBOOK = "fast_forward_upgrade_playbook.yaml" diff --git a/tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py b/tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py index fd5dc49ff..d324ef985 100644 --- a/tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py +++ b/tripleoclient/tests/v1/overcloud_image/test_overcloud_image.py @@ -256,9 +256,11 @@ class TestUploadOvercloudImage(TestPluginV1): self.assertEqual( mock_subprocess_call.call_args_list, [ mock.call('sudo cp -f "./ironic-python-agent.kernel" ' - '"/httpboot/agent.kernel"', shell=True), + '"/var/lib/ironic/httpboot/agent.kernel"', + shell=True), mock.call('sudo cp -f "./ironic-python-agent.initramfs" ' - '"/httpboot/agent.ramdisk"', shell=True) + '"/var/lib/ironic/httpboot/agent.ramdisk"', + shell=True) ]) @mock.patch('os.path.isfile', autospec=True) @@ -311,9 +313,11 @@ class TestUploadOvercloudImage(TestPluginV1): self.assertEqual( mock_subprocess_call.call_args_list, [ mock.call('sudo cp -f "./ironic-python-agent.kernel" ' - '"/httpboot/agent.kernel"', shell=True), + '"/var/lib/ironic/httpboot/agent.kernel"', + shell=True), mock.call('sudo cp -f "./ironic-python-agent.initramfs" ' - '"/httpboot/agent.ramdisk"', shell=True) + '"/var/lib/ironic/httpboot/agent.ramdisk"', + shell=True) ]) @mock.patch('os.path.isfile') @@ -459,9 +463,11 @@ class TestUploadOvercloudImageFull(TestPluginV1): self.assertEqual( mock_subprocess_call.call_args_list, [ mock.call('sudo cp -f "./ironic-python-agent.kernel" ' - '"/httpboot/agent.kernel"', shell=True), + '"/var/lib/ironic/httpboot/agent.kernel"', + shell=True), mock.call('sudo cp -f "./ironic-python-agent.initramfs" ' - '"/httpboot/agent.ramdisk"', shell=True) + '"/var/lib/ironic/httpboot/agent.ramdisk"', + shell=True) ]) @mock.patch('os.path.isfile', autospec=True) diff --git a/tripleoclient/v1/overcloud_image.py b/tripleoclient/v1/overcloud_image.py index 98f91f002..2f18d88be 100644 --- a/tripleoclient/v1/overcloud_image.py +++ b/tripleoclient/v1/overcloud_image.py @@ -28,6 +28,7 @@ from prettytable import PrettyTable from tripleo_common.image import build from tripleoclient import command +from tripleoclient import constants from tripleoclient import utils as plugin_utils @@ -258,7 +259,9 @@ class UploadOvercloudImage(command.Command): ) parser.add_argument( "--http-boot", - default=self._get_environment_var('HTTP_BOOT', '/httpboot'), + default=self._get_environment_var( + 'HTTP_BOOT', + constants.IRONIC_HTTP_BOOT_BIND_MOUNT), help=_("Root directory for the introspection image") ) parser.add_argument(