summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-02-09 10:08:15 +0000
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>2011-02-09 10:08:15 +0000
commitf6ec9568561dd430bd772f171f5bbddd0bd038c6 (patch)
tree6d26be2028c8d958c30b6df227c579910bd120ed /nova/compute
parent653ff11692fa5cd5ec5f9ea75cddc03df1b3dcd5 (diff)
downloadnova-f6ec9568561dd430bd772f171f5bbddd0bd038c6.tar.gz
nova-f6ec9568561dd430bd772f171f5bbddd0bd038c6.tar.xz
nova-f6ec9568561dd430bd772f171f5bbddd0bd038c6.zip
Added test case for 'not enough memory'
Successfully ran unit tests Fixed pep8 errors
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py2
-rw-r--r--nova/compute/power_state.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index f4418af26..bb999931c 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -127,7 +127,7 @@ class ComputeManager(manager.Manager):
info = self.driver.get_info(instance_ref['name'])
state = info['state']
except exception.NotFound:
- state = power_state.NOSTATE
+ state = power_state.FAILED
self.db.instance_set_state(context, instance_id, state)
def get_console_topic(self, context, **_kwargs):
diff --git a/nova/compute/power_state.py b/nova/compute/power_state.py
index 37039d2ec..adfc2dff0 100644
--- a/nova/compute/power_state.py
+++ b/nova/compute/power_state.py
@@ -27,6 +27,7 @@ SHUTDOWN = 0x04
SHUTOFF = 0x05
CRASHED = 0x06
SUSPENDED = 0x07
+FAILED = 0x08
def name(code):
@@ -38,5 +39,6 @@ def name(code):
SHUTDOWN: 'shutdown',
SHUTOFF: 'shutdown',
CRASHED: 'crashed',
- SUSPENDED: 'suspended'}
+ SUSPENDED: 'suspended',
+ FAILED: 'failed to spawn'}
return d[code]