Merge "Revert "Updated "create_pool" method in plugin""

This commit is contained in:
Zuul 2019-02-28 22:46:29 +00:00 committed by Gerrit Code Review
commit 5617616416
2 changed files with 5 additions and 5 deletions

View File

@ -671,8 +671,8 @@ class LoadBalancerPluginDbv2(agent_scheduler.LbaasAgentSchedulerDbMixin):
pool_db.session_persistence = s_p
context.session.add(pool_db)
context.session.flush()
return data_models.Pool.from_sqlalchemy_model(pool_db)
context.session.refresh(pool_db.loadbalancer)
return self.get_pool(context, pool_db.id)
def update_pool(self, context, id, pool):
with context.session.begin(subtransactions=True):

View File

@ -710,9 +710,9 @@ class LoadBalancerPluginv2(loadbalancerv2.LoadBalancerPluginBaseV2,
self.db.update_loadbalancer_provisioning_status(
context, db_pool.loadbalancer_id)
raise exc
db_pool.listeners = self.db.get_listeners(
context, filters={'default_pool_id': [db_pool.id]})
# Reload the pool from the DB to re-populate pool.listeners
# before calling the driver
db_pool = self.db.get_pool(context, db_pool.id)
driver = self._get_driver_for_loadbalancer(
context, db_pool.loadbalancer_id)
self._call_driver_operation(context, driver.pool.create, db_pool)