Skip to content

Commit

Permalink
Add the ability to set the default handler and destination via enviro…
Browse files Browse the repository at this point in the history
…nment variables.
  • Loading branch information
bgruening committed May 1, 2016
1 parent 3ab43e3 commit ead96a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/galaxy/jobs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,15 @@ def __get_default(self, parent, names):
:returns: str -- id or tag representing the default.
"""

rval = parent.get('default')
if 'default_from_environ' in parent.attrib:
environ_var = parent.attrib['default_from_environ']
rval = os.environ.get(environ_var, rval)
elif 'default_from_config' in parent.attrib:
config_val = parent.attrib['default_from_config']
rval = self.app.config.config_dict.get(config_val, rval)

if rval is not None:
# If the parent element has a 'default' attribute, use the id or tag in that attribute
if rval not in names:
Expand Down

0 comments on commit ead96a5

Please sign in to comment.