diff --git a/tripleoclient/tests/v1/undercloud/test_install_upgrade.py b/tripleoclient/tests/v1/undercloud/test_install_upgrade.py index ba862e361..adc8bbd6c 100644 --- a/tripleoclient/tests/v1/undercloud/test_install_upgrade.py +++ b/tripleoclient/tests/v1/undercloud/test_install_upgrade.py @@ -70,9 +70,9 @@ class TestUndercloudInstall(TestPluginV1): self.cmd.take_action(parsed_args) mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--heat-native', '-e', @@ -138,9 +138,9 @@ class TestUndercloudInstall(TestPluginV1): mock.call('/foo') ]) mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usertht', '--roles-file=foo/roles.yaml', @@ -290,9 +290,9 @@ class TestUndercloudInstall(TestPluginV1): self.assertTrue(found_net_conf_override) mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--heat-native', '-e', @@ -359,9 +359,9 @@ class TestUndercloudInstall(TestPluginV1): self.cmd.app_args.verbose_level = old_verbose mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--heat-native', '-e', @@ -421,9 +421,9 @@ class TestUndercloudInstall(TestPluginV1): self.cmd.take_action(parsed_args) mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--heat-native', '-e', @@ -480,9 +480,9 @@ class TestUndercloudInstall(TestPluginV1): self.cmd.take_action(parsed_args) mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--heat-native', '-e', @@ -558,9 +558,9 @@ class TestUndercloudUpgrade(TestPluginV1): self.cmd.take_action(parsed_args) mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--upgrade', '-e', @@ -620,9 +620,9 @@ class TestUndercloudUpgrade(TestPluginV1): self.cmd.take_action(parsed_args) mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--upgrade', '-e', @@ -681,9 +681,9 @@ class TestUndercloudUpgrade(TestPluginV1): self.cmd.take_action(parsed_args) mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--upgrade', '-e', @@ -742,9 +742,9 @@ class TestUndercloudUpgrade(TestPluginV1): self.cmd.take_action(parsed_args) mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '-y', '--upgrade', '-e', @@ -807,9 +807,9 @@ class TestUndercloudUpgrade(TestPluginV1): self.cmd.app_args.verbose_level = old_verbose mock_subprocess.assert_called_with( - ['sudo', 'openstack', 'tripleo', 'deploy', '--standalone', - '--standalone-role', 'Undercloud', '--stack', 'undercloud', - '--local-domain=localdomain', + ['sudo', '--preserve-env', 'openstack', 'tripleo', 'deploy', + '--standalone', '--standalone-role', 'Undercloud', '--stack', + 'undercloud', '--local-domain=localdomain', '--local-ip=192.168.24.1/24', '--templates=/usr/share/openstack-tripleo-heat-templates/', '--upgrade', '-e', diff --git a/tripleoclient/v1/undercloud_config.py b/tripleoclient/v1/undercloud_config.py index 15d105bfc..97cac58b0 100644 --- a/tripleoclient/v1/undercloud_config.py +++ b/tripleoclient/v1/undercloud_config.py @@ -673,8 +673,9 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False, if force_stack_update: deploy_args += ["--force-stack-update"] - cmd = ["sudo", "openstack", "tripleo", "deploy", "--standalone", - "--standalone-role", "Undercloud", "--stack", "undercloud"] + cmd = ["sudo", "--preserve-env", "openstack", "tripleo", "deploy", + "--standalone", "--standalone-role", "Undercloud", "--stack", + "undercloud"] cmd += deploy_args[:] # In dry-run, also report the expected heat stack virtual state/action