VPNService takes names of device drivers from self.conf

Change-Id: Ib55b3c28d8a4bc7772e80e1b3bebe6a594e30a2c
Closes-Bug: #1443967
This commit is contained in:
nfedotov 2015-04-14 16:54:49 +03:00
parent 7accc39c9c
commit 84dc518b64
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,6 @@ from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.services import provider_configuration as provconfig
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
@ -46,7 +45,7 @@ class VPNService(object):
def load_device_drivers(self, host):
"""Loads one or more device drivers for VPNaaS."""
drivers = []
for device_driver in cfg.CONF.vpnagent.vpn_device_driver:
for device_driver in self.conf.vpnagent.vpn_device_driver:
device_driver = provconfig.get_provider_driver_class(
device_driver, DEVICE_DRIVERS)
try:

View File

@ -63,6 +63,7 @@ class TestVirtualPrivateNetworkDeviceDriverLoading(VPNBaseTestCase):
super(TestVirtualPrivateNetworkDeviceDriverLoading, self).setUp()
cfg.CONF.register_opts(vpn_agent.vpn_agent_opts, 'vpnagent')
self.agent = mock.Mock()
self.agent.conf = cfg.CONF
mock.patch.object(registry, 'subscribe').start()
self.service = vpn_service.VPNService(self.agent)