Esempio n. 1
0
def remove_index(config, index_name, async_rpc=False):
    from infi.app_repo.indexers import get_indexers
    from infi.app_repo.utils import log_execute_assert_success
    from infi.app_repo.service import get_client
    assert index_name in config.indexes
    config.indexes = [name for name in config.indexes if name != index_name]
    config.to_disk()
    for indexer in get_indexers(config, index_name):
        log_execute_assert_success(["rm", "-rf", indexer.base_directory])
    get_client(config).reload_configuration_from_disk(async_rpc=async_rpc)
Esempio n. 2
0
def remove_index(config, index_name, async_rpc=False):
    from infi.app_repo.indexers import get_indexers
    from infi.app_repo.utils import log_execute_assert_success
    from infi.app_repo.service import get_client
    assert index_name in config.indexes
    config.indexes = [name for name in config.indexes if name != index_name]
    config.to_disk()
    for indexer in get_indexers(config, index_name):
        log_execute_assert_success(["rm", "-rf", indexer.base_directory])
    get_client(config).reload_configuration_from_disk(async_rpc=async_rpc)
Esempio n. 3
0
def add_index(config, index_name, async_rpc=False):
    from infi.app_repo.indexers import get_indexers
    from infi.app_repo.install import ensure_directory_exists, path
    from infi.app_repo.service import get_client
    assert index_name not in config.indexes
    for indexer in get_indexers(config, index_name):
        indexer.initialise()
    ensure_directory_exists(path.join(config.incoming_directory, index_name))
    ensure_directory_exists(path.join(config.rejected_directory, index_name))
    config.indexes.append(index_name)
    config.to_disk()
    get_client(config).reload_configuration_from_disk(async_rpc=async_rpc)
Esempio n. 4
0
def add_index(config, index_name, async_rpc=False):
    from infi.app_repo.indexers import get_indexers
    from infi.app_repo.install import ensure_directory_exists, path
    from infi.app_repo.service import get_client
    assert index_name not in config.indexes
    for indexer in get_indexers(config, index_name):
        indexer.initialise()
    ensure_directory_exists(path.join(config.incoming_directory, index_name))
    ensure_directory_exists(path.join(config.rejected_directory, index_name))
    config.indexes.append(index_name)
    config.to_disk()
    get_client(config).reload_configuration_from_disk(async_rpc=async_rpc)
Esempio n. 5
0
 def test_initialize(self):
     with self._setup_context() as config:
         indexers = get_indexers(config, 'main')
         for item in indexers:
             item.initialise()
Esempio n. 6
0
 def test_initialize(self):
     with self._setup_context() as config:
         indexers = get_indexers(config, 'main')
         for item in indexers:
             item.initialise()