make Sessions uppercase in connect, and log redirects

This commit is contained in:
Devananda van der Veen
2015-03-31 16:23:23 -07:00
parent d05c829736
commit 8d36961e55

View File

@@ -147,7 +147,7 @@ class RedfishConnection(object):
# TODO: cache the token returned by this call # TODO: cache the token returned by this call
auth_dict = {'Password': self.password, 'UserName': self.user_name} auth_dict = {'Password': self.password, 'UserName': self.user_name}
self.rest_post('/rest/v1/sessions', None, json.dumps(auth_dict)) self.rest_post('/rest/v1/Sessions', None, json.dumps(auth_dict))
# TODO: do some schema discovery here and cache the result # TODO: do some schema discovery here and cache the result
LOG.debug('Connection established to host %s.', self.host) LOG.debug('Connection established to host %s.', self.host)
@@ -220,6 +220,8 @@ class RedfishConnection(object):
# Follow HTTP redirect # Follow HTTP redirect
if resp.status == 301 and 'location' in headers: if resp.status == 301 and 'location' in headers:
url = urlparse(headers['location']) url = urlparse(headers['location'])
# TODO: cache these redirects
LOG.debug("Following redirect to %s", headers['location'])
redir_count -= 1 redir_count -= 1
else: else:
break break