mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Extend module_defaults by adding default groups for cloud modules (#44127)
Extends `module_defaults` by adding a prefix to defaults `group/` which denotes a builtin list of modules. Initial groups are: `group/aws`, `group/azure`, and `group/gcp`
This commit is contained in:
@@ -53,6 +53,7 @@ except ImportError:
|
||||
pass # will be detected by imported HAS_BOTO3
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils._text import to_native
|
||||
from ansible.module_utils.ec2 import (boto3_conn, ec2_argument_spec, HAS_BOTO3, camel_dict_to_snake_dict,
|
||||
get_aws_connection_info)
|
||||
|
||||
@@ -67,7 +68,7 @@ def get_bucket_list(module, connection):
|
||||
try:
|
||||
buckets = camel_dict_to_snake_dict(connection.list_buckets())['buckets']
|
||||
except botocore.exceptions.ClientError as e:
|
||||
module.fail_json(msg=e.message, exception=traceback.format_exc(), **camel_dict_to_snake_dict(e.response))
|
||||
module.fail_json(msg=to_native(e), exception=traceback.format_exc(), **camel_dict_to_snake_dict(e.response))
|
||||
|
||||
return buckets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user