summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/api/openstack/compute/test_server_actions.py2
-rw-r--r--nova/tests/api/openstack/compute/test_servers.py5
-rw-r--r--nova/tests/test_compute.py5
3 files changed, 6 insertions, 6 deletions
diff --git a/nova/tests/api/openstack/compute/test_server_actions.py b/nova/tests/api/openstack/compute/test_server_actions.py
index a0c4c390e..08612adb1 100644
--- a/nova/tests/api/openstack/compute/test_server_actions.py
+++ b/nova/tests/api/openstack/compute/test_server_actions.py
@@ -102,7 +102,7 @@ def stub_instance(id, metadata=None, image_ref="10", flavor_id="1",
"vcpus": 0,
"local_gb": 0,
"hostname": "",
- "host": "",
+ "host": "fake_host",
"instance_type": dict(inst_type),
"user_data": "",
"reservation_id": "",
diff --git a/nova/tests/api/openstack/compute/test_servers.py b/nova/tests/api/openstack/compute/test_servers.py
index 0fafa1e77..f545aeaec 100644
--- a/nova/tests/api/openstack/compute/test_servers.py
+++ b/nova/tests/api/openstack/compute/test_servers.py
@@ -150,10 +150,6 @@ def fake_compute_api(cls, req, id):
return True
-def find_host(self, context, instance_id):
- return "nova"
-
-
class MockSetAdminPassword(object):
def __init__(self):
self.instance_id = None
@@ -1564,7 +1560,6 @@ class ServersControllerCreateTest(test.TestCase):
self.stubs.Set(nova.db, 'queue_get_for', queue_get_for)
self.stubs.Set(nova.network.manager.VlanManager, 'allocate_fixed_ip',
fake_method)
- self.stubs.Set(nova.compute.api.API, "_find_host", find_host)
def _test_create_instance(self):
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
index 88d4bf54b..44707fe33 100644
--- a/nova/tests/test_compute.py
+++ b/nova/tests/test_compute.py
@@ -147,6 +147,7 @@ class BaseTestCase(test.TestCase):
inst['launch_time'] = '10'
inst['user_id'] = self.user_id
inst['project_id'] = self.project_id
+ inst['host'] = 'fake_host'
type_id = instance_types.get_instance_type_by_name(type_name)['id']
inst['instance_type_id'] = type_id
inst['ami_launch_index'] = 0
@@ -3024,6 +3025,10 @@ class ComputePolicyTestCase(BaseTestCase):
def test_wrapped_method(self):
instance = self._create_fake_instance()
+ # Reset this to None for this policy check. If it's set, it
+ # tries to do a compute_api.update() and we're not testing for
+ # that here.
+ instance['host'] = None
self.compute.run_instance(self.context, instance['uuid'])
# force delete to fail