added early out for dry run
This commit is contained in:
parent
4bd798f0ad
commit
bf7b163ccd
1 changed files with 11 additions and 12 deletions
|
@ -27,13 +27,12 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev
|
|||
status = 'down' if state.name.lower() == 'fail' else 'up'
|
||||
push_url = hook_config.get('push_url', 'https://example.uptime.kuma/api/push/abcd1234')
|
||||
query = f'status={status}&msg={state.name.lower()}'
|
||||
|
||||
logger.info(f'{config_filename}: Pinging Uptime Kuma push_url {push_url}?{query} {dry_run_label}')
|
||||
logger.debug(
|
||||
f'{config_filename}: Full Uptime Kuma state URL {push_url}?{query}'
|
||||
)
|
||||
|
||||
if not dry_run:
|
||||
if dry_run:
|
||||
return
|
||||
logging.getLogger('urllib3').setLevel(logging.ERROR)
|
||||
try:
|
||||
response = requests.get(
|
||||
|
|
Loading…
Reference in a new issue