diff --git a/inventory_provider/config.py b/inventory_provider/config.py index eac27acfca5e3567edb7d9a46aebd88a2f926792..abf3645f5fecd68dde442b48ed8818429ae17a67 100644 --- a/inventory_provider/config.py +++ b/inventory_provider/config.py @@ -37,7 +37,7 @@ CONFIG_SCHEMA = { "properties": { "hostname": {"type": "string"}, "port": {"type": "integer"}, - "index": {"type": "integer"}, + "celery-db-index": {"type": "integer"}, "socket_timeout": {"$ref": "#/definitions/timeout"} }, "required": ["hostname", "port"], @@ -48,7 +48,7 @@ CONFIG_SCHEMA = { "properties": { "hostname": {"type": "string"}, "port": {"type": "integer"}, - "index": {"type": "integer"}, + "celery-db-index": {"type": "integer"}, "name": {"type": "string"}, "redis_socket_timeout": {"$ref": "#/definitions/timeout"}, "sentinel_socket_timeout": {"$ref": "#/definitions/timeout"} diff --git a/inventory_provider/tasks/config.py b/inventory_provider/tasks/config.py index 2ce619c3d8f83984ca343ccfe51cf2a6ab917ccc..2026f9a6a1a35878512d2c9cfd0e1e5b6f54c629 100644 --- a/inventory_provider/tasks/config.py +++ b/inventory_provider/tasks/config.py @@ -1,9 +1,9 @@ import logging import os from inventory_provider import config -import redis.sentinel logger = logging.getLogger(__name__) +DEFAULT_CELERY_DB_INDEX = 1 assert os.path.isfile(os.environ['INVENTORY_PROVIDER_CONFIG_FILENAME']), ( 'config file %r not found' % @@ -35,7 +35,7 @@ if 'redis_socket_timeout' in params: _broker_hostname = params['hostname'] _broker_port = params['port'] -_broker_db_index = params.get('index', 1) +_broker_db_index = params.get('celery-db-index', DEFAULT_CELERY_DB_INDEX) if ':' in _broker_hostname: # assume this means hostname is an ipv6 address