Skip to content

Commit

Permalink
Only call get_valid_destinations_from_config once
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Spelchak committed Feb 5, 2018
1 parent c01bff7 commit d78421c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/galaxy/jobs/dynamic_tool_destination.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,6 @@ def __validate_destination(cls, valid_rule, return_bool, rule, tool, counter):
@return: validated rule and result of validation
"""

valid_destinations = get_valid_destinations_from_config() ###TODO: find a place that I can declare this only once

if "fail_message" in rule:
if "destination" not in rule or rule['destination'] != "fail":
error = "Found a fail_message for rule " + str(counter)
Expand Down Expand Up @@ -755,6 +753,7 @@ def infinite_defaultdict():
new_config = infinite_defaultdict()

global verbose
global valid_destinations
valid_destinations = get_valid_destinations_from_config()
verbose = False
valid_config = True
Expand Down Expand Up @@ -1306,7 +1305,7 @@ def map_tool_to_destination(
# making default destinations a mandatory field for all tools
if len(priority_list) > 0:
default_priority = next(iter(priority_list))
priority = default_priority
priority = default_priority ###FIXME: this is sometimes a value that isn't in the tool's default destinations field.
else:
fail_message = ("No priorities declared in config file!" +
"cannot map " + str(tool.old_id) + " to destination")
Expand Down

0 comments on commit d78421c

Please sign in to comment.