Skip to content

Commit cf6dd62

Browse files
committed
Drop direct dependency on simplejson
The simplejson library is not included by the requirements but it was directly imported. Drop the direct inclusion and use the alias in the requests library to avoid ImportError caused by missing simplejson in the environment. Also fix the missing requests library in requirements. Change-Id: I8713f45c5f2717cc53ba043aaeb479e72f641f78
1 parent bb459d4 commit cf6dd62

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openstackclient/api/api.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
#
1313

1414
"""Base API Library"""
15-
1615
from keystoneauth1 import exceptions as ks_exceptions
1716
from keystoneauth1 import session as ks_session
1817
from osc_lib import exceptions
19-
import simplejson as json
18+
import requests
2019

2120
from openstackclient.i18n import _
2221

@@ -118,7 +117,7 @@ def create(self, url, session=None, method=None, **params):
118117
# Should this move into _requests()?
119118
try:
120119
return ret.json()
121-
except json.JSONDecodeError:
120+
except requests.JSONDecodeError:
122121
return ret
123122

124123
def delete(self, url, session=None, **params):
@@ -169,7 +168,7 @@ def list(self, path, session=None, body=None, detailed=False, **params):
169168
)
170169
try:
171170
return ret.json()
172-
except json.JSONDecodeError:
171+
except requests.JSONDecodeError:
173172
return ret
174173

175174
# Layered actions built on top of the basic action methods do not

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ oslo.i18n>=3.15.3 # Apache-2.0
1313
python-keystoneclient>=3.22.0 # Apache-2.0
1414
python-novaclient>=18.1.0 # Apache-2.0
1515
python-cinderclient>=3.3.0 # Apache-2.0
16+
requests>=2.14.2 # Apache-2.0
1617
stevedore>=2.0.1 # Apache-2.0

0 commit comments

Comments
 (0)