From 72822c197217f79890abe916f8c8356b7bad3300 Mon Sep 17 00:00:00 2001 From: David Huss <dh@atoav.com> Date: Mon, 15 Mar 2021 15:43:31 +0100 Subject: [PATCH] Move dryrun and loglevel to ["application"] --- stechuhr_client/client.py | 2 +- stechuhr_client/config.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/stechuhr_client/client.py b/stechuhr_client/client.py index 619475b..82ac2bf 100644 --- a/stechuhr_client/client.py +++ b/stechuhr_client/client.py @@ -184,7 +184,7 @@ def send_request(verified_id, config, logger) -> bool: "direction" : config["client"]["direction"], "id" : verified_id } - if not config["client"]["dryrun"]: + if not config["application"]["dryrun"]: try: r = requests.post(target_address, json=payload, timeout=config["server"]["timeout"], verify=config["server"]["verify_cert"]) except Exception as e: diff --git a/stechuhr_client/config.py b/stechuhr_client/config.py index d5a5eb6..951b0a4 100644 --- a/stechuhr_client/config.py +++ b/stechuhr_client/config.py @@ -16,6 +16,11 @@ APPLICATION_NAME = "stechuhr-client" # Do not change here, just use an override instead DEFAULT_CONFIG = """ +[application] +# Valid Log Levels are Debug, Info, Warning, Error, Critical +loglevel = "Debug" +dryrun = true + [server] address = "127.0.0.1" port = 80 @@ -37,9 +42,6 @@ id_patterns = [ "^FB67D500$", ] -# Valid Log Levels are Debug, Info, Warning, Error, Critical -loglevel = "Debug" -dryrun = true [reader] # Connect to the reader using this -- GitLab