disassociating a health monitor

asked 2013-12-05 17:24:22 -0500

anonymous user


updated 2014-01-22 15:12:26 -0500

Evgeny gravatar image

In the loadbalancer plugin, we have this following function which is called for both the delete and dissociation of the health monitor from the pool (Correct me if I am wrong). I am having problem with differentiating both the calls in the driver, as one will delete the health monitor other will just disassociates the health monitor. Any clue how can I differentiate both the operations ?

def delete_health_monitor(self, context, id):
    with context.session.begin(subtransactions=True):
        hm = self.get_health_monitor(context, id)
        qry = context.session.query(
        for assoc in qry:
            driver = self._get_driver_for_pool(context, assoc['pool_id'])
    super(LoadBalancerPlugin, self).delete_health_monitor(context, id)

Out of curiosity, isn't it be easy if we had two separate function for doing delete and disassociate ?

edit retag flag offensive close merge delete