diff --git a/valet/engine/optimizer/db_connect/music_handler.py b/valet/engine/optimizer/db_connect/music_handler.py index 42fca1c..a5370c7 100755 --- a/valet/engine/optimizer/db_connect/music_handler.py +++ b/valet/engine/optimizer/db_connect/music_handler.py @@ -38,10 +38,10 @@ class MusicHandler(object): self.config = _config self.logger = _logger - self.music = Music(hosts=self.config.db_hosts, replication_factor=self.config.replication_factor) - if self.config.db_hosts is not None and len(self.config.db_hosts) > 0: - for dbh in self.config.db_hosts: - self.logger.info("DB: music host = " + dbh) + self.music = Music(host=self.config.db_host, port=self.config.db_port, + replication_factor=self.config.replication_factor) + if self.config.db_host is not None: + self.logger.info("DB: music host = " + self.config.db_host) if self.config.replication_factor is not None: self.logger.info("DB: music replication factor = " + str(self.config.replication_factor)) diff --git a/valet/engine/optimizer/ostro_server/configuration.py b/valet/engine/optimizer/ostro_server/configuration.py index dc663f3..d76ca1f 100755 --- a/valet/engine/optimizer/ostro_server/configuration.py +++ b/valet/engine/optimizer/ostro_server/configuration.py @@ -52,7 +52,8 @@ class Config(object): self.db_app_table = None self.db_uuid_table = None self.replication_factor = 3 - self.db_hosts = [] + self.db_host = 'localhost' + self.db_port = 8080 self.ip = None @@ -202,6 +203,8 @@ class Config(object): self.db_host = CONF.music.host + self.db_port = CONF.music.port + self.ip = CONF.engine.ip self.num_of_region_chars = CONF.engine.num_of_region_chars