[autotest] Use |json| instead of |simplejson|.
simplejson was moved into the library as of python 2.4. We're now at
python 2.6/2.7, and having to keep installing simplejson everywhere has
slowly turned into a hassle. Since we can just trivially drop/rename
it, let's do so.
The rpc_interface parts of this change have been vetted, the rest is
done just as a s/simplejson/json/ across the code, which afaik should be
a safe thing to do.
BUG=None
TEST=unit, run_suite
DEPLOY=apache
Change-Id: Iab35f71157e7e5cd3be5291c776b07eb3283be8e
Reviewed-on: https://gerrit.chromium.org/gerrit/46424
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
diff --git a/frontend/shared/resource_lib.py b/frontend/shared/resource_lib.py
index 86cc583..254e92f 100644
--- a/frontend/shared/resource_lib.py
+++ b/frontend/shared/resource_lib.py
@@ -3,7 +3,7 @@
import django.core.exceptions
from django.core import urlresolvers
from django.utils import datastructures
-import simplejson
+import json
from autotest_lib.frontend.shared import exceptions, query_lib
from autotest_lib.frontend.afe import model_logic
@@ -203,7 +203,7 @@
query_parameters = self._query_parameters_response()
if query_parameters:
content['query_parameters'] = query_parameters
- encoded_content = simplejson.dumps(content)
+ encoded_content = json.dumps(content)
return http.HttpResponse(encoded_content,
content_type=_JSON_CONTENT_TYPE)
@@ -214,7 +214,7 @@
raw_data = self._request.raw_post_data
if content_type == _JSON_CONTENT_TYPE:
try:
- raw_dict = simplejson.loads(raw_data)
+ raw_dict = json.loads(raw_data)
except ValueError, exc:
raise exceptions.BadRequest('Error decoding request body: '
'%s\n%r' % (exc, raw_data))
@@ -228,7 +228,7 @@
value = values[-1] # take last value if multiple were given
try:
# attempt to parse numbers, booleans and nulls
- raw_dict[key] = simplejson.loads(value)
+ raw_dict[key] = json.loads(value)
except ValueError:
# otherwise, leave it as a string
raw_dict[key] = value