From 2a20a0b93add3d93887f30cd0cfab6a8750dbfe2 Mon Sep 17 00:00:00 2001 From: PabloHiro Date: Tue, 22 Oct 2024 12:56:20 +0200 Subject: [PATCH] fix: websocket callback errors --- awxkit/awxkit/ws.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/awxkit/awxkit/ws.py b/awxkit/awxkit/ws.py index ac4b37453aab..2e2fe6668b8e 100644 --- a/awxkit/awxkit/ws.py +++ b/awxkit/awxkit/ws.py @@ -205,8 +205,8 @@ def unsubscribe(self, wait=True, timeout=10): else: self._send(json.dumps(dict(groups={}, xrftoken=self.csrftoken))) - def _on_message(self, message): - message = json.loads(message) + def _on_message(self, *args): + message = json.loads(args[1]) log.debug('received message: {}'.format(message)) if self._add_received_time: message['received_time'] = datetime.datetime.utcnow() @@ -230,13 +230,13 @@ def _update_subscription(self, job_id): self.subscribe(**subscription) self._should_subscribe_to_pending_job = False - def _on_open(self): + def _on_open(self, *args): self._ws_connected_flag.set() - def _on_error(self, error): - log.info('Error received: {}'.format(error)) + def _on_error(self, *args): + log.info('Error received: {}'.format(args[1])) - def _on_close(self): + def _on_close(self, *args): log.info('Successfully closed ws.') self._ws_closed = True