Remove use of simplejson throughout code base (#43548)

* Remove use of simplejson throughout code base. Fixes #42761

* Address failing tests

* Remove simplejson from contrib and other outlying files

* Add changelog fragment for simplejson removal
This commit is contained in:
Matt Martz 2018-08-10 11:13:29 -05:00 committed by GitHub
commit c1c229c6d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 73 additions and 285 deletions

View file

@ -46,10 +46,7 @@ import sys
import time
import ConfigParser
try:
import json
except ImportError:
import simplejson as json
import json
from ansible.module_utils.urls import open_url

View file

@ -42,10 +42,7 @@ from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import libcloud.security as sec
try:
import json
except ImportError:
import simplejson as json
import json
class LibcloudInventory(object):

View file

@ -84,10 +84,7 @@ try:
except ImportError:
from configparser import ConfigParser
try:
import json
except ImportError:
import simplejson as json
import json
try:
import libbrook

View file

@ -31,10 +31,7 @@ from requests.auth import HTTPBasicAuth
import warnings
from ansible.errors import AnsibleError
try:
import json
except ImportError:
import simplejson as json
import json
class CloudFormsInventory(object):

View file

@ -74,12 +74,7 @@ from __future__ import print_function
import sys
import argparse
try:
import json
except:
import simplejson as json
import json
try:
from cs import CloudStack, CloudStackException, read_config

View file

@ -65,10 +65,7 @@ import re
from time import time
import xmlrpclib
try:
import json
except ImportError:
import simplejson as json
import json
from six import iteritems

View file

@ -75,10 +75,7 @@ import sys
from time import time
import traceback
try:
import json
except ImportError:
import simplejson as json
import json
from six import iteritems
from six.moves.urllib.parse import urlencode

View file

@ -191,10 +191,7 @@ if os.getenv('ANSIBLE_INVENTORY_CONSUL_IO_LOG_ENABLED'):
setup_logging()
try:
import json
except ImportError:
import simplejson as json
import json
try:
import consul

View file

@ -149,10 +149,7 @@ try:
except ImportError:
import configparser as ConfigParser
try:
import json
except ImportError:
import simplejson as json
import json
class DoManager:

View file

@ -179,10 +179,7 @@ except ImportError:
from six.moves import configparser
from collections import defaultdict
try:
import json
except ImportError:
import simplejson as json
import json
DEFAULTS = {
'all_elasticache_clusters': 'False',

View file

@ -29,10 +29,7 @@ import subprocess
import re
import string
from optparse import OptionParser
try:
import json
except:
import simplejson as json
import json
# Options
# ------------------------------

View file

@ -101,10 +101,7 @@ else:
import logging
logging.getLogger('libcloud.common.google').addHandler(logging.NullHandler())
try:
import json
except ImportError:
import simplejson as json
import json
try:
from libcloud.compute.types import Provider

View file

@ -40,10 +40,7 @@ import sys
from landscape_api.base import API, HTTPError
try:
import json
except ImportError:
import simplejson as json
import json
_key = 'landscape'

View file

@ -81,10 +81,7 @@ import sys
import argparse
from time import time
try:
import json
except ImportError:
import simplejson as json
import json
try:
from chube import load_chube_config

View file

@ -28,10 +28,7 @@ version_added: None
author: Michael Scherer
'''
try:
import json
except ImportError:
import simplejson as json
import json
import os
import os.path
import sys

View file

@ -59,10 +59,7 @@ import time
from distutils.version import StrictVersion
from io import StringIO
try:
import json
except:
import simplejson as json
import json
import openstack as sdk
from openstack.cloud import inventory as sdk_inventory

View file

@ -71,11 +71,7 @@ import argparse
import ConfigParser
from collections import defaultdict
try:
import json
except ImportError:
# noinspection PyUnresolvedReferences,PyPackageRequirements
import simplejson as json
import json
try:
# noinspection PyUnresolvedReferences

View file

@ -70,10 +70,7 @@ try:
except ImportError:
import configparser
try:
import json
except ImportError:
import simplejson as json
import json
try:
import ovirtsdk4 as sdk

View file

@ -55,10 +55,7 @@ except ImportError as e:
import traceback
try:
import json
except ImportError:
import simplejson as json
import json
ini_section = 'packet'

View file

@ -25,10 +25,7 @@
#
# { "groups": ["utility", "databases"], "a": false, "b": true }
try:
import json
except ImportError:
import simplejson as json
import json
import os
import sys
from optparse import OptionParser

View file

@ -155,10 +155,7 @@ import ConfigParser
from six import iteritems
try:
import json
except ImportError:
import simplejson as json
import json
try:
import pyrax

View file

@ -59,10 +59,7 @@ from time import time
from ansible.module_utils.six.moves import configparser
from ansible.module_utils.six.moves.urllib.parse import urlparse
try:
import json
except ImportError:
import simplejson as json
import json
class RudderInventory(object):

View file

@ -47,10 +47,7 @@ import sys
import time
import traceback
try:
import json
except ImportError:
import simplejson as json
import json
EMPTY_GROUP = {
'children': [],

View file

@ -38,10 +38,7 @@ import sys
# https://pypi.org/project/serfclient/
from serfclient import SerfClient, EnvironmentConfig
try:
import json
except ImportError:
import simplejson as json
import json
_key = 'serf'

View file

@ -36,10 +36,7 @@ import SoftLayer
import re
import argparse
import itertools
try:
import json
except:
import simplejson as json
import json
class SoftLayerInventory(object):

View file

@ -48,13 +48,10 @@ import time
from optparse import OptionParser
import subprocess
import ConfigParser
import json
from six import iteritems
try:
import json
except:
import simplejson as json
base_dir = os.path.dirname(os.path.realpath(__file__))
default_ini_file = os.path.join(base_dir, "spacewalk.ini")

View file

@ -45,10 +45,7 @@ import os.path
import sys
from collections import MutableSequence
try:
import json
except ImportError:
import simplejson as json
import json
import paramiko

View file

@ -49,10 +49,7 @@ import sys
import yaml
from distutils.version import StrictVersion
try:
import json
except:
import simplejson as json
import json
try:
import requests

View file

@ -40,10 +40,7 @@ import re
from paramiko import SSHConfig
from optparse import OptionParser
from collections import defaultdict
try:
import json
except Exception:
import simplejson as json
import json
from ansible.module_utils._text import to_text
from ansible.module_utils.six.moves import StringIO

View file

@ -18,10 +18,7 @@
import sys
from subprocess import Popen, PIPE
try:
import json
except ImportError:
import simplejson as json
import json
class SetEncoder(json.JSONEncoder):

View file

@ -49,10 +49,7 @@ except:
file=sys.stderr)
sys.exit(1)
try:
import json
except:
import simplejson as json
import json
class ZabbixInventory(object):