2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Add missing headers

Some implementations balk at lack of 'Accept' header.

Change-Id: I99d840e7357a7c0d04bcbd1bb7695c8512be0281
This commit is contained in:
Jarrod Johnson 2019-03-22 14:42:57 -04:00
parent 0bdf26f8c9
commit b45253eacd

View File

@ -142,9 +142,11 @@ class Command(object):
self._storedsysinfvintage = 0
self._varupdateservice = None
self._varfwinventory = None
self.wc.set_header('Accept', 'application/json')
self.wc.set_header('User-Agent', 'pyghmi')
overview = self.wc.grab_json_response('/redfish/v1/')
self.wc.set_basic_credentials(userid, password)
self.wc.set_header('Content-Type', 'application/json')
overview = self.wc.grab_json_response('/redfish/v1/')
systems = overview['Systems']['@odata.id']
members = self.wc.grab_json_response(systems)
systems = members['Members']