Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error handling for automatically derived version #814

Merged
merged 4 commits into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions esrally/mechanic/mechanic.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,7 @@ def cluster_distribution_version(cfg, client_factory=client.EsClientFactory):
hosts = cfg.opts("client", "hosts").default
client_options = cfg.opts("client", "options").default
es = client_factory(hosts, client_options).create()
# noinspection PyBroadException
try:
return es.info()["version"]["number"]
except BaseException:
logging.getLogger(__name__).exception("Could not retrieve cluster distribution version")
return None
return es.info()["version"]["number"]


def to_ip_port(hosts):
Expand Down
2 changes: 0 additions & 2 deletions esrally/racecontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ def setup(self, msg, sender):
# builds we always assume "master"
if not msg.sources and not self.cfg.exists("mechanic", "distribution.version"):
distribution_version = mechanic.cluster_distribution_version(self.cfg)
if not distribution_version:
raise exceptions.SystemSetupError("A distribution version is required. Please specify it with --distribution-version.")
self.logger.info("Automatically derived distribution version [%s]", distribution_version)
self.cfg.add(config.Scope.benchmark, "mechanic", "distribution.version", distribution_version)

Expand Down