From 75c62ff7299ed789c35f0052b0c0712f29805976 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 23 Aug 2021 11:32:47 -0400 Subject: [PATCH] Print request index after webhook data dump --- netbox/extras/management/commands/webhook_receiver.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/netbox/extras/management/commands/webhook_receiver.py b/netbox/extras/management/commands/webhook_receiver.py index 147e4c261..382c830fd 100644 --- a/netbox/extras/management/commands/webhook_receiver.py +++ b/netbox/extras/management/commands/webhook_receiver.py @@ -37,12 +37,10 @@ class WebhookHandler(BaseHTTPRequestHandler): self.end_headers() self.wfile.write(b'Webhook received!\n') - request_counter += 1 - - # Print the request headers to stdout + # Print the request headers if self.show_headers: for k, v in self.headers.items(): - print('{}: {}'.format(k, v)) + print(f'{k}: {v}') print() # Print the request body (if any) @@ -55,8 +53,11 @@ class WebhookHandler(BaseHTTPRequestHandler): else: print('(No body)') + print(f'Completed request #{request_counter}') print('------------') + request_counter += 1 + class Command(BaseCommand): help = "Start a simple listener to display received HTTP requests"