def delete_offload(module, array):
    """Delete offload target"""
    changed = False
    if module.params['protocol'] == 'nfs':
        try:
            array.disconnect_nfs_offload(module.params['name'])
            changed = True
        except Exception:
            module.fail_json(msg='Failed to delete NFS offload {0}.'.format
                (module.params['name']))
    if module.params['protocol'] == 's3':
        try:
            array.disconnect_nfs_offload(module.params['name'])
            changed = True
        except Exception:
            module.fail_json(msg='Failed to delete S3 offload {0}.'.format(
                module.params['name']))
    module.exit_json(changed=changed)
