Fixes #6411 Return None for ec2 api endpoints that return 404

This commit is contained in:
James Tanner 2014-03-11 21:38:00 -04:00
parent bb047b9e89
commit 6da2c37112

View file

@ -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 = {}