~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to nova/tests/vmwareapi/db_fakes.py

  • Committer: Tarmac
  • Author(s): Brian Lamar, Dan Prince
  • Date: 2011-08-31 22:55:34 UTC
  • mfrom: (1443.3.61 instance_states)
  • Revision ID: tarmac-20110831225534-upfhtsvcsafyql6x
Fixed and improved the way instance "states" are set. Instead of relying on solely the power_state of a VM, there are now explicitly defined VM states and VM task states which respectively define the current state of the VM and the task which is currently being performed by the VM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from nova import db
25
25
from nova import utils
 
26
from nova.compute import task_states
 
27
from nova.compute import vm_states
26
28
 
27
29
 
28
30
def stub_out_db_instance_api(stubs):
64
66
            'image_ref': values['image_ref'],
65
67
            'kernel_id': values['kernel_id'],
66
68
            'ramdisk_id': values['ramdisk_id'],
67
 
            'state_description': 'scheduling',
 
69
            'vm_state': vm_states.BUILDING,
 
70
            'task_state': task_states.SCHEDULING,
68
71
            'user_id': values['user_id'],
69
72
            'project_id': values['project_id'],
70
73
            'launch_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()),