Fix bug in data returns for some queries used by facts module (#52832)

* Fix bug in data returns for some queries used by facts module

* Add additional query to return all servers (up to 5000)

* Fix key checking in rest_api
This commit is contained in:
David Soper
2019-03-26 08:57:46 -05:00
committed by John R Barker
parent be293fbe50
commit e8cddfd452
3 changed files with 9 additions and 5 deletions

View File

@@ -190,8 +190,9 @@ class IntersightModule():
except Exception as e:
self.module.fail_json(msg="API error: %s " % str(e))
if response.length > 0:
return json.loads(response.read())
response_data = response.read()
if len(response_data) > 0:
return json.loads(response_data)
return {}
def intersight_call(self, http_method="", resource_path="", query_params=None, body=None, moid=None, name=None):