summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-08-11 14:41:34 +0000
committerGerrit Code Review <review@openstack.org>2018-08-11 14:41:34 +0000
commitb4b725ade9e11aff80c6193cb4acd49f2aba012d (patch)
tree8bfc44755e2fa69b38ff7ea35d8119199896b2bd
parent41f36fb9f4b09508ba0d957986cc812b22d053e8 (diff)
parent38309ca4dc79e033a7b8384f4e9f1224c5a69524 (diff)
Merge "Update metering driver to load interface driver"
-rw-r--r--neutron/services/metering/drivers/iptables/iptables_driver.py9
-rw-r--r--releasenotes/notes/metering-iptables-driver-load-interface-driver-ca397f1db40ec643.yaml7
2 files changed, 9 insertions, 7 deletions
diff --git a/neutron/services/metering/drivers/iptables/iptables_driver.py b/neutron/services/metering/drivers/iptables/iptables_driver.py
index e00d515..69c3955 100644
--- a/neutron/services/metering/drivers/iptables/iptables_driver.py
+++ b/neutron/services/metering/drivers/iptables/iptables_driver.py
@@ -15,9 +15,8 @@
15from oslo_config import cfg 15from oslo_config import cfg
16from oslo_log import helpers as log_helpers 16from oslo_log import helpers as log_helpers
17from oslo_log import log as logging 17from oslo_log import log as logging
18from oslo_utils import importutils
19 18
20from neutron._i18n import _ 19from neutron.agent.common import utils as common_utils
21from neutron.agent.l3 import dvr_snat_ns 20from neutron.agent.l3 import dvr_snat_ns
22from neutron.agent.l3 import namespaces 21from neutron.agent.l3 import namespaces
23from neutron.agent.linux import ip_lib 22from neutron.agent.linux import ip_lib
@@ -107,11 +106,7 @@ class IptablesMeteringDriver(abstract_driver.MeteringAbstractDriver):
107 self.conf = conf or cfg.CONF 106 self.conf = conf or cfg.CONF
108 self.routers = {} 107 self.routers = {}
109 108
110 if not self.conf.interface_driver: 109 self.driver = common_utils.load_interface_driver(self.conf)
111 raise SystemExit(_('An interface driver must be specified'))
112 LOG.info("Loading interface driver %s", self.conf.interface_driver)
113 self.driver = importutils.import_object(self.conf.interface_driver,
114 self.conf)
115 110
116 def _update_router(self, router): 111 def _update_router(self, router):
117 r = self.routers.get(router['id'], 112 r = self.routers.get(router['id'],
diff --git a/releasenotes/notes/metering-iptables-driver-load-interface-driver-ca397f1db40ec643.yaml b/releasenotes/notes/metering-iptables-driver-load-interface-driver-ca397f1db40ec643.yaml
new file mode 100644
index 0000000..997b232
--- /dev/null
+++ b/releasenotes/notes/metering-iptables-driver-load-interface-driver-ca397f1db40ec643.yaml
@@ -0,0 +1,7 @@
1---
2other:
3 - |
4 The metering agent iptables driver can now load its interface driver by
5 using a stevedore alias in the ``metering_agent.ini`` file. For example,
6 ``interface_driver = openvswitch`` instead of
7 ``interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver``