mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
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
This commit is contained in:
@@ -120,18 +120,6 @@ except ImportError:
|
||||
HAS_BOTO = False
|
||||
|
||||
|
||||
def boto_exception(err):
|
||||
'''generic error message handler'''
|
||||
if hasattr(err, 'error_message'):
|
||||
error = err.error_message
|
||||
elif hasattr(err, 'message'):
|
||||
error = err.message
|
||||
else:
|
||||
error = '%s: %s' % (Exception, err)
|
||||
|
||||
return error
|
||||
|
||||
|
||||
def cert_meta(iam, name):
|
||||
certificate = iam.get_server_certificate(name).get_server_certificate_result.server_certificate
|
||||
ocert = certificate.certificate_body
|
||||
|
||||
Reference in New Issue
Block a user