def terminate_volumes(db, context, instance_id):
    volume_api = volume.API()
    for bdm in db.block_device_mapping_get_all_by_instance(context,
                                                           instance_id):
        #LOG.debug(_("terminating bdm %s") % bdm)
        if bdm['volume_id'] and bdm['delete_on_termination']:
            volume_api.delete(context, bdm['volume_id'])
        db.block_device_mapping_destroy(context, bdm['id'])
set_option(name, value)
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/compute/utils.py/terminate_volumes--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/functions.py/set_option