Merge "Expose 'host' field via image API"

This commit is contained in:
Zuul 2018-10-22 04:32:32 +00:00 committed by Gerrit Code Review
commit 697ec79b5a
2 changed files with 6 additions and 1 deletions

View File

@ -23,7 +23,8 @@ _basic_keys = (
'tag',
'size',
'project_id',
'image_pull_policy'
'image_pull_policy',
'host'
)

View File

@ -125,6 +125,8 @@ class TestImageController(api_base.FunctionalTest):
self.assertEqual(1, len(actual_images))
self.assertEqual(test_image['uuid'],
actual_images[0].get('uuid'))
self.assertEqual(test_image['host'],
actual_images[0].get('host'))
@patch('zun.common.policy.enforce')
@patch('zun.objects.Image.get_by_uuid')
@ -141,6 +143,8 @@ class TestImageController(api_base.FunctionalTest):
self.assertEqual(200, response.status_int)
self.assertEqual(test_image['uuid'],
response.json['uuid'])
self.assertEqual(test_image['host'],
response.json['host'])
@mock.patch('zun.common.policy.enforce', return_value=True)
@patch('zun.objects.Image.list')