Browse Source

Merge "Update metering driver to load interface driver"

tags/14.0.0.0b1
Zuul 9 months ago
parent
commit
b4b725ade9

+ 2
- 7
neutron/services/metering/drivers/iptables/iptables_driver.py View File

@@ -15,9 +15,8 @@
15 15
 from oslo_config import cfg
16 16
 from oslo_log import helpers as log_helpers
17 17
 from oslo_log import log as logging
18
-from oslo_utils import importutils
19 18
 
20
-from neutron._i18n import _
19
+from neutron.agent.common import utils as common_utils
21 20
 from neutron.agent.l3 import dvr_snat_ns
22 21
 from neutron.agent.l3 import namespaces
23 22
 from neutron.agent.linux import ip_lib
@@ -107,11 +106,7 @@ class IptablesMeteringDriver(abstract_driver.MeteringAbstractDriver):
107 106
         self.conf = conf or cfg.CONF
108 107
         self.routers = {}
109 108
 
110
-        if not self.conf.interface_driver:
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)
109
+        self.driver = common_utils.load_interface_driver(self.conf)
115 110
 
116 111
     def _update_router(self, router):
117 112
         r = self.routers.get(router['id'],

+ 7
- 0
releasenotes/notes/metering-iptables-driver-load-interface-driver-ca397f1db40ec643.yaml View File

@@ -0,0 +1,7 @@
1
+---
2
+other:
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``

Loading…
Cancel
Save