diff --git a/tripleoclient/tests/v1/test_container_image.py b/tripleoclient/tests/v1/test_container_image.py index c5867ea8b..543b57274 100644 --- a/tripleoclient/tests/v1/test_container_image.py +++ b/tripleoclient/tests/v1/test_container_image.py @@ -411,15 +411,13 @@ class TestTripleoImagePrepareDefault(TestPluginV1): } self.assertEqual(expected, yaml.safe_load(result)) - @mock.patch('tripleo_common.image.image_uploader.get_undercloud_registry') - def test_prepare_default_local_registry(self, mock_gur): + def test_prepare_default_local_registry(self): temp = tempfile.mkdtemp() self.addCleanup(shutil.rmtree, temp) env_file = os.path.join(temp, 'containers_env.yaml') arglist = ['--local-push-destination', '--output-env-file', env_file] verifylist = [] - mock_gur.return_value = '192.0.2.1:8787' self.app.command_options = [ 'tripleo', 'container', 'image', 'prepare', 'default' @@ -432,7 +430,7 @@ class TestTripleoImagePrepareDefault(TestPluginV1): with open(env_file) as f: result = yaml.safe_load(f) self.assertEqual( - '192.0.2.1:8787', + True, result['parameter_defaults']['ContainerImagePrepare'] [0]['push_destination'] ) diff --git a/tripleoclient/v1/container_image.py b/tripleoclient/v1/container_image.py index 57abdb741..c0005c733 100644 --- a/tripleoclient/v1/container_image.py +++ b/tripleoclient/v1/container_image.py @@ -526,9 +526,8 @@ class TripleOImagePrepareDefault(command.Command): cip = copy.deepcopy(kolla_builder.CONTAINER_IMAGE_PREPARE_PARAM) if parsed_args.push_destination: - local_registry = image_uploader.get_undercloud_registry() for entry in cip: - entry['push_destination'] = local_registry + entry['push_destination'] = True params = { 'ContainerImagePrepare': cip }