summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-09-01 21:06:22 +0000
committerTarmac <>2011-09-01 21:06:22 +0000
commitce6f55b4bd889d9e873598bb23ed37327d75252e (patch)
treeff1d1f4d9b5e6ad854c33c081553e8799c2c55ea /nova/api
parentdbd5acd2ba6bc9853f165d457eaf6abe7559a92e (diff)
parent59be9be68c0fd9b33b72257b8a1eb8c357ce9217 (diff)
downloadnova-ce6f55b4bd889d9e873598bb23ed37327d75252e.tar.gz
nova-ce6f55b4bd889d9e873598bb23ed37327d75252e.tar.xz
nova-ce6f55b4bd889d9e873598bb23ed37327d75252e.zip
Fix a few references to state_description that slipped through.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/admin.py5
-rw-r--r--nova/api/openstack/contrib/simple_tenant_usage.py2
2 files changed, 3 insertions, 4 deletions
diff --git a/nova/api/ec2/admin.py b/nova/api/ec2/admin.py
index dfbbc0a2b..75e029509 100644
--- a/nova/api/ec2/admin.py
+++ b/nova/api/ec2/admin.py
@@ -21,7 +21,6 @@ Admin API controller, exposed through http via the api worker.
"""
import base64
-import datetime
import netaddr
import urllib
@@ -33,6 +32,7 @@ from nova import log as logging
from nova import utils
from nova.api.ec2 import ec2utils
from nova.auth import manager
+from nova.compute import vm_states
FLAGS = flags.FLAGS
@@ -273,8 +273,7 @@ class AdminController(object):
"""Get the VPN instance for a project ID."""
for instance in db.instance_get_all_by_project(context, project_id):
if (instance['image_id'] == str(FLAGS.vpn_image_id)
- and not instance['state_description'] in
- ['shutting_down', 'shutdown']):
+ and not instance['vm_state'] in [vm_states.DELETED]):
return instance
def start_vpn(self, context, project):
diff --git a/nova/api/openstack/contrib/simple_tenant_usage.py b/nova/api/openstack/contrib/simple_tenant_usage.py
index 69b38e229..42691a9fa 100644
--- a/nova/api/openstack/contrib/simple_tenant_usage.py
+++ b/nova/api/openstack/contrib/simple_tenant_usage.py
@@ -116,7 +116,7 @@ class SimpleTenantUsageController(object):
if info['ended_at']:
info['state'] = 'terminated'
else:
- info['state'] = instance['state_description']
+ info['state'] = instance['vm_state']
now = datetime.utcnow()