Skip to content

Commit

Permalink
Provide default for datastore.secure in all cases
Browse files Browse the repository at this point in the history
With this commit we choose `False` as default value for the
configuration property `datastore.secure` even when an in-memory metrics
store is used. Contrary to the previous default (`""` (empty string)),
this avoids errors when the user manually changes their configuration
file to use an Elasticsearch metrics store but only provides host and
port.

Relates #705
  • Loading branch information
danielmitterdorfer authored Jun 5, 2019
1 parent 0529aeb commit 5c2655e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions esrally/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def create_config(self, config_file, advanced_config=False, assume_defaults=Fals
if data_store_choice == "1":
env_name = "local"
data_store_type = "in-memory"
data_store_host, data_store_port, data_store_secure, data_store_user, data_store_password = "", "", "", "", ""
data_store_host, data_store_port, data_store_secure, data_store_user, data_store_password = "", "", "False", "", ""
else:
data_store_type = "elasticsearch"
data_store_host, data_store_port, data_store_secure, data_store_user, data_store_password = self._ask_data_store()
Expand All @@ -365,7 +365,7 @@ def create_config(self, config_file, advanced_config=False, assume_defaults=Fals
# Does not matter for an in-memory store
env_name = "local"
data_store_type = "in-memory"
data_store_host, data_store_port, data_store_secure, data_store_user, data_store_password = "", "", "", "", ""
data_store_host, data_store_port, data_store_secure, data_store_user, data_store_password = "", "", "False", "", ""
preserve_install = False

config = configparser.ConfigParser()
Expand Down
2 changes: 1 addition & 1 deletion tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def test_create_simple_config(self, guess_install_location, working_copy):
self.assertEqual("in-memory", config_store.config["reporting"]["datastore.type"])
self.assertEqual("", config_store.config["reporting"]["datastore.host"])
self.assertEqual("", config_store.config["reporting"]["datastore.port"])
self.assertEqual("", config_store.config["reporting"]["datastore.secure"])
self.assertEqual("False", config_store.config["reporting"]["datastore.secure"])
self.assertEqual("", config_store.config["reporting"]["datastore.user"])
self.assertEqual("", config_store.config["reporting"]["datastore.password"])

Expand Down

0 comments on commit 5c2655e

Please sign in to comment.