Assorted pylint fixes

This commit is contained in:
Dag Wieers 2019-02-14 21:02:27 +01:00 committed by Matt Clay
parent 8e0f95951d
commit f9ab9b4d68
65 changed files with 343 additions and 473 deletions

View file

@ -1,4 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@ -181,7 +183,7 @@ def get_api_definitions(module, swagger_file=None, swagger_dict=None, swagger_te
with open(swagger_file) as f:
apidata = f.read()
except OSError as e:
msg = "Failed trying to read swagger file {}: {}".format(str(swagger_file), str(e))
msg = "Failed trying to read swagger file {0}: {1}".format(str(swagger_file), str(e))
module.fail_json(msg=msg, exception=traceback.format_exc())
if swagger_dict is not None:
apidata = json.dumps(swagger_dict)
@ -216,7 +218,7 @@ def delete_rest_api(module, client, api_id):
try:
delete_response = delete_api(client, api_id=api_id)
except (botocore.exceptions.ClientError, botocore.exceptions.EndpointConnectionError) as e:
module.fail_json_aws(e, msg="deleting API {}".format(api_id))
module.fail_json_aws(e, msg="deleting API {0}".format(api_id))
return delete_response
@ -235,7 +237,7 @@ def ensure_api_in_correct_state(module, client, api_id=None, api_data=None, stag
try:
configure_response = configure_api(client, api_data=api_data, api_id=api_id)
except (botocore.exceptions.ClientError, botocore.exceptions.EndpointConnectionError) as e:
module.fail_json_aws(e, msg="configuring API {}".format(api_id))
module.fail_json_aws(e, msg="configuring API {0}".format(api_id))
deploy_response = None
@ -244,7 +246,7 @@ def ensure_api_in_correct_state(module, client, api_id=None, api_data=None, stag
deploy_response = create_deployment(client, api_id=api_id, stage=stage,
description=deploy_desc)
except (botocore.exceptions.ClientError, botocore.exceptions.EndpointConnectionError) as e:
msg = "deploying api {} to stage {}".format(api_id, stage)
msg = "deploying api {0} to stage {1}".format(api_id, stage)
module.fail_json_aws(e, msg)
return configure_response, deploy_response