Reviewed: https://review.openstack.org/324260 Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=41d8f25af92e100bcd20a100c8c66a6410bf6ac7 Submitter: Jenkins Branch: master
commit 41d8f25af92e100bcd20a100c8c66a6410bf6ac7 Author: liujingzte <[email protected]> Date: Thu Jun 2 15:24:44 2016 +0800 Skip the check _check_pool_loadbalancer_match in one condition In function create_listener,_check_pool_loadbalancer_match is used to make sure default_pool has the same lb_id as given. When a listener is created with default_pool_id and no lb_id, lb_id is set to default_pool.loadbalancer.id So the check _check_pool_loadbalancer_match does repeated. I want to skip this extra check in the condition that a listener is created with default_pool_id and no lb_id. Change-Id: Ie6d3d44496faf9684fc4ddb1e0c952f089d0e249 Closes-Bug: #1588118 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1588118 Title: In lbaasv2,when I create a listener,the function _check_pool_loadbalancer_match is not used at the suitable place Status in neutron: Fix Released Bug description: In lbaasv2,listener can be created with para loadbalancer and default_pool_id.the code is following: if default_pool_id: self._check_pool_exists(context, default_pool_id) # Get the loadbalancer from the default_pool_id if not lb_id: default_pool = self.db.get_pool(context, default_pool_id) lb_id = default_pool.loadbalancer.id listener['loadbalancer_id'] = lb_id elif not lb_id: raise sharedpools.ListenerMustHaveLoadbalancer() if default_pool_id and lb_id: self._check_pool_loadbalancer_match( context, default_pool_id, lb_id) function _check_pool_loadbalancer_match is used to make sure default_pool has the same lb_id as given. But if listener is created with no lb_id,lb_id is set to default_pool.loadbalancer.id. So the check _check_pool_loadbalancer_match does repeated. The following is better: if default_pool_id: self._check_pool_exists(context, default_pool_id) # Get the loadbalancer from the default_pool_id if not lb_id: default_pool = self.db.get_pool(context, default_pool_id) listener['loadbalancer_id'] = default_pool.loadbalancer.id elif not lb_id: raise sharedpools.ListenerMustHaveLoadbalancer() if default_pool_id and lb_id: self._check_pool_loadbalancer_match( context, default_pool_id, lb_id) To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1588118/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

