Skip to content

Commit

Permalink
Fix AttributeError when running ec2_metadata_facts
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Oct 7, 2022
1 parent 6d0d5ad commit a419b26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- ec2_metadata_facts - fixed ``AttributeError`` (https://github.com/ansible-collections/amazon.aws/issues/1134).
2 changes: 1 addition & 1 deletion plugins/modules/ec2_metadata_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def fetch(self, uri, recurse=True):
self._data['%s' % (new_uri)] = content
for (key, value) in json_dict.items():
self._data['%s:%s' % (new_uri, key.lower())] = value
except json.JSONDecodeError:
except (json.JSONDecodeError, AttributeError):
self._data['%s' % (new_uri)] = content # not a stringified JSON string

def fix_invalid_varnames(self, data):
Expand Down

0 comments on commit a419b26

Please sign in to comment.