Merge "Add UNKNOWN constant to container statuses"
This commit is contained in:
commit
99f6ecf93c
@ -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,
|
||||||
|
@ -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
|
||||||
|
@ -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')
|
||||||
|
Loading…
Reference in New Issue
Block a user