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 W0631 #868

Merged
merged 2 commits into from
Jan 16, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ disable=print-statement,
W0404,
W0612,
W0613,
W0621,
W0631
W0621


# Enable the message, report, category or checker with the given id(s). You can
Expand Down
16 changes: 10 additions & 6 deletions esrally/chart_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1582,26 +1582,29 @@ def throttled_tasks(self):


def load_race_configs(cfg, chart_type, chart_spec_path=None):
def add_configs(race_configs_per_lic, flavor_name="oss", lic="oss"):
def add_configs(race_configs_per_lic, flavor_name="oss", lic="oss", track_name=None):
configs_per_lic = []
for race_config in race_configs_per_lic:
configs_per_lic.append(
RaceConfig(track=race_config_track.get_track(cfg, item["track"], race_config.get("track-params", {})),
RaceConfig(track=race_config_track.get_track(cfg, track_name, race_config.get("track-params", {})),
cfg=race_config,
flavor=flavor_name,
es_license=lic)
)
return configs_per_lic

def add_race_configs(license_configs, flavor_name):
def add_race_configs(license_configs, flavor_name, track_name):
if chart_type == BarCharts:
# Only one license config, "oss", is present in bar charts
_lic_conf = [license_config["configurations"] for license_config in license_configs if license_config["name"] == "oss"]
if _lic_conf:
race_configs_per_track.extend(add_configs(_lic_conf[0]))
race_configs_per_track.extend(add_configs(_lic_conf[0], track_name=track_name))
else:
for lic_config in license_configs:
race_configs_per_track.extend(add_configs(lic_config["configurations"], flavor_name, lic_config["name"]))
race_configs_per_track.extend(add_configs(lic_config["configurations"],
flavor_name,
lic_config["name"],
track_name))

if chart_spec_path:
import json
Expand All @@ -1617,7 +1620,8 @@ def add_race_configs(license_configs, flavor_name):
for flavor in item["flavors"]:
race_configs_per_track = []
_flavor_name = flavor["name"]
add_race_configs(flavor["licenses"], _flavor_name)
_track_name = item["track"]
add_race_configs(flavor["licenses"], _flavor_name, _track_name)

if race_configs_per_track:
if chart_type == BarCharts:
Expand Down
2 changes: 1 addition & 1 deletion esrally/mechanic/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def name_and_config(p):
elif len(plugin_spec) == 2:
return plugin_spec[0], plugin_spec[1].split("+")
else:
raise ValueError("Unrecognized plugin specification [%s]. Use either 'PLUGIN_NAME' or 'PLUGIN_NAME:PLUGIN_CONFIG'." % plugin)
raise ValueError("Unrecognized plugin specification [%s]. Use either 'PLUGIN_NAME' or 'PLUGIN_NAME:PLUGIN_CONFIG'." % p)

plugins = []
for plugin in plugin_names:
Expand Down