mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
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:
parent
96346938ee
commit
c1c229c6d4
55 changed files with 73 additions and 285 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -149,10 +149,7 @@ try:
|
|||
except ImportError:
|
||||
import configparser as ConfigParser
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
import json
|
||||
|
||||
|
||||
class DoManager:
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
# ------------------------------
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -55,10 +55,7 @@ except ImportError as e:
|
|||
import traceback
|
||||
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
import json
|
||||
|
||||
|
||||
ini_section = 'packet'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -155,10 +155,7 @@ import ConfigParser
|
|||
|
||||
from six import iteritems
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
import json
|
||||
|
||||
try:
|
||||
import pyrax
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -47,10 +47,7 @@ import sys
|
|||
import time
|
||||
import traceback
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
import json
|
||||
|
||||
EMPTY_GROUP = {
|
||||
'children': [],
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -49,10 +49,7 @@ except:
|
|||
file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import json
|
||||
except:
|
||||
import simplejson as json
|
||||
import json
|
||||
|
||||
|
||||
class ZabbixInventory(object):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue