please add a 'region_name' configuration in kuryr/lib/config

Bug #1831684 reported by XuShimin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr
Fix Released
Undecided
Unassigned

Bug Description

In kuryr/kuryr/lib/utils.py, the neutronclient function is as follows:

   def get_neutron_client(*args, **kwargs):
       conf_group = kuryr_config.neutron_group.name
       auth_plugin = get_auth_plugin(conf_group)
       session = get_keystone_session(conf_group, auth_plugin)
       endpoint_type = getattr(getattr(cfg.CONF, conf_group), 'endpoint_type')

       return client.Client(session=session,
                            auth=auth_plugin,
                            endpoint_type=endpoint_type)

However, in multi-region scenario (For example, Tricircle scenario), some users need to specify which region's neutronclient api to call, so that they can implement their own neutron network function.

So, I think you can add 'region_name' configuration in neutronclient function. Maybe like this:

    def get_neutron_client(*args, **kwargs):
        conf_group = kuryr_config.neutron_group.name
        auth_plugin = get_auth_plugin(conf_group)
        session = get_keystone_session(conf_group, auth_plugin)
        endpoint_type = getattr(getattr(cfg.CONF, conf_group), 'endpoint_type')

#++# region_name = getattr(getattr(cfg.CONF, conf_group), 'region_name')

#**# return client.Client(session=session,
                             auth=auth_plugin,
                             endpoint_type=endpoint_type,
                             region_name=region_name)

Meanwhile, register 'region_name' option in kuryr conf.

Revision history for this message
XuShimin (xushimin19921123) wrote :

Some users need to specify 'region_name' or 'endpoint' option rather than by default.

Changed in kuryr:
status: New → Confirmed
Revision history for this message
ZhangChi (chzhang8) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kuryr (master)

Reviewed: https://review.opendev.org/678707
Committed: https://git.openstack.org/cgit/openstack/kuryr/commit/?id=50da6c1b30cb747a64602924d3d139185c92ff95
Submitter: Zuul
Branch: master

commit 50da6c1b30cb747a64602924d3d139185c92ff95
Author: zhangchi <email address hidden>
Date: Tue Aug 27 09:25:54 2019 +0800

    add region_name in get neutron client to support multi-region scene

    kuryr should support neutron client in multi-region scene as follows:

    https://bugs.launchpad.net/kuryr/+bug/1831684

    Closes-Bug: 1831684

    Change-Id: I91315885a56c5cfb313b73b1eddc3935bc200c6c

Changed in kuryr:
status: Confirmed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kuryr 1.1.0

This issue was fixed in the openstack/kuryr 1.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.