Skip to content

Commit 59dde93

Browse files
authored
V1.1.2 (#179)
* Fix default timezone (#177) * add timezone arg, default to UTC if no arg or env var * bump version * v1.1.2 Merge
1 parent cf6b8a3 commit 59dde93

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

pyouroboros/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION = "1.1.1"
1+
VERSION = "1.1.2"
22
BRANCH = "master"

pyouroboros/config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
class Config(object):
77
options = ['INTERVAL', 'PROMETHEUS', 'DOCKER_SOCKETS', 'MONITOR', 'IGNORE', 'LOG_LEVEL', 'PROMETHEUS_ADDR',
88
'PROMETHEUS_PORT', 'NOTIFIERS', 'REPO_USER', 'REPO_PASS', 'CLEANUP', 'RUN_ONCE', 'LATEST', 'CRON',
9-
'INFLUX_URL', 'INFLUX_PORT', 'INFLUX_USERNAME', 'INFLUX_PASSWORD', 'INFLUX_DATABASE', 'INFLUX_SSL',
10-
'INFLUX_VERIFY_SSL', 'DATA_EXPORT', 'SELF_UPDATE', 'LABEL_ENABLE', 'DOCKER_TLS', 'LABELS_ONLY',
11-
'DRY_RUN', 'HOSTNAME', 'DOCKER_TLS_VERIFY']
9+
'TIMEZONE', 'INFLUX_URL', 'INFLUX_PORT', 'INFLUX_USERNAME', 'INFLUX_PASSWORD', 'INFLUX_DATABASE',
10+
'INFLUX_SSL', 'INFLUX_VERIFY_SSL', 'DATA_EXPORT', 'SELF_UPDATE', 'LABEL_ENABLE', 'DOCKER_TLS',
11+
'LABELS_ONLY', 'DRY_RUN', 'HOSTNAME', 'DOCKER_TLS_VERIFY']
1212

1313
hostname = environ.get('HOSTNAME')
1414
interval = 300
1515
cron = None
16+
timezone = environ.get('TZ') or 'UTC'
1617
docker_sockets = 'unix://var/run/docker.sock'
1718
docker_tls = False
1819
docker_tls_verify = True

pyouroboros/ouroboros.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def main():
4343
help='Cron formatted string for scheduling\n'
4444
'EXAMPLE: "*/5 * * * *"')
4545

46+
core_group.add_argument('-z', '--timezone', default=Config.timezone, dest='TIMEZONE',
47+
help='Timezone for scheduling\n'
48+
'EXAMPLE: "America/Chicago"')
49+
4650
core_group.add_argument('-l', '--log-level', choices=['debug', 'info', 'warn', 'error', 'critical'],
4751
dest='LOG_LEVEL', default=Config.log_level, help='Set logging level\n'
4852
'DEFAULT: info')
@@ -145,7 +149,7 @@ def main():
145149

146150
data_manager = DataManager(config)
147151
notification_manager = NotificationManager(config, data_manager)
148-
scheduler = BackgroundScheduler()
152+
scheduler = BackgroundScheduler(timezone=config.timezone)
149153
scheduler.start()
150154

151155
for socket in config.docker_sockets:

0 commit comments

Comments
 (0)