From 449c50d170fecc814defc39c009a075056e15c58 Mon Sep 17 00:00:00 2001 From: Andy Botting Date: Wed, 12 Oct 2022 13:51:37 +1100 Subject: [PATCH] Remove use of anyjson module The use of the anyjson module causes issues with Python 3.10 with the following error: `error in anyjson setup command: use_2to3 is invalid.` The module itself hasn't been updated since 2012 and the source [0] now errors with a 404, and there doesn't seem to be any real benefit over the standard python json module. [0] https://bitbucket.org/runeh/anyjson/ Change-Id: I00ae5e9545136c1b930f8cf4036b902a326e1c54 --- muranoagent/common/messaging/mqclient.py | 4 ++-- requirements.txt | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/muranoagent/common/messaging/mqclient.py b/muranoagent/common/messaging/mqclient.py index ee188b3f..e347182c 100644 --- a/muranoagent/common/messaging/mqclient.py +++ b/muranoagent/common/messaging/mqclient.py @@ -16,8 +16,8 @@ import random import ssl as ssl_module -import anyjson import eventlet +import json import kombu from oslo_service import sslutils @@ -138,7 +138,7 @@ class MqClient(object): producer.publish( exchange=str(exchange), routing_key=str(key), - body=anyjson.dumps(message.body), + body=json.dumps(message.body), message_id=str(message.id) ) diff --git a/requirements.txt b/requirements.txt index d46876c7..b644c4e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,6 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. pbr>=5.5.1 # Apache-2.0 -anyjson>=0.3.3 # BSD eventlet>=0.30.1 # MIT GitPython>=3.0.5 # BSD License (3 clause) kombu>=4.6.1 # BSD