def delete_pool(self, context, pool):
     vip_id = self._plugin.get_pool(context, pool['id']).get('vip_id', None)
     if vip_id:
         raise lb_ext.PoolInUse(pool_id=pool['id'])
     else:
         super(EdgeLoadbalancerDriver, self).delete_pool(context, pool)
         pool_mapping = db.get_nsxv_edge_pool_mapping(context, pool['id'])
         self._nsxv_driver.delete_pool(context, pool, pool_mapping)
Exemple #2
0
 def _handle_pool(self, context, pool, delete=False):
     vip_id = self.plugin.get_pool(context, pool['id']).get('vip_id', None)
     if vip_id:
         if delete:
             raise loadbalancer.PoolInUse(pool_id=pool['id'])
         else:
             vip = self.plugin.get_vip(context, vip_id)
             ext_vip = self._populate_vip_graph(context, vip)
             self._update_workflow(pool['id'], self.l4_action_name, ext_vip,
                                   context, delete, lb_db.Pool, pool['id'])
     else:
         if delete:
             self.plugin._delete_db_pool(context, pool['id'])
         else:
             # we keep the pool in PENDING_UPDATE
             # no point to modify it since it is not connected to vip yet
             pass
Exemple #3
0
 def _ensure_pool_delete_conditions(self, context, pool_id):
     if context.session.query(Vip).filter_by(pool_id=pool_id).first():
         raise loadbalancer.PoolInUse(pool_id=pool_id)