Browse Source

Revert "Updated "create_pool" method in plugin"

This reverts commit c672b0d567.

Closes-Bug: #1802438
Change-Id: I21a068b73e366ea5c815ea14249cd3b3c6725315
YAMAMOTO Takashi 5 months ago
parent
commit
31dc1e3a0e

+ 2
- 2
neutron_lbaas/db/loadbalancer/loadbalancer_dbv2.py View File

@@ -664,8 +664,8 @@ class LoadBalancerPluginDbv2(base_db.CommonDbMixin,
664 664
                 pool_db.session_persistence = s_p
665 665
 
666 666
             context.session.add(pool_db)
667
-            context.session.flush()
668
-        return data_models.Pool.from_sqlalchemy_model(pool_db)
667
+        context.session.refresh(pool_db.loadbalancer)
668
+        return self.get_pool(context, pool_db.id)
669 669
 
670 670
     def update_pool(self, context, id, pool):
671 671
         with context.session.begin(subtransactions=True):

+ 3
- 3
neutron_lbaas/services/loadbalancer/plugin.py View File

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

Loading…
Cancel
Save