From e3b42b07258f9c0cd45c5ec542f1dc2a65b9798f Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 26 Dec 2022 20:12:27 +0200 Subject: [PATCH] Fix line in errros --- pyproject.toml | 2 +- restic_exporter/restic_exporter.py | 3 ++- setup.cfg | 2 +- setup.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7dd8cbc..f5f594a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ Homepage = "https://susurrando.com" [project] name = "restic_exporter" -version = "0.0.10" +version = "0.0.11" description = "Export to node exporter the summary of a restic backup" readme = "README.md" authors = [{ name = "Antonio J. Delgado", email = "ad@susurrando.com" }] diff --git a/restic_exporter/restic_exporter.py b/restic_exporter/restic_exporter.py index fd6dcdd..1f30793 100644 --- a/restic_exporter/restic_exporter.py +++ b/restic_exporter/restic_exporter.py @@ -77,7 +77,8 @@ class restic_exporter: if 'snapshot_id' in line_data: self.labels["snapshot_id"] = line_data['snapshot_id'] except json.decoder.JSONDecodeError as error: - self._log.error(f"# Error decoding line '{line}'. {error}") + fixed_line = line.replace('\n', '') + self._log.error(f"# Error decoding line '{fixed_line}'. {error}") file_stats = os.stat(json_file) self.summary['timestamp'] = round(file_stats.st_mtime * 1000) self._log.debug(f"# Summary: {json.dumps(self.summary, indent=2)}") diff --git a/setup.cfg b/setup.cfg index e51bee3..4be64f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = restic_exporter -version = 0.0.10 +version = 0.0.11 [options] packages = restic_exporter diff --git a/setup.py b/setup.py index 3139c11..0d77652 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import setuptools setuptools.setup( scripts=['restic_exporter/restic_exporter.py'], author="Antonio J. Delgado", - version='0.0.10', + version='0.0.11', name='restic_exporter', author_email="", url="",