'Enable cg replication'

@proxy._trace_time
def enable_replication(self, context, group, volumes):

    group_specs = group_types.get_group_type_specs(group.group_type_id)
    if (not group_specs):
        msg = 'No    group    specs    inside    group    type'
        LOG.error(msg)
        raise self.meta['exception'].VolumeBackendAPIException(data=msg)
    replication_info = self._get_replication_info(group_specs)
    if utils.is_group_a_cg_snapshot_type(group):
        if volumes:
            self._update_consistencygroup(context, group, remove_volumes=volumes)
            for volume in volumes:
                repl.VolumeReplication(self).create_replication(volume.name, replication_info)
        group_name = self._cg_name_from_group(group)
        self._create_consistencygroup_on_remote(context, group_name)
        repl.GroupReplication(self).create_replication(group_name, replication_info)
        updated_volumes = []
        if volumes:
            self._update_consistencygroup(context, group, add_volumes=volumes)
            for volume in volumes:
                updated_volumes.append({'id': volume['id'], 'replication_status': fields.ReplicationStatus.ENABLED})
        return ({'replication_status': fields.ReplicationStatus.ENABLED}, updated_volumes)
    else:
        updated_volumes = []
        for volume in volumes:
            repl.VolumeReplication(self).create_replication(volume.name, replication_info)
        for volume in volumes:
            updated_volumes.append({'id': volume['id'], 'replication_status': fields.ReplicationStatus.ENABLED})
        return ({'replication_status': fields.ReplicationStatus.ENABLED}, updated_volumes)
