Consistently use REBUILDING vm_state

There is both a vm_state and task_state called REBUILDING, which was
used inconsistently. This resulted in a rebuild action returning
"ACTIVE" for the status instead of "REBUILD" like the API
documentation states.

This change drops the task_state in favor of making all of the code
use vm_state

Change-Id: I56b4b6fd4d02b75c6270fc91cdec1902e7794cf1
This commit is contained in:
Johannes Erdfelt 2011-12-20 18:49:47 +00:00
parent 536c6133a3
commit 5895a74c8b
3 changed files with 3 additions and 5 deletions

View File

@ -1210,8 +1210,8 @@ class API(base.Base):
metadata=metadata,
display_name=name,
image_ref=image_href,
vm_state=vm_states.ACTIVE,
task_state=task_states.REBUILDING,
vm_state=vm_states.REBUILDING,
task_state=None,
progress=0)
rebuild_params = {

View File

@ -43,8 +43,6 @@ RESIZE_REVERTING = 'resize_reverting'
RESIZE_CONFIRMING = 'resize_confirming'
RESIZE_VERIFY = 'resize_verify'
REBUILDING = 'rebuilding'
REBOOTING = 'rebooting'
REBOOTING_HARD = 'rebooting_hard'
PAUSING = 'pausing'

View File

@ -1600,7 +1600,7 @@ class ComputeAPITestCase(BaseTestCase):
self.compute_api.rebuild(self.context, instance, image_ref, password)
instance = db.instance_get_by_uuid(self.context, instance_uuid)
self.assertEqual(instance['task_state'], task_states.REBUILDING)
self.assertEqual(instance['vm_state'], vm_states.REBUILDING)
db.instance_destroy(self.context, instance_uuid)