Reformat files with black

This commit is contained in:
Orsiris de Jong 2023-02-05 19:37:05 +01:00
parent da7fa826d0
commit 96d4268cbe
2 changed files with 3 additions and 6 deletions

View file

@ -141,12 +141,9 @@ def is_encrypted(config_dict: dict) -> bool:
is_enc = True is_enc = True
for option in ENCRYPTED_OPTIONS: for option in ENCRYPTED_OPTIONS:
try: try:
if ( if config_dict[option["section"]][option["name"]] and not str(
config_dict[option["section"]][option["name"]] config_dict[option["section"]][option["name"]]
and not str(config_dict[option["section"]][option["name"]]).startswith( ).startswith(ID_STRING):
ID_STRING
)
):
is_enc = False is_enc = False
except (TypeError, KeyError): except (TypeError, KeyError):
# Don't care about encryption on missing items # Don't care about encryption on missing items

View file

@ -66,7 +66,7 @@ def metric_writer(config_dict: dict, restic_result: bool, result_string: str):
# Configure lables # Configure lables
label_string = ",".join( label_string = ",".join(
[f"{key}=\"{value}\"" for key, value in labels.items() if value] [f'{key}="{value}"' for key, value in labels.items() if value]
) )
try: try:
# Make sure we convert prometheus_additional_labels to list if only one label is given # Make sure we convert prometheus_additional_labels to list if only one label is given