Update for modules which import json.

Some do not use the json module directly so don't need import json.
Some needed to fallback to simplejson with no traceback if neither was installed

Fixes #1298
This commit is contained in:
Toshio Kuratomi 2016-01-11 12:47:21 -08:00 committed by Matt Clay
parent db051ff9d2
commit ad0d2c1747
22 changed files with 85 additions and 37 deletions

View file

@ -95,7 +95,6 @@ task:
sample: "TODO: include sample"
'''
try:
import json
import boto
import botocore
HAS_BOTO = True
@ -120,7 +119,7 @@ class EcsExecManager:
module.fail_json(msg="Region must be specified as a parameter, in EC2_REGION or AWS_REGION environment variables or in boto configuration file")
self.ecs = boto3_conn(module, conn_type='client', resource='ecs', region=region, endpoint=ec2_url, **aws_connect_kwargs)
except boto.exception.NoAuthHandlerFound, e:
self.module.fail_json(msg=str(e))
module.fail_json(msg="Can't authorize connection - "+str(e))
def list_tasks(self, cluster_name, service_name, status):
response = self.ecs.list_tasks(