Skip to content

Commit

Permalink
config: better boolean env parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Nov 30, 2018
1 parent 7cb8c81 commit cbbcb83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion asclepias_broker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@


def _parse_env_bool(var_name, default=None):
return str(os.environ.get(var_name)).lower() in ('true', '1') or default
value = str(os.environ.get(var_name)).lower()
if value in ('true', '1'):
return True
elif value in ('false', '0'):
return False
return default


# Flask configuration
Expand Down

0 comments on commit cbbcb83

Please sign in to comment.