summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEwan Mellor <ewan.mellor@citrix.com>2010-09-05 05:56:53 +0100
committerEwan Mellor <ewan.mellor@citrix.com>2010-09-05 05:56:53 +0100
commitb049c032a9f950d67bbfe709802288a7fe28bdd6 (patch)
tree25ea29e2f0b718f91357a676edbab9c0e9df8119
parentf62e2a6aafc1a3895238adce003926cca4bd3cd8 (diff)
downloadnova-b049c032a9f950d67bbfe709802288a7fe28bdd6.tar.gz
nova-b049c032a9f950d67bbfe709802288a7fe28bdd6.tar.xz
nova-b049c032a9f950d67bbfe709802288a7fe28bdd6.zip
Bug #630640: Duplicated power state constants
Remove power state constants that have ended up duplicated following a bad merge. They were moved from nova.compute.node.Instance into nova.compute.power_state at the same time that Instance was moved into nova.compute.service. We've ended up with these constants in both places. Remove the ones from service, in favour of the ones in power_state.
-rw-r--r--nova/compute/service.py8
-rw-r--r--nova/tests/cloud_unittest.py3
2 files changed, 2 insertions, 9 deletions
diff --git a/nova/compute/service.py b/nova/compute/service.py
index e59f3fb34..3321c2c00 100644
--- a/nova/compute/service.py
+++ b/nova/compute/service.py
@@ -224,14 +224,6 @@ class ProductCode(object):
class Instance(object):
- NOSTATE = 0x00
- RUNNING = 0x01
- BLOCKED = 0x02
- PAUSED = 0x03
- SHUTDOWN = 0x04
- SHUTOFF = 0x05
- CRASHED = 0x06
-
def __init__(self, conn, name, data):
""" spawn an instance with a given name """
self._conn = conn
diff --git a/nova/tests/cloud_unittest.py b/nova/tests/cloud_unittest.py
index 900ff5a97..19aa23b9e 100644
--- a/nova/tests/cloud_unittest.py
+++ b/nova/tests/cloud_unittest.py
@@ -28,6 +28,7 @@ from nova import flags
from nova import rpc
from nova import test
from nova.auth import manager
+from nova.compute import power_state
from nova.compute import service
from nova.endpoint import api
from nova.endpoint import cloud
@@ -95,7 +96,7 @@ class CloudTestCase(test.BaseTestCase):
rv = yield defer.succeed(time.sleep(1))
info = self.cloud._get_instance(instance['instance_id'])
logging.debug(info['state'])
- if info['state'] == node.Instance.RUNNING:
+ if info['state'] == power_state.RUNNING:
break
self.assert_(rv)