diff options
author | David M. Lee <leedm777@yahoo.com> | 2017-08-23 10:40:32 -0500 |
---|---|---|
committer | Ryan Brown <sb@ryansb.com> | 2017-08-23 11:40:32 -0400 |
commit | 1d4ca0fd5119ff2d73e7f58e1f121823ca8aa897 (patch) | |
tree | 79abd20ab5344804c7c376163faa8ff17d7540bb /lib/ansible/modules/cloud/amazon/s3_sync.py | |
parent | 587ab3341530572b80d6d8213633ee3fe3cc35dd (diff) | |
download | ansible-1d4ca0fd5119ff2d73e7f58e1f121823ca8aa897.tar.gz |
amazon: extract copies of boto_exception to module_utils.ec2 (#20403)
* amazon: extract boto_exception to ec2 module
This function was copy/pasted throughout several Amazon modules. This
causes a consistency problem, since some improvements to message
formatting were applied to some modules but not others. Now all modules
use the same, improved function.
* Rebase and make requested changes
* Rebase and make requested changes
Diffstat (limited to 'lib/ansible/modules/cloud/amazon/s3_sync.py')
-rw-r--r-- | lib/ansible/modules/cloud/amazon/s3_sync.py | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/ansible/modules/cloud/amazon/s3_sync.py b/lib/ansible/modules/cloud/amazon/s3_sync.py index 407ef53c1d..c094565ced 100644 --- a/lib/ansible/modules/cloud/amazon/s3_sync.py +++ b/lib/ansible/modules/cloud/amazon/s3_sync.py @@ -207,7 +207,7 @@ from dateutil import tz # import module snippets from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.ec2 import camel_dict_to_snake_dict, ec2_argument_spec, boto3_conn, get_aws_connection_info, HAS_BOTO3 +from ansible.module_utils.ec2 import camel_dict_to_snake_dict, ec2_argument_spec, boto3_conn, get_aws_connection_info, HAS_BOTO3, boto_exception try: @@ -217,17 +217,6 @@ except ImportError: pass -def boto_exception(err): - '''generic error message handler''' - if hasattr(err, 'error_message'): - error = err.error_message - elif hasattr(err, 'message'): - error = str(err.message) + ' ' + str(err) + ' - ' + str(type(err)) - else: - error = '%s: %s' % (Exception, err) - - return error - # the following function, calculate_multipart_etag, is from tlastowka # on github and is used under its (compatible) GPL license. So this # license applies to the following function. |