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"