Skip to content

Commit

Permalink
fix http response in the exporter for the node-backup role (#76)
Browse files Browse the repository at this point in the history
* fix http response in exporter for node-backup role

* fix galaxy version
  • Loading branch information
kogeler authored Jul 23, 2024
1 parent c436c1d commit 8f72809
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions roles/node_backup/files/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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()
Expand Down

0 comments on commit 8f72809

Please sign in to comment.