Skip to content

Commit

Permalink
Merge pull request #589 from SegFaultAX/mkbernard-fix-docker-settings
Browse files Browse the repository at this point in the history
Add WITH_EVENT_NUMBERS to docker_settings
  • Loading branch information
bastelfreak committed Aug 10, 2020
2 parents ee9e747 + 2211137 commit 974c51a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions puppetboard/docker_settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import os


def coerce_bool(v, default):
"""Convert boolean-like values into a boolean."""

if v in [True, False]:
return v
s = str(v).lower().strip()
if s in ['true', 't', 'y', 'yes', '1']:
return True
if s in ['false', 'f', 'n', 'no', '0']:
return False
return default


PUPPETDB_HOST = os.getenv('PUPPETDB_HOST', 'puppetdb')
PUPPETDB_PORT = int(os.getenv('PUPPETDB_PORT', '8080'))
# Since this is an env it will always be a string, we need
Expand Down Expand Up @@ -84,3 +98,5 @@
DAILY_REPORTS_CHART_ENABLED = bool(os.getenv('DAILY_REPORTS_CHART_ENABLED',
'True').upper() == 'TRUE')
DAILY_REPORTS_CHART_DAYS = int(os.getenv('DAILY_REPORTS_CHART_DAYS', '8'))

WITH_EVENT_NUMBERS = coerce_bool(os.getenv('WITH_EVENT_NUMBERS'), True)

0 comments on commit 974c51a

Please sign in to comment.