mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-10 23:15:37 +08:00
Reformat files with black
This commit is contained in:
parent
e63d6558a8
commit
4ec85f3eed
2 changed files with 8 additions and 4 deletions
|
@ -46,7 +46,9 @@ def metric_writer(config_dict: dict, restic_result: bool, result_string: str):
|
||||||
except (KeyError, AttributeError):
|
except (KeyError, AttributeError):
|
||||||
prometheus_group = None
|
prometheus_group = None
|
||||||
try:
|
try:
|
||||||
prometheus_additional_labels = config_dict["prometheus"]["additional_labels"]
|
prometheus_additional_labels = config_dict["prometheus"][
|
||||||
|
"additional_labels"
|
||||||
|
]
|
||||||
except (KeyError, AttributeError):
|
except (KeyError, AttributeError):
|
||||||
prometheus_additional_labels = None
|
prometheus_additional_labels = None
|
||||||
|
|
||||||
|
@ -354,7 +356,9 @@ class NPBackupRunner:
|
||||||
exclude_caches = False
|
exclude_caches = False
|
||||||
try:
|
try:
|
||||||
one_file_system = (
|
one_file_system = (
|
||||||
self.config_dict["backup"]["one_file_system"] if os.name != "nt" else False
|
self.config_dict["backup"]["one_file_system"]
|
||||||
|
if os.name != "nt"
|
||||||
|
else False
|
||||||
)
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
one_file_system = False
|
one_file_system = False
|
||||||
|
|
|
@ -324,8 +324,8 @@ if __name__ == "__main__":
|
||||||
destination_file = os.path.join(destination_dir, output_filename)
|
destination_file = os.path.join(destination_dir, output_filename)
|
||||||
try:
|
try:
|
||||||
with open(log_file, "r") as file_handle:
|
with open(log_file, "r") as file_handle:
|
||||||
errors, metrics = restic_output_2_metrics(True,
|
errors, metrics = restic_output_2_metrics(
|
||||||
output=file_handle.readlines(), labels=labels
|
True, output=file_handle.readlines(), labels=labels
|
||||||
)
|
)
|
||||||
if errors:
|
if errors:
|
||||||
logger.error("Script finished with errors.")
|
logger.error("Script finished with errors.")
|
||||||
|
|
Loading…
Add table
Reference in a new issue