From 8db54f3bd590e71c6c6e383c928aa82fc28b3379 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Tue, 29 May 2012 16:04:16 -0400 Subject: Don't query nova-network on startup. Fix bug 999698. nova-compute requested network info for each instance on startup via rpc. If all services get (re)started at the same time, nova-network may not be available to take this request, resulting in a lost request. To combat this issue, get the network info from the cache in the database on startup. If by some chance this information is not correct, it will get fixed up by a periodic task. Change-Id: I0bbd475e078ac2a67c99c2be4711e86d617c609a --- nova/tests/api/openstack/compute/contrib/test_cloudpipe.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/api/openstack/compute/contrib/test_cloudpipe.py b/nova/tests/api/openstack/compute/contrib/test_cloudpipe.py index f6e1fbcb6..c082e315f 100644 --- a/nova/tests/api/openstack/compute/contrib/test_cloudpipe.py +++ b/nova/tests/api/openstack/compute/contrib/test_cloudpipe.py @@ -15,9 +15,9 @@ from lxml import etree -from nova.api.openstack import common from nova.api.openstack.compute.contrib import cloudpipe from nova.api.openstack import wsgi +from nova.compute import utils as compute_utils from nova import db from nova import flags from nova import test @@ -65,11 +65,11 @@ class CloudpipeTest(test.TestCase): def test_cloudpipe_list_no_network(self): - def common_get_nw_info_for_instance(context, instance): + def fake_get_nw_info_for_instance(instance): return {} - self.stubs.Set(common, "get_nw_info_for_instance", - common_get_nw_info_for_instance) + self.stubs.Set(compute_utils, "get_nw_info_for_instance", + fake_get_nw_info_for_instance) self.stubs.Set(self.controller.compute_api, "get_all", compute_api_get_all) req = fakes.HTTPRequest.blank('/v2/fake/os-cloudpipe') @@ -86,12 +86,12 @@ class CloudpipeTest(test.TestCase): return {'vpn_public_address': '127.0.0.1', 'vpn_public_port': 22} - def common_get_nw_info_for_instance(context, instance): + def fake_get_nw_info_for_instance(instance): return fake_network.fake_get_instance_nw_info(self.stubs, spectacular=True) - self.stubs.Set(common, "get_nw_info_for_instance", - common_get_nw_info_for_instance) + self.stubs.Set(compute_utils, "get_nw_info_for_instance", + fake_get_nw_info_for_instance) self.stubs.Set(self.controller.network_api, "get", network_api_get) self.stubs.Set(self.controller.compute_api, "get_all", -- cgit