Esempio n. 1
0
    def _get_ocean_backend(self, enrich_backend):
        backend_cmd = None

        no_incremental = False
        clean = False

        from .task_projects import TaskProjects
        repos = TaskProjects.get_repos_by_backend_section(self.backend_section)
        if len(repos) == 1:
            # Support for filter raw when we have one repo
            repo = repos[0]
            repo, repo_labels = self._extract_repo_labels(self.backend_section, repo)
            p2o_args = self._compose_p2o_params(self.backend_section, repo)
            filter_raw = p2o_args['filter-raw'] if 'filter-raw' in p2o_args else None

            ocean_backend = get_ocean_backend(backend_cmd, enrich_backend, no_incremental, filter_raw)
        else:
            ocean_backend = get_ocean_backend(backend_cmd, enrich_backend, no_incremental)

        elastic_ocean = get_elastic(self._get_collection_url(),
                                    self.conf[self.backend_section]['raw_index'],
                                    clean, ocean_backend)
        ocean_backend.set_elastic(elastic_ocean)

        return ocean_backend
Esempio n. 2
0
    def _get_ocean_backend(self, enrich_backend):
        backend_cmd = None

        no_incremental = False
        clean = False

        from .task_projects import TaskProjects
        repos = TaskProjects.get_repos_by_backend_section(self.backend_section)
        if len(repos) == 1:
            # Support for filter raw when we have one repo
            (filter_raw, filters_raw_prefix) = self.__filters_raw(repos[0])
            if filter_raw or filters_raw_prefix:
                logger.info("Using %s %s for getting identities from raw",
                            filter_raw, filters_raw_prefix)
            ocean_backend = get_ocean_backend(backend_cmd, enrich_backend,
                                              no_incremental, filter_raw,
                                              filters_raw_prefix)
        else:
            ocean_backend = get_ocean_backend(backend_cmd, enrich_backend,
                                              no_incremental)

        elastic_ocean = get_elastic(
            self._get_collection_url(),
            self.conf[self.backend_section]['raw_index'], clean, ocean_backend)
        ocean_backend.set_elastic(elastic_ocean)

        return ocean_backend