def lb_delete_vip(conf, lb_id, vip_id): logger.debug("Called lb_delete_vip(), conf: %r, lb_id: %s, vip_id: %s", conf, lb_id, vip_id) lb_ref = db_api.loadbalancer_get(conf, lb_id) vip_ref = db_api.virtualserver_get(conf, vip_id) device_driver = drivers.get_device_driver(conf, lb_ref['device_id']) with device_driver.request_context() as ctx: commands.delete_vip(ctx, vip_ref) db_api.virtualserver_destroy(conf, vip_id)
def test_delete_vip(self, mock_upd): cmd.delete_vip(self.ctx, self.vip) self.assertTrue(mock_upd.called, "upd not called")
def test_delete_vip(self, mock_upd): cmd.delete_vip(self.ctx, self.vip) self.assertTrue(self.ctx.device.delete_virtual_ip.called) self.assertTrue(mock_upd.called, "upd not called") mock_upd.assert_called_once_with(self.ctx.conf, self.vip['id'], self.vip)