diff --git a/freezer_api/cmd/manage.py b/freezer_api/cmd/manage.py index 46f19687..0c1df324 100644 --- a/freezer_api/cmd/manage.py +++ b/freezer_api/cmd/manage.py @@ -30,7 +30,6 @@ from freezer_api.storage import driver CONF = cfg.CONF LOG = log.getLogger(__name__) -DEFAULT_ES_SERVER_PORT = 9200 DEFAULT_INDEX = 'freezer' DEFAULT_REPLICAS = 0 @@ -51,17 +50,9 @@ def parse_config(mapping_choices): title='DB Options', handler=add_db_opts ), - cfg.HostAddressOpt('host', - default='127.0.0.1', - dest='host', - help='The DB host address[:port], ' - 'default "127.0.0.1"'), - cfg.PortOpt('port', - default=9200, - dest='port', - help='The DB server port (default: {0})'. - format(DEFAULT_ES_SERVER_PORT) - ), + cfg.ListOpt('hosts', + default=['http://127.0.0.1:9200'], + help='specify the storage hosts'), cfg.StrOpt('mapping', dest='select_mapping', default='', diff --git a/freezer_api/storage/elastic.py b/freezer_api/storage/elastic.py index 8d6edb6d..574f219a 100644 --- a/freezer_api/storage/elastic.py +++ b/freezer_api/storage/elastic.py @@ -281,10 +281,9 @@ class SessionTypeManager(TypeManager): class ElasticSearchEngine(object): _OPTS = [ - cfg.StrOpt('hosts', - default='http://localhost:9200', - deprecated_name='endpoint', - help='specify the storage hosts'), + cfg.ListOpt('hosts', + default=['http://127.0.0.1:9200'], + help='specify the storage hosts'), cfg.StrOpt('index', default='freezer', help='specify the name of the elasticsearch index'), @@ -323,7 +322,6 @@ class ElasticSearchEngine(object): # register elasticsearch opts CONF.register_opts(self._OPTS, group=backend) self.conf = dict(CONF.get(backend)) - self.conf['hosts'] = self.conf['hosts'].split(',') self.backend = backend self._validate_opts() self.init(**self.conf) diff --git a/freezer_api/storage/elasticv2.py b/freezer_api/storage/elasticv2.py index d62720c9..eadb6c2c 100644 --- a/freezer_api/storage/elasticv2.py +++ b/freezer_api/storage/elasticv2.py @@ -320,10 +320,9 @@ class SessionTypeManagerV2(TypeManagerV2): class ElasticSearchEngineV2(object): _OPTS = [ - cfg.StrOpt('hosts', - default='http://localhost:9200', - deprecated_name='endpoint', - help='specify the storage hosts'), + cfg.ListOpt('hosts', + default=['http://127.0.0.1:9200'], + help='specify the storage hosts'), cfg.StrOpt('index', default='freezer', help='specify the name of the elasticsearch index'), @@ -362,7 +361,6 @@ class ElasticSearchEngineV2(object): # register elasticsearch opts CONF.register_opts(self._OPTS, group=backend) self.conf = dict(CONF.get(backend)) - self.conf['hosts'] = self.conf['hosts'].split(',') self.backend = backend self._validate_opts() self.init(**self.conf)