'Delete consistency group of GPFS volumes.'

def _delete_consistencygroup(self, context, group, volumes):

    cgname = ('consisgroup-%s' % group['id'])
    fsdev = self._gpfs_device
    delete_fileset = True
    model_update = {}
    model_update['status'] = group['status']
    try:
        self.gpfs_execute((self.GPFS_PATH + 'mmlsfileset'), fsdev, cgname)
    except processutils.ProcessExecutionError as e:
        if (e.exit_code == 2):
            msg = (_('The    fileset    associated    with    consistency    group    %(cgname)s    does    not    exist') % {'cgname': cgname})
            LOG.info(msg)
            delete_fileset = False
    if delete_fileset:
        try:
            self.gpfs_execute((self.GPFS_PATH + 'mmunlinkfileset'), fsdev, cgname, '-f')
        except processutils.ProcessExecutionError as e:
            msg = (_('Failed    to    unlink    fileset    for    consistency    group    %(cgname)s.    Error:    %(excmsg)s.') % {'cgname': cgname, 'excmsg': six.text_type(e)})
            LOG.error(msg)
            raise exception.VolumeBackendAPIException(data=msg)
        try:
            self.gpfs_execute((self.GPFS_PATH + 'mmdelfileset'), fsdev, cgname, '-f')
        except processutils.ProcessExecutionError as e:
            msg = (_('Failed    to    delete    fileset    for    consistency    group    %(cgname)s.    Error:    %(excmsg)s.') % {'cgname': cgname, 'excmsg': six.text_type(e)})
            LOG.error(msg)
            raise exception.VolumeBackendAPIException(data=msg)
    for volume_ref in volumes:
        volume_ref['status'] = 'deleted'
    model_update = {'status': group['status']}
    return (None, None)
