Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opensearch: avoid a KeyError during the DomainConfig reading #1910

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/opensearch_domainconfig_no_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- "opensearch - Don't try to read a non existing key from the domain config (https://github.com/ansible-collections/community.aws/pull/1910)."
3 changes: 2 additions & 1 deletion plugins/module_utils/opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def get_domain_config(client, module, domain_name):
arn = None
if response is not None:
for k in response["DomainConfig"]:
domain_config[k] = response["DomainConfig"][k]["Options"]
if "Options" in response["DomainConfig"][k]:
domain_config[k] = response["DomainConfig"][k]["Options"]
domain_config["DomainName"] = domain_name
# If ES cluster is attached to the Internet, the "VPCOptions" property is not present.
if "VPCOptions" in domain_config:
Expand Down