]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add endpoint_type parameter to MetaInterfaceDriver
authorItsuro Oda <oda@valinux.co.jp>
Tue, 12 Aug 2014 00:10:25 +0000 (09:10 +0900)
committerItsuro Oda <oda@valinux.co.jp>
Mon, 1 Sep 2014 04:11:50 +0000 (13:11 +0900)
Previously MetaInterfaceDriver communicates with neutron-server
via 'publicURL' because it uses python-neutronclient without
endpoint_type and 'publicURL' is the default.
It causes error when a user intends to use internal or admin URL
for communication between MetaInterfaceDriver and neutron-server.

Change-Id: Id321d5a16a08a4bda618f98bb1eb7cb1b0b9eb08
Closes-bug: #1354285

neutron/agent/linux/interface.py
neutron/tests/unit/test_linux_interface.py

index c6677c1141b17078668919c05cb95c7217558967..77b8365c4b38cf9ee42d08930efa0e6ebf921272 100644 (file)
@@ -41,7 +41,11 @@ OPTS = [
     cfg.IntOpt('network_device_mtu',
                help=_('MTU setting for device.')),
     cfg.StrOpt('meta_flavor_driver_mappings',
-               help=_('Mapping between flavor and LinuxInterfaceDriver')),
+               help=_('Mapping between flavor and LinuxInterfaceDriver. '
+                      'It is specific to MetaInterfaceDriver used with '
+                      'admin_user, admin_password, admin_tenant_name, '
+                      'admin_url, auth_strategy, auth_region and '
+                      'endpoint_type.')),
     cfg.StrOpt('admin_user',
                help=_("Admin username")),
     cfg.StrOpt('admin_password',
@@ -55,6 +59,10 @@ OPTS = [
                help=_("The type of authentication to use")),
     cfg.StrOpt('auth_region',
                help=_("Authentication region")),
+    cfg.StrOpt('endpoint_type',
+               default='publicURL',
+               help=_("Network service endpoint type to pull from "
+                      "the keystone catalog")),
 ]
 
 
@@ -399,7 +407,8 @@ class MetaInterfaceDriver(LinuxInterfaceDriver):
             tenant_name=self.conf.admin_tenant_name,
             auth_url=self.conf.auth_url,
             auth_strategy=self.conf.auth_strategy,
-            region_name=self.conf.auth_region
+            region_name=self.conf.auth_region,
+            endpoint_type=self.conf.endpoint_type
         )
         self.flavor_driver_map = {}
         for net_flavor, driver_name in [
index 809216e6a5380a6cc9930246c3aa8b0b7c6fecea..568527880a92f9a4468178b2a5df7d3eb260e46c 100644 (file)
@@ -449,6 +449,7 @@ class TestMetaInterfaceDriver(TestBase):
             'meta_flavor_driver_mappings',
             'fake1:neutron.agent.linux.interface.OVSInterfaceDriver,'
             'fake2:neutron.agent.linux.interface.BridgeInterfaceDriver')
+        self.conf.set_override('endpoint_type', 'internalURL')
 
     def test_get_driver_by_network_id(self):
         meta_interface = interface.MetaInterfaceDriver(self.conf)