Remove default plan-environment.yaml references
Now, we only use it to specify the derive parameter playbooks. Change-Id: Icfa40c7e92b5adeb57017c037aeb3409e840f425
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- |
|
||||||
|
The --plan-environment-file option of openstack tripleo deploy command
|
||||||
|
is now deprecated and not used.
|
||||||
@@ -45,9 +45,6 @@ DEFAULT_HEAT_CONTAINER = ('{}/{}/openstack-heat-all:{}'.format(
|
|||||||
DEFAULT_CONTAINER_TAG))
|
DEFAULT_CONTAINER_TAG))
|
||||||
|
|
||||||
|
|
||||||
# The name of the file which holds the plan environment contents
|
|
||||||
PLAN_ENVIRONMENT = 'plan-environment.yaml'
|
|
||||||
USER_ENVIRONMENT = 'user-environment.yaml'
|
|
||||||
USER_PARAMETERS = 'user-environments/tripleoclient-parameters.yaml'
|
USER_PARAMETERS = 'user-environments/tripleoclient-parameters.yaml'
|
||||||
|
|
||||||
# This directory may contain additional environments to use during deploy
|
# This directory may contain additional environments to use during deploy
|
||||||
|
|||||||
@@ -32,12 +32,6 @@ class DeploymentWorkflowFixture(fixtures.Fixture):
|
|||||||
).mock
|
).mock
|
||||||
|
|
||||||
|
|
||||||
class PlanManagementFixture(fixtures.Fixture):
|
|
||||||
|
|
||||||
def _setUp(self):
|
|
||||||
super(PlanManagementFixture, self)._setUp()
|
|
||||||
|
|
||||||
|
|
||||||
class UtilsOvercloudFixture(fixtures.Fixture):
|
class UtilsOvercloudFixture(fixtures.Fixture):
|
||||||
|
|
||||||
def _setUp(self):
|
def _setUp(self):
|
||||||
|
|||||||
@@ -167,8 +167,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
orchestration_client = clients.orchestration
|
orchestration_client = clients.orchestration
|
||||||
mock_stack = fakes.create_tht_stack()
|
mock_stack = fakes.create_tht_stack()
|
||||||
orchestration_client.stacks.get.return_value = mock_stack
|
orchestration_client.stacks.get.return_value = mock_stack
|
||||||
plane_management_fixture = deployment.PlanManagementFixture()
|
|
||||||
self.useFixture(plane_management_fixture)
|
|
||||||
utils_fixture = deployment.UtilsFixture()
|
utils_fixture = deployment.UtilsFixture()
|
||||||
self.useFixture(utils_fixture)
|
self.useFixture(utils_fixture)
|
||||||
arglist = ['--templates']
|
arglist = ['--templates']
|
||||||
@@ -282,8 +280,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
mock_stack_data):
|
mock_stack_data):
|
||||||
fixture = deployment.DeploymentWorkflowFixture()
|
fixture = deployment.DeploymentWorkflowFixture()
|
||||||
self.useFixture(fixture)
|
self.useFixture(fixture)
|
||||||
plane_management_fixture = deployment.PlanManagementFixture()
|
|
||||||
self.useFixture(plane_management_fixture)
|
|
||||||
utils_fixture = deployment.UtilsFixture()
|
utils_fixture = deployment.UtilsFixture()
|
||||||
self.useFixture(utils_fixture)
|
self.useFixture(utils_fixture)
|
||||||
utils_overcloud_fixture = deployment.UtilsOvercloudFixture()
|
utils_overcloud_fixture = deployment.UtilsOvercloudFixture()
|
||||||
@@ -385,8 +381,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
mock_rc_params, mock_stack_data):
|
mock_rc_params, mock_stack_data):
|
||||||
fixture = deployment.DeploymentWorkflowFixture()
|
fixture = deployment.DeploymentWorkflowFixture()
|
||||||
self.useFixture(fixture)
|
self.useFixture(fixture)
|
||||||
plane_management_fixture = deployment.PlanManagementFixture()
|
|
||||||
self.useFixture(plane_management_fixture)
|
|
||||||
utils_fixture = deployment.UtilsFixture()
|
utils_fixture = deployment.UtilsFixture()
|
||||||
self.useFixture(utils_fixture)
|
self.useFixture(utils_fixture)
|
||||||
utils_overcloud_fixture = deployment.UtilsOvercloudFixture()
|
utils_overcloud_fixture = deployment.UtilsOvercloudFixture()
|
||||||
@@ -470,8 +464,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
mock_stack_data):
|
mock_stack_data):
|
||||||
fixture = deployment.DeploymentWorkflowFixture()
|
fixture = deployment.DeploymentWorkflowFixture()
|
||||||
self.useFixture(fixture)
|
self.useFixture(fixture)
|
||||||
plane_management_fixture = deployment.PlanManagementFixture()
|
|
||||||
self.useFixture(plane_management_fixture)
|
|
||||||
utils_fixture = deployment.UtilsFixture()
|
utils_fixture = deployment.UtilsFixture()
|
||||||
self.useFixture(utils_fixture)
|
self.useFixture(utils_fixture)
|
||||||
|
|
||||||
@@ -552,8 +544,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
mock_process_env, mock_rc_params):
|
mock_process_env, mock_rc_params):
|
||||||
fixture = deployment.DeploymentWorkflowFixture()
|
fixture = deployment.DeploymentWorkflowFixture()
|
||||||
self.useFixture(fixture)
|
self.useFixture(fixture)
|
||||||
plane_management_fixture = deployment.PlanManagementFixture()
|
|
||||||
self.useFixture(plane_management_fixture)
|
|
||||||
utils_overcloud_fixture = deployment.UtilsOvercloudFixture()
|
utils_overcloud_fixture = deployment.UtilsOvercloudFixture()
|
||||||
self.useFixture(utils_overcloud_fixture)
|
self.useFixture(utils_overcloud_fixture)
|
||||||
|
|
||||||
@@ -762,8 +752,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
orchestration_client = clients.orchestration
|
orchestration_client = clients.orchestration
|
||||||
mock_stack = fakes.create_tht_stack()
|
mock_stack = fakes.create_tht_stack()
|
||||||
orchestration_client.stacks.get.return_value = mock_stack
|
orchestration_client.stacks.get.return_value = mock_stack
|
||||||
plane_management_fixture = deployment.PlanManagementFixture()
|
|
||||||
self.useFixture(plane_management_fixture)
|
|
||||||
utils_fixture = deployment.UtilsOvercloudFixture()
|
utils_fixture = deployment.UtilsOvercloudFixture()
|
||||||
self.useFixture(utils_fixture)
|
self.useFixture(utils_fixture)
|
||||||
|
|
||||||
@@ -860,8 +848,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
mock_image_prepare,
|
mock_image_prepare,
|
||||||
mock_generate_password,
|
mock_generate_password,
|
||||||
mock_rc_params):
|
mock_rc_params):
|
||||||
plane_management_fixture = deployment.PlanManagementFixture()
|
|
||||||
self.useFixture(plane_management_fixture)
|
|
||||||
clients = self.app.client_manager
|
clients = self.app.client_manager
|
||||||
orchestration_client = clients.orchestration
|
orchestration_client = clients.orchestration
|
||||||
mock_stack = fakes.create_tht_stack()
|
mock_stack = fakes.create_tht_stack()
|
||||||
@@ -942,8 +928,6 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
mock_stack_data):
|
mock_stack_data):
|
||||||
fixture = deployment.DeploymentWorkflowFixture()
|
fixture = deployment.DeploymentWorkflowFixture()
|
||||||
self.useFixture(fixture)
|
self.useFixture(fixture)
|
||||||
plane_management_fixture = deployment.PlanManagementFixture()
|
|
||||||
self.useFixture(plane_management_fixture)
|
|
||||||
utils_fixture = deployment.UtilsFixture()
|
utils_fixture = deployment.UtilsFixture()
|
||||||
self.useFixture(utils_fixture)
|
self.useFixture(utils_fixture)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import fixtures
|
|
||||||
import mock
|
import mock
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@@ -149,34 +148,6 @@ class TestDeployUndercloud(TestPluginV1):
|
|||||||
networks_file = self.cmd._get_networks_file_path(parsed_args)
|
networks_file = self.cmd._get_networks_file_path(parsed_args)
|
||||||
self.assertEqual('/dev/null', networks_file)
|
self.assertEqual('/dev/null', networks_file)
|
||||||
|
|
||||||
def test_get_plan_env_file_path(self):
|
|
||||||
parsed_args = self.check_parser(self.cmd,
|
|
||||||
['--local-ip', '127.0.0.1/8'], [])
|
|
||||||
|
|
||||||
plan_env_file = self.cmd._get_plan_env_file_path(parsed_args)
|
|
||||||
self.assertEqual(plan_env_file,
|
|
||||||
'/usr/share/openstack-tripleo-heat-templates/'
|
|
||||||
'plan-environment.yaml')
|
|
||||||
|
|
||||||
def test_get_plan_env_file_path_custom_file(self):
|
|
||||||
parsed_args = self.check_parser(self.cmd,
|
|
||||||
['--local-ip', '127.0.0.1/8',
|
|
||||||
'--templates', '/tmp/thtroot',
|
|
||||||
'--plan-environment-file',
|
|
||||||
'foobar.yaml'], [])
|
|
||||||
|
|
||||||
plan_env_file = self.cmd._get_plan_env_file_path(parsed_args)
|
|
||||||
self.assertEqual(plan_env_file, 'foobar.yaml')
|
|
||||||
|
|
||||||
def test_get_plan_env_file_path_custom_templates(self):
|
|
||||||
parsed_args = self.check_parser(self.cmd,
|
|
||||||
['--local-ip', '127.0.0.1/8',
|
|
||||||
'--templates', '/tmp/thtroot'], [])
|
|
||||||
|
|
||||||
plan_env_file = self.cmd._get_plan_env_file_path(parsed_args)
|
|
||||||
self.assertEqual(plan_env_file,
|
|
||||||
'/tmp/thtroot/plan-environment.yaml')
|
|
||||||
|
|
||||||
@mock.patch('os.path.exists')
|
@mock.patch('os.path.exists')
|
||||||
@mock.patch('tripleoclient.utils.fetch_roles_file')
|
@mock.patch('tripleoclient.utils.fetch_roles_file')
|
||||||
def test_get_primary_role_name(self, mock_data, mock_exists):
|
def test_get_primary_role_name(self, mock_data, mock_exists):
|
||||||
@@ -666,83 +637,10 @@ class TestDeployUndercloud(TestPluginV1):
|
|||||||
self.assertTrue(found_dropin)
|
self.assertTrue(found_dropin)
|
||||||
self.assertTrue(found_identifier)
|
self.assertTrue(found_identifier)
|
||||||
|
|
||||||
@mock.patch('heatclient.common.template_utils.'
|
def _setup_heat_environments(self, tmpdir, tht_from,
|
||||||
'process_environment_and_files', return_value=({}, {}),
|
|
||||||
autospec=True)
|
|
||||||
@mock.patch('heatclient.common.template_utils.'
|
|
||||||
'get_template_contents', return_value=({}, {}),
|
|
||||||
autospec=True)
|
|
||||||
@mock.patch('tripleoclient.utils.'
|
|
||||||
'process_multiple_environments', autospec=True)
|
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_process_hieradata_overrides', return_value='hiera_or.yaml',
|
|
||||||
autospec=True)
|
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_update_passwords_env', autospec=True)
|
|
||||||
@mock.patch('tripleoclient.utils.'
|
|
||||||
'run_command_and_log', autospec=True)
|
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_get_primary_role_name', autospec=True)
|
|
||||||
def test_setup_heat_environments_default_plan_env(
|
|
||||||
self, mock_prim, mock_run, mock_update_pass_env,
|
|
||||||
mock_process_hiera, mock_process_multiple_environments,
|
|
||||||
mock_hc_get_templ_cont, mock_hc_process):
|
|
||||||
|
|
||||||
tmpdir = self.useFixture(fixtures.TempDir()).path
|
|
||||||
tht_from = os.path.join(tmpdir, 'tht-from')
|
|
||||||
os.mkdir(tht_from)
|
|
||||||
plan_env_path = os.path.join(tht_from, 'plan-environment.yaml')
|
|
||||||
with open(plan_env_path, mode='w') as plan_file:
|
|
||||||
yaml.dump({'environments': [{'path': 'env.yaml'}]}, plan_file)
|
|
||||||
self.assertTrue(os.path.exists(plan_env_path))
|
|
||||||
self._setup_heat_environments(tmpdir, tht_from, plan_env_path,
|
|
||||||
mock_update_pass_env, mock_run)
|
|
||||||
|
|
||||||
@mock.patch('heatclient.common.template_utils.'
|
|
||||||
'process_environment_and_files', return_value=({}, {}),
|
|
||||||
autospec=True)
|
|
||||||
@mock.patch('heatclient.common.template_utils.'
|
|
||||||
'get_template_contents', return_value=({}, {}),
|
|
||||||
autospec=True)
|
|
||||||
@mock.patch('tripleoclient.utils.'
|
|
||||||
'process_multiple_environments', autospec=True)
|
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_process_hieradata_overrides', return_value='hiera_or.yaml',
|
|
||||||
autospec=True)
|
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_update_passwords_env', autospec=True)
|
|
||||||
@mock.patch('tripleoclient.utils.'
|
|
||||||
'run_command_and_log', autospec=True)
|
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_get_primary_role_name', autospec=True)
|
|
||||||
def test_setup_heat_environments_non_default_plan_env(
|
|
||||||
self, mock_prim, mock_run, mock_update_pass_env,
|
|
||||||
mock_process_hiera, mock_process_multiple_environments,
|
|
||||||
mock_hc_get_templ_cont, mock_hc_process):
|
|
||||||
|
|
||||||
tmpdir = self.useFixture(fixtures.TempDir()).path
|
|
||||||
tht_from = os.path.join(tmpdir, 'tht-from')
|
|
||||||
os.mkdir(tht_from)
|
|
||||||
default_plan_env_path = os.path.join(tht_from, 'plan-environment.yaml')
|
|
||||||
with open(default_plan_env_path, mode='w') as plan_file:
|
|
||||||
yaml.dump({'environments': [{'path': 'env.yaml'}]}, plan_file)
|
|
||||||
plan_env_path = os.path.join(tmpdir, 'plan-environment.yaml')
|
|
||||||
with open(plan_env_path, mode='w') as plan_file:
|
|
||||||
yaml.dump({'environments': [{'path': 'notenv.yaml'}]}, plan_file)
|
|
||||||
self.assertTrue(os.path.exists(plan_env_path))
|
|
||||||
with open(os.path.join(tht_from, 'notenv.yaml'),
|
|
||||||
mode='w') as env_file:
|
|
||||||
yaml.dump({}, env_file)
|
|
||||||
cmd_extra = ['-p', plan_env_path]
|
|
||||||
self._setup_heat_environments(tmpdir, tht_from, plan_env_path,
|
|
||||||
mock_update_pass_env, mock_run,
|
|
||||||
cmd_extra, 'notenv.yaml')
|
|
||||||
|
|
||||||
def _setup_heat_environments(self, tmpdir, tht_from, plan_env_path,
|
|
||||||
mock_update_pass_env, mock_run,
|
mock_update_pass_env, mock_run,
|
||||||
extra_cmd=None, plan_env_env=None):
|
extra_cmd=None):
|
||||||
cmd_extra = extra_cmd or []
|
cmd_extra = extra_cmd or []
|
||||||
plan_env_env_name = plan_env_env or 'env.yaml'
|
|
||||||
|
|
||||||
tht_outside = os.path.join(tmpdir, 'tht-outside')
|
tht_outside = os.path.join(tmpdir, 'tht-outside')
|
||||||
os.mkdir(tht_outside)
|
os.mkdir(tht_outside)
|
||||||
@@ -764,11 +662,8 @@ class TestDeployUndercloud(TestPluginV1):
|
|||||||
mock_run.return_value = 0
|
mock_run.return_value = 0
|
||||||
original_abs = os.path.abspath
|
original_abs = os.path.abspath
|
||||||
|
|
||||||
# Stub abspath for default plan and envs to return the tht_render base
|
|
||||||
def abs_path_stub(*args, **kwargs):
|
def abs_path_stub(*args, **kwargs):
|
||||||
if 'plan-environment.yaml' in args:
|
if 'notenv.yaml' in args:
|
||||||
return plan_env_path
|
|
||||||
elif 'notenv.yaml' in args:
|
|
||||||
return os.path.join(tht_render, 'notenv.yaml')
|
return os.path.join(tht_render, 'notenv.yaml')
|
||||||
elif 'env.yaml' in args:
|
elif 'env.yaml' in args:
|
||||||
return os.path.join(tht_render, 'env.yaml')
|
return os.path.join(tht_render, 'env.yaml')
|
||||||
@@ -794,7 +689,8 @@ class TestDeployUndercloud(TestPluginV1):
|
|||||||
'outside.yaml'),
|
'outside.yaml'),
|
||||||
] + cmd_extra, [])
|
] + cmd_extra, [])
|
||||||
expected_env = [
|
expected_env = [
|
||||||
os.path.join(tht_render, plan_env_env_name),
|
os.path.join(tht_render,
|
||||||
|
'overcloud-resource-registry-puppet.yaml'),
|
||||||
os.path.join(tht_render, 'passwords.yaml'),
|
os.path.join(tht_render, 'passwords.yaml'),
|
||||||
os.path.join(tht_render,
|
os.path.join(tht_render,
|
||||||
'environments/deployed-server-noop-ctlplane.yaml'),
|
'environments/deployed-server-noop-ctlplane.yaml'),
|
||||||
@@ -914,12 +810,9 @@ class TestDeployUndercloud(TestPluginV1):
|
|||||||
@mock.patch('os.geteuid', return_value=0)
|
@mock.patch('os.geteuid', return_value=0)
|
||||||
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
||||||
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_set_default_plan')
|
|
||||||
@mock.patch('ansible_runner.utils.dump_artifact', autospec=True,
|
@mock.patch('ansible_runner.utils.dump_artifact', autospec=True,
|
||||||
return_value="/foo/inventory.yaml")
|
return_value="/foo/inventory.yaml")
|
||||||
def test_take_action_standalone(self, mock_dump_artifact,
|
def test_take_action_standalone(self, mock_dump_artifact, mock_poll,
|
||||||
mock_def_plan, mock_poll,
|
|
||||||
mock_environ, mock_geteuid, mock_puppet,
|
mock_environ, mock_geteuid, mock_puppet,
|
||||||
mock_killheat, mock_launchheat,
|
mock_killheat, mock_launchheat,
|
||||||
mock_download, mock_tht,
|
mock_download, mock_tht,
|
||||||
@@ -1012,12 +905,9 @@ class TestDeployUndercloud(TestPluginV1):
|
|||||||
@mock.patch('os.geteuid', return_value=0)
|
@mock.patch('os.geteuid', return_value=0)
|
||||||
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
||||||
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_set_default_plan')
|
|
||||||
@mock.patch('ansible_runner.utils.dump_artifact', autospec=True,
|
@mock.patch('ansible_runner.utils.dump_artifact', autospec=True,
|
||||||
return_value="/foo/inventory.yaml")
|
return_value="/foo/inventory.yaml")
|
||||||
def test_take_action_ansible_err(self, mock_dump_artifact,
|
def test_take_action_ansible_err(self, mock_dump_artifact, mock_poll,
|
||||||
mock_def_plan, mock_poll,
|
|
||||||
mock_environ, mock_geteuid, mock_puppet,
|
mock_environ, mock_geteuid, mock_puppet,
|
||||||
mock_killheat, mock_launchheat,
|
mock_killheat, mock_launchheat,
|
||||||
mock_download, mock_tht,
|
mock_download, mock_tht,
|
||||||
@@ -1099,10 +989,7 @@ class TestDeployUndercloud(TestPluginV1):
|
|||||||
@mock.patch('os.geteuid', return_value=0)
|
@mock.patch('os.geteuid', return_value=0)
|
||||||
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
||||||
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
def test_take_action_other_err(self, mock_poll,
|
||||||
'_set_default_plan')
|
|
||||||
def test_take_action_other_err(self,
|
|
||||||
mock_def_plan, mock_poll,
|
|
||||||
mock_environ, mock_geteuid, mock_puppet,
|
mock_environ, mock_geteuid, mock_puppet,
|
||||||
mock_killheat, mock_launchheat,
|
mock_killheat, mock_launchheat,
|
||||||
mock_download, mock_tht,
|
mock_download, mock_tht,
|
||||||
@@ -1259,11 +1146,8 @@ class TestDeployUndercloud(TestPluginV1):
|
|||||||
@mock.patch('os.geteuid', return_value=0)
|
@mock.patch('os.geteuid', return_value=0)
|
||||||
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
||||||
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_set_default_plan')
|
|
||||||
def test_standalone_deploy_rc_output_only(
|
def test_standalone_deploy_rc_output_only(
|
||||||
self,
|
self, mock_poll,
|
||||||
mock_def_plan, mock_poll,
|
|
||||||
mock_environ, mock_geteuid, mock_puppet,
|
mock_environ, mock_geteuid, mock_puppet,
|
||||||
mock_killheat, mock_launchheat,
|
mock_killheat, mock_launchheat,
|
||||||
mock_download, mock_tht,
|
mock_download, mock_tht,
|
||||||
@@ -1321,11 +1205,8 @@ class TestDeployUndercloud(TestPluginV1):
|
|||||||
@mock.patch('os.geteuid', return_value=0)
|
@mock.patch('os.geteuid', return_value=0)
|
||||||
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
@mock.patch('os.environ', return_value='CREATE_COMPLETE')
|
||||||
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
@mock.patch('tripleoclient.utils.wait_for_stack_ready', return_value=True)
|
||||||
@mock.patch('tripleoclient.v1.tripleo_deploy.Deploy.'
|
|
||||||
'_set_default_plan')
|
|
||||||
def test_standalone_deploy_transport(
|
def test_standalone_deploy_transport(
|
||||||
self,
|
self, mock_poll,
|
||||||
mock_def_plan, mock_poll,
|
|
||||||
mock_environ, mock_geteuid, mock_puppet,
|
mock_environ, mock_geteuid, mock_puppet,
|
||||||
mock_killheat, mock_launchheat,
|
mock_killheat, mock_launchheat,
|
||||||
mock_download, mock_tht,
|
mock_download, mock_tht,
|
||||||
|
|||||||
@@ -666,8 +666,7 @@ class DeployOvercloud(command.Command):
|
|||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--plan-environment-file', '-p',
|
'--plan-environment-file', '-p',
|
||||||
help=_('Plan Environment file, overrides the default %s in the '
|
help=_('Plan Environment file for derived parameters.')
|
||||||
'--templates directory') % constants.PLAN_ENVIRONMENT
|
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--no-cleanup', action='store_true',
|
'--no-cleanup', action='store_true',
|
||||||
|
|||||||
@@ -192,15 +192,6 @@ class Deploy(command.Command):
|
|||||||
else:
|
else:
|
||||||
return parsed_args.networks_file
|
return parsed_args.networks_file
|
||||||
|
|
||||||
def _get_plan_env_file_path(self, parsed_args):
|
|
||||||
"""Return plan_environment_file for the deployment"""
|
|
||||||
if not parsed_args.plan_environment_file:
|
|
||||||
plan_env = os.path.join(parsed_args.templates,
|
|
||||||
constants.PLAN_ENVIRONMENT)
|
|
||||||
else:
|
|
||||||
plan_env = parsed_args.plan_environment_file
|
|
||||||
return plan_env
|
|
||||||
|
|
||||||
def _get_primary_role_name(self, roles_file_path, templates):
|
def _get_primary_role_name(self, roles_file_path, templates):
|
||||||
"""Return the primary role name"""
|
"""Return the primary role name"""
|
||||||
roles_data = utils.fetch_roles_file(
|
roles_data = utils.fetch_roles_file(
|
||||||
@@ -255,13 +246,6 @@ class Deploy(command.Command):
|
|||||||
shutil.copytree(source_templates_dir, self.tht_render,
|
shutil.copytree(source_templates_dir, self.tht_render,
|
||||||
symlinks=True)
|
symlinks=True)
|
||||||
|
|
||||||
def _set_default_plan(self):
|
|
||||||
"""Populate default plan-environment.yaml."""
|
|
||||||
if not os.path.isfile(os.path.join(self.tht_render,
|
|
||||||
'plan-environment.yaml')):
|
|
||||||
shutil.copy(os.path.join(self.tht_render, 'plan-samples',
|
|
||||||
'openstack', 'plan-environment.yaml'), self.tht_render)
|
|
||||||
|
|
||||||
def _cleanup_working_dirs(self, cleanup=False, user=None):
|
def _cleanup_working_dirs(self, cleanup=False, user=None):
|
||||||
"""Cleanup temporary working directories
|
"""Cleanup temporary working directories
|
||||||
|
|
||||||
@@ -632,13 +616,8 @@ class Deploy(command.Command):
|
|||||||
# so we have to include them at the front of our environment list so a
|
# so we have to include them at the front of our environment list so a
|
||||||
# user can override anything in them.
|
# user can override anything in them.
|
||||||
|
|
||||||
# Include any environments from the plan-environment.yaml
|
environments = [os.path.join(self.tht_render,
|
||||||
plan_env_path = utils.rel_or_abs_path(
|
constants.DEFAULT_RESOURCE_REGISTRY)]
|
||||||
self._get_plan_env_file_path(parsed_args), self.tht_render)
|
|
||||||
with open(plan_env_path, 'r') as f:
|
|
||||||
plan_env_data = yaml.safe_load(f)
|
|
||||||
environments = [utils.rel_or_abs_path(e.get('path'), self.tht_render)
|
|
||||||
for e in plan_env_data.get('environments', {})]
|
|
||||||
|
|
||||||
# this will allow the user to overwrite passwords with custom envs
|
# this will allow the user to overwrite passwords with custom envs
|
||||||
# or pick instack legacy passwords as is, if upgrading from instack
|
# or pick instack legacy passwords as is, if upgrading from instack
|
||||||
@@ -965,8 +944,7 @@ class Deploy(command.Command):
|
|||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--plan-environment-file', '-p',
|
'--plan-environment-file', '-p',
|
||||||
help=_('Plan Environment file, overrides the default %s in the '
|
help=_('DEPRECATED: Plan Environment file, Not supported')
|
||||||
'--templates directory') % constants.PLAN_ENVIRONMENT
|
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--heat-api-port', metavar='<HEAT_API_PORT>',
|
'--heat-api-port', metavar='<HEAT_API_PORT>',
|
||||||
@@ -1242,9 +1220,6 @@ class Deploy(command.Command):
|
|||||||
self._populate_templates_dir(parsed_args.templates,
|
self._populate_templates_dir(parsed_args.templates,
|
||||||
parsed_args.stack.lower())
|
parsed_args.stack.lower())
|
||||||
|
|
||||||
# Set default plan if not specified by user
|
|
||||||
self._set_default_plan()
|
|
||||||
|
|
||||||
is_complete = False
|
is_complete = False
|
||||||
try:
|
try:
|
||||||
# NOTE(bogdando): Look for the unique virtual update mark matching
|
# NOTE(bogdando): Look for the unique virtual update mark matching
|
||||||
|
|||||||
Reference in New Issue
Block a user