mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-26 16:36:29 +00:00
Fixes #6411 Return None for ec2 api endpoints that return 404
This commit is contained in:
@@ -71,7 +71,11 @@ class Ec2Metadata(object):
|
||||
|
||||
def _fetch(self, url):
|
||||
(response, info) = fetch_url(self.module, url, force=True)
|
||||
return response.read()
|
||||
if response:
|
||||
data = response.read()
|
||||
else:
|
||||
data = None
|
||||
return data
|
||||
|
||||
def _mangle_fields(self, fields, uri, filter_patterns=['public-keys-0']):
|
||||
new_fields = {}
|
||||
|
||||
Reference in New Issue
Block a user