From 00cdc83150a16168b089ca29efb07bfd6b5887c9 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 5 Nov 2023 18:27:58 +0900 Subject: [PATCH] Drop unused simplejson simplejson is used only when the json module is not avaialble, but recent runtime versions provide the built-in json module. Change-Id: Ife04be18ed3804a90e52025d3a7f688e6daec849 --- requirements.txt | 1 - troveclient/apiclient/client.py | 6 +----- troveclient/client.py | 6 +----- troveclient/compat/client.py | 7 +------ troveclient/tests/test_shell.py | 6 +----- troveclient/utils.py | 8 ++++---- troveclient/v1/shell.py | 6 +----- 7 files changed, 9 insertions(+), 31 deletions(-) diff --git a/requirements.txt b/requirements.txt index bd623cdc..9459683a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,6 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0 PrettyTable>=0.7.2 # BSD requests>=2.14.2 # Apache-2.0 -simplejson>=3.5.1 # MIT oslo.i18n>=3.15.3 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0 keystoneauth1>=3.4.0 # Apache-2.0 diff --git a/troveclient/apiclient/client.py b/troveclient/apiclient/client.py index a95154c0..5c036a09 100644 --- a/troveclient/apiclient/client.py +++ b/troveclient/apiclient/client.py @@ -25,14 +25,10 @@ OpenStack Client interface. Handles the REST calls and responses. # E0202: An attribute inherited from %s hide this method # pylint: disable=E0202 +import json import logging import time -try: - import simplejson as json -except ImportError: - import json - import requests from oslo_utils import importutils diff --git a/troveclient/client.py b/troveclient/client.py index 69aa44be..e92b8074 100644 --- a/troveclient/client.py +++ b/troveclient/client.py @@ -19,6 +19,7 @@ OpenStack Client interface. Handles the REST calls and responses. """ +import json import logging from keystoneauth1 import adapter @@ -35,11 +36,6 @@ try: except ImportError: import time as sleep_lib -try: - import json -except ImportError: - import simplejson as json - osprofiler_web = importutils.try_import("osprofiler.web") diff --git a/troveclient/compat/client.py b/troveclient/compat/client.py index 9dfa2844..f0e8b638 100644 --- a/troveclient/compat/client.py +++ b/troveclient/compat/client.py @@ -14,17 +14,12 @@ # under the License. import httplib2 +import json import logging import os import sys import time -try: - import json -except ImportError: - import simplejson as json - - from troveclient.compat import auth from troveclient.compat import exceptions diff --git a/troveclient/tests/test_shell.py b/troveclient/tests/test_shell.py index b062c8ac..0d774394 100644 --- a/troveclient/tests/test_shell.py +++ b/troveclient/tests/test_shell.py @@ -12,6 +12,7 @@ # under the License. import io +import json import re import sys from unittest import mock @@ -26,11 +27,6 @@ import troveclient.client from troveclient import exceptions import troveclient.shell -try: - import json -except ImportError: - import simplejson as json - V2_URL = "http://no.where/v2.0" V3_URL = "http://no.where/v3" diff --git a/troveclient/utils.py b/troveclient/utils.py index 04645b65..54318795 100644 --- a/troveclient/utils.py +++ b/troveclient/utils.py @@ -14,16 +14,16 @@ # License for the specific language governing permissions and limitations # under the License. +import base64 +import json +import os +import sys import uuid -import base64 from openstackclient.identity import common as identity_common -import os from oslo_utils import encodeutils from oslo_utils import uuidutils import prettytable -import simplejson as json -import sys from troveclient.apiclient import exceptions diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py index f4447c66..5716c78c 100644 --- a/troveclient/v1/shell.py +++ b/troveclient/v1/shell.py @@ -15,16 +15,12 @@ # under the License. import argparse +import json import sys import time from troveclient.i18n import _ -try: - import simplejson as json -except ImportError: - import json - from troveclient import exceptions from troveclient import utils from troveclient.v1 import modules