Merge "Prepare defaults, defer detecting undercloud registry"

This commit is contained in:
Zuul 2018-07-31 07:21:14 +00:00 committed by Gerrit Code Review
commit c5a8dbf267
2 changed files with 3 additions and 6 deletions

View File

@ -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']
)

View File

@ -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
}