Remove use of fake_rabbit in Nova

The fake_rabbit config option enables the memory transport for kombu.

We use the fake RPC backend for all of our unit testing. As best I can
tell, fake_rabbit harks back to a time when it was used for unit
testing.

The code in nova-dhcpbridge is the only place we explicitly do anything
different for this case - i.e. we directly call out to the network
manager to manage the IP address leases.

When we move to oslo.messaging, we can't rely on this config option
because it could be renamed in future. It's hard to imagine a more
generic "is the transport going to actually send a message to a remote
server" API in oslo.messaging.

I don't think anyone uses fake_rabbit anymore. I just don't see how it
can be useful to anyone. We should just remove it rather than putting in
a bunch of work to retain it with oslo.messaging.

blueprint: oslo-messaging
Change-Id: I3a8f8a9d3cb6cc6f431d48b4222bde31da767559
This commit is contained in:
Mark McLoughlin 2013-08-13 11:28:40 +01:00
parent 5422115924
commit 216fcb90e8
2 changed files with 5 additions and 18 deletions

View File

@ -45,14 +45,8 @@ LOG = logging.getLogger(__name__)
def add_lease(mac, ip_address):
"""Set the IP that was assigned by the DHCP server."""
if CONF.fake_rabbit:
LOG.debug(_("leasing ip"))
network_manager = importutils.import_object(CONF.network_manager)
network_manager.lease_fixed_ip(context.get_admin_context(),
ip_address)
else:
api = network_rpcapi.NetworkAPI()
api.lease_fixed_ip(context.get_admin_context(), ip_address, CONF.host)
api = network_rpcapi.NetworkAPI()
api.lease_fixed_ip(context.get_admin_context(), ip_address, CONF.host)
def old_lease(mac, ip_address):
@ -65,15 +59,9 @@ def old_lease(mac, ip_address):
def del_lease(mac, ip_address):
"""Called when a lease expires."""
if CONF.fake_rabbit:
LOG.debug(_("releasing ip"))
network_manager = importutils.import_object(CONF.network_manager)
network_manager.release_fixed_ip(context.get_admin_context(),
ip_address)
else:
api = network_rpcapi.NetworkAPI()
api.release_fixed_ip(context.get_admin_context(), ip_address,
CONF.host)
api = network_rpcapi.NetworkAPI()
api.release_fixed_ip(context.get_admin_context(), ip_address,
CONF.host)
def init_leases(network_id):

View File

@ -52,7 +52,6 @@ class ConfFixture(fixtures.Fixture):
self.conf.set_default('host', 'fake-mini')
self.conf.set_default('compute_driver', 'nova.virt.fake.FakeDriver')
self.conf.set_default('fake_network', True)
self.conf.set_default('fake_rabbit', True)
self.conf.set_default('flat_network_bridge', 'br100')
self.conf.set_default('floating_ip_dns_manager',
'nova.tests.utils.dns_manager')