Merge "Prepare defaults, defer detecting undercloud registry"
This commit is contained in:
commit
c5a8dbf267
@ -411,15 +411,13 @@ class TestTripleoImagePrepareDefault(TestPluginV1):
|
|||||||
}
|
}
|
||||||
self.assertEqual(expected, yaml.safe_load(result))
|
self.assertEqual(expected, yaml.safe_load(result))
|
||||||
|
|
||||||
@mock.patch('tripleo_common.image.image_uploader.get_undercloud_registry')
|
def test_prepare_default_local_registry(self):
|
||||||
def test_prepare_default_local_registry(self, mock_gur):
|
|
||||||
temp = tempfile.mkdtemp()
|
temp = tempfile.mkdtemp()
|
||||||
self.addCleanup(shutil.rmtree, temp)
|
self.addCleanup(shutil.rmtree, temp)
|
||||||
env_file = os.path.join(temp, 'containers_env.yaml')
|
env_file = os.path.join(temp, 'containers_env.yaml')
|
||||||
|
|
||||||
arglist = ['--local-push-destination', '--output-env-file', env_file]
|
arglist = ['--local-push-destination', '--output-env-file', env_file]
|
||||||
verifylist = []
|
verifylist = []
|
||||||
mock_gur.return_value = '192.0.2.1:8787'
|
|
||||||
|
|
||||||
self.app.command_options = [
|
self.app.command_options = [
|
||||||
'tripleo', 'container', 'image', 'prepare', 'default'
|
'tripleo', 'container', 'image', 'prepare', 'default'
|
||||||
@ -432,7 +430,7 @@ class TestTripleoImagePrepareDefault(TestPluginV1):
|
|||||||
with open(env_file) as f:
|
with open(env_file) as f:
|
||||||
result = yaml.safe_load(f)
|
result = yaml.safe_load(f)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
'192.0.2.1:8787',
|
True,
|
||||||
result['parameter_defaults']['ContainerImagePrepare']
|
result['parameter_defaults']['ContainerImagePrepare']
|
||||||
[0]['push_destination']
|
[0]['push_destination']
|
||||||
)
|
)
|
||||||
|
@ -526,9 +526,8 @@ class TripleOImagePrepareDefault(command.Command):
|
|||||||
|
|
||||||
cip = copy.deepcopy(kolla_builder.CONTAINER_IMAGE_PREPARE_PARAM)
|
cip = copy.deepcopy(kolla_builder.CONTAINER_IMAGE_PREPARE_PARAM)
|
||||||
if parsed_args.push_destination:
|
if parsed_args.push_destination:
|
||||||
local_registry = image_uploader.get_undercloud_registry()
|
|
||||||
for entry in cip:
|
for entry in cip:
|
||||||
entry['push_destination'] = local_registry
|
entry['push_destination'] = True
|
||||||
params = {
|
params = {
|
||||||
'ContainerImagePrepare': cip
|
'ContainerImagePrepare': cip
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user