'Get storage CG name from volume.
A utility method to translate from openstack volume
to CG name on the storage'

def _cg_name_from_volume(self, volume):

    LOG.debug('_cg_name_from_volume:    %(vol)s', {'vol': volume['name']})
    cg_id = volume.get('group_id', None)
    if cg_id:
        cg_name = self._cg_name_from_id(cg_id)
        LOG.debug('Volume    %(vol)s    is    in    CG    %(cg)s', {'vol': volume['name'], 'cg': cg_name})
        return cg_name
    else:
        LOG.debug('Volume    %(vol)s    not    in    CG', {'vol': volume['name']})
        return None
