From 8f728099b0656efafd2ed38d2da21528f59997dc Mon Sep 17 00:00:00 2001 From: kogeler <25884155+kogeler@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:05:26 +0300 Subject: [PATCH] fix http response in the exporter for the node-backup role (#76) * fix http response in exporter for node-backup role * fix galaxy version --- galaxy.yml | 2 +- roles/node_backup/files/exporter.py | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index f66e029..13c012f 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -8,7 +8,7 @@ namespace: paritytech name: chain # The version of the collection. Must be compatible with semantic versioning -version: 1.10.1 +version: 1.10.2 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/roles/node_backup/files/exporter.py b/roles/node_backup/files/exporter.py index 338263f..077bba1 100644 --- a/roles/node_backup/files/exporter.py +++ b/roles/node_backup/files/exporter.py @@ -121,11 +121,6 @@ def log_message(self, format, *args): message = f"{self.address_string()} {format % args}" logging.info(message) - def _set_headers(self): - self.send_response(200) - self.send_header('Content-type', 'application/json; charset=utf-8') - self.end_headers() - def do_POST(self): if self.headers.get('Content-Type') != 'application/json': @@ -140,8 +135,8 @@ def do_POST(self): set_metrics(json.loads(data)) self.send_response(200) - - self._set_headers() + self.send_header('Content-type', 'application/json; charset=utf-8') + self.end_headers() self.wfile.write(json.dumps({"status": "OK"}).encode("utf8")) except json.decoder.JSONDecodeError as e: tb_output = io.StringIO()