'Deletes a consistency group.'

@pure_driver_debug_trace
def delete_consistencygroup(self, context, group, volumes):

    try:
        pgroup_name = self._get_pgroup_name_from_id(group.id)
        current_array = self._get_current_array()
        current_array.destroy_pgroup(pgroup_name)
        if self.configuration.pure_eradicate_on_delete:
            current_array.eradicate_pgroup(pgroup_name)
    except purestorage.PureHTTPError as err:
        with excutils.save_and_reraise_exception() as ctxt:
            if ((err.code == 400) and ((ERR_MSG_PENDING_ERADICATION in err.text) or (ERR_MSG_NOT_EXIST in err.text))):
                ctxt.reraise = False
                LOG.warning('Unable    to    delete    Protection    Group:    %s', err.text)
    for volume in volumes:
        self.delete_volume(volume)
    return (None, None)
