Merge "Add UNKNOWN constant to container statuses"

This commit is contained in:
Jenkins 2015-08-29 00:06:00 +00:00 committed by Gerrit Code Review
commit 99f6ecf93c
3 changed files with 3 additions and 2 deletions

View File

@ -291,7 +291,7 @@ class ContainersController(rest.RestController):
LOG.exception(_LE("Error while list container %(uuid)s: " LOG.exception(_LE("Error while list container %(uuid)s: "
"%(e)s."), "%(e)s."),
{'uuid': c.uuid, 'e': e}) {'uuid': c.uuid, 'e': e})
containers[i].status = 'Unknown' containers[i].status = objects.container.UNKNOWN
return ContainerCollection.convert_with_links(containers, limit, return ContainerCollection.convert_with_links(containers, limit,
url=resource_url, url=resource_url,

View File

@ -24,6 +24,7 @@ ERROR = 'Error'
RUNNING = 'Running' RUNNING = 'Running'
STOPPED = 'Stopped' STOPPED = 'Stopped'
PAUSED = 'Paused' PAUSED = 'Paused'
UNKNOWN = 'Unknown'
@base.MagnumObjectRegistry.register @base.MagnumObjectRegistry.register

View File

@ -253,7 +253,7 @@ class TestContainerController(api_base.FunctionalTest):
test_container['uuid']) test_container['uuid'])
self.assertEqual(actual_containers[0].get('status'), self.assertEqual(actual_containers[0].get('status'),
'Unknown') objects.container.UNKNOWN)
@patch('magnum.conductor.api.API.container_show') @patch('magnum.conductor.api.API.container_show')
@patch('magnum.objects.Container.get_by_uuid') @patch('magnum.objects.Container.get_by_uuid')