Skip to content

Commit

Permalink
V1.1.2 (#179)
Browse files Browse the repository at this point in the history
* Fix default timezone (#177)

* add timezone arg, default to UTC if no arg or env var

* bump version

* v1.1.2 Merge
  • Loading branch information
circa10a authored Feb 2, 2019
1 parent cf6b8a3 commit 59dde93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyouroboros/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION = "1.1.1"
VERSION = "1.1.2"
BRANCH = "master"
7 changes: 4 additions & 3 deletions pyouroboros/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
class Config(object):
options = ['INTERVAL', 'PROMETHEUS', 'DOCKER_SOCKETS', 'MONITOR', 'IGNORE', 'LOG_LEVEL', 'PROMETHEUS_ADDR',
'PROMETHEUS_PORT', 'NOTIFIERS', 'REPO_USER', 'REPO_PASS', 'CLEANUP', 'RUN_ONCE', 'LATEST', 'CRON',
'INFLUX_URL', 'INFLUX_PORT', 'INFLUX_USERNAME', 'INFLUX_PASSWORD', 'INFLUX_DATABASE', 'INFLUX_SSL',
'INFLUX_VERIFY_SSL', 'DATA_EXPORT', 'SELF_UPDATE', 'LABEL_ENABLE', 'DOCKER_TLS', 'LABELS_ONLY',
'DRY_RUN', 'HOSTNAME', 'DOCKER_TLS_VERIFY']
'TIMEZONE', 'INFLUX_URL', 'INFLUX_PORT', 'INFLUX_USERNAME', 'INFLUX_PASSWORD', 'INFLUX_DATABASE',
'INFLUX_SSL', 'INFLUX_VERIFY_SSL', 'DATA_EXPORT', 'SELF_UPDATE', 'LABEL_ENABLE', 'DOCKER_TLS',
'LABELS_ONLY', 'DRY_RUN', 'HOSTNAME', 'DOCKER_TLS_VERIFY']

hostname = environ.get('HOSTNAME')
interval = 300
cron = None
timezone = environ.get('TZ') or 'UTC'
docker_sockets = 'unix://var/run/docker.sock'
docker_tls = False
docker_tls_verify = True
Expand Down
6 changes: 5 additions & 1 deletion pyouroboros/ouroboros.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def main():
help='Cron formatted string for scheduling\n'
'EXAMPLE: "*/5 * * * *"')

core_group.add_argument('-z', '--timezone', default=Config.timezone, dest='TIMEZONE',
help='Timezone for scheduling\n'
'EXAMPLE: "America/Chicago"')

core_group.add_argument('-l', '--log-level', choices=['debug', 'info', 'warn', 'error', 'critical'],
dest='LOG_LEVEL', default=Config.log_level, help='Set logging level\n'
'DEFAULT: info')
Expand Down Expand Up @@ -145,7 +149,7 @@ def main():

data_manager = DataManager(config)
notification_manager = NotificationManager(config, data_manager)
scheduler = BackgroundScheduler()
scheduler = BackgroundScheduler(timezone=config.timezone)
scheduler.start()

for socket in config.docker_sockets:
Expand Down

0 comments on commit 59dde93

Please sign in to comment.