From f1451da5447a9af97cf6a7bbcd608195883de014 Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Thu, 28 Jun 2012 20:56:13 +0000 Subject: OS API should return SHUTOFF, not STOPPED The recent changes to vm_state/task_state changed the behavior of OS API to return STOPPED instead of SHUTOFF. Fixes bug 1019016 The API spec says that SHUTOFF should be returned: http://docs.openstack.org/api/openstack-compute/2/content/List_Servers-d1e2078.html Change-Id: I0a6c786dc8d6b8b42f462cfbec5b70cb67aa2385 --- nova/api/openstack/common.py | 2 +- nova/tests/api/openstack/compute/test_servers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/api/openstack/common.py b/nova/api/openstack/common.py index eacd9b8cb..0010ca61a 100644 --- a/nova/api/openstack/common.py +++ b/nova/api/openstack/common.py @@ -61,7 +61,7 @@ _STATE_MAP = { 'default': 'BUILD', }, vm_states.STOPPED: { - 'default': 'STOPPED', + 'default': 'SHUTOFF', }, vm_states.RESIZED: { 'default': 'VERIFY_RESIZE', diff --git a/nova/tests/api/openstack/compute/test_servers.py b/nova/tests/api/openstack/compute/test_servers.py index 91a3ef68d..ca5efe6c3 100644 --- a/nova/tests/api/openstack/compute/test_servers.py +++ b/nova/tests/api/openstack/compute/test_servers.py @@ -1404,7 +1404,7 @@ class ServerStatusTest(test.TestCase): def test_stopped(self): response = self._get_with_state(vm_states.STOPPED) - self.assertEqual(response['server']['status'], 'STOPPED') + self.assertEqual(response['server']['status'], 'SHUTOFF') class ServersControllerCreateTest(test.TestCase): -- cgit