mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixes #6411 Return None for ec2 api endpoints that return 404
This commit is contained in:
parent
bb047b9e89
commit
6da2c37112
1 changed files with 5 additions and 1 deletions
|
@ -71,7 +71,11 @@ class Ec2Metadata(object):
|
||||||
|
|
||||||
def _fetch(self, url):
|
def _fetch(self, url):
|
||||||
(response, info) = fetch_url(self.module, url, force=True)
|
(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']):
|
def _mangle_fields(self, fields, uri, filter_patterns=['public-keys-0']):
|
||||||
new_fields = {}
|
new_fields = {}
|
||||||
|
|
Loading…
Reference in a new issue