Skip to content

Commit

Permalink
Fix W0631 (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
drawlerr committed Jan 16, 2020
1 parent b24a461 commit 235ab99
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,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

0 comments on commit 235ab99

Please sign in to comment.