1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixes HTTP redirect issue (#45513)

This commit is contained in:
Jose Delarosa 2018-09-13 22:14:21 -05:00 committed by Sviatoslav Sydorenko
parent 34b8cbd365
commit e701b5a412

View file

@ -27,7 +27,8 @@ class RedfishUtils(object):
url_username=self.creds['user'], url_username=self.creds['user'],
url_password=self.creds['pswd'], url_password=self.creds['pswd'],
force_basic_auth=True, validate_certs=False, force_basic_auth=True, validate_certs=False,
timeout=10, use_proxy=False) follow_redirects='all',
use_proxy=False)
data = json.loads(resp.read()) data = json.loads(resp.read())
except HTTPError as e: except HTTPError as e:
return {'ret': False, 'msg': "HTTP Error: %s" % e.code} return {'ret': False, 'msg': "HTTP Error: %s" % e.code}
@ -45,6 +46,7 @@ class RedfishUtils(object):
url_username=self.creds['user'], url_username=self.creds['user'],
url_password=self.creds['pswd'], url_password=self.creds['pswd'],
force_basic_auth=True, validate_certs=False, force_basic_auth=True, validate_certs=False,
follow_redirects='all',
use_proxy=False) use_proxy=False)
except HTTPError as e: except HTTPError as e:
return {'ret': False, 'msg': "HTTP Error: %s" % e.code} return {'ret': False, 'msg': "HTTP Error: %s" % e.code}
@ -62,6 +64,7 @@ class RedfishUtils(object):
url_username=self.creds['user'], url_username=self.creds['user'],
url_password=self.creds['pswd'], url_password=self.creds['pswd'],
force_basic_auth=True, validate_certs=False, force_basic_auth=True, validate_certs=False,
follow_redirects='all',
use_proxy=False) use_proxy=False)
except HTTPError as e: except HTTPError as e:
return {'ret': False, 'msg': "HTTP Error: %s" % e.code} return {'ret': False, 'msg': "HTTP Error: %s" % e.code}
@ -79,6 +82,7 @@ class RedfishUtils(object):
url_username=self.creds['user'], url_username=self.creds['user'],
url_password=self.creds['pswd'], url_password=self.creds['pswd'],
force_basic_auth=True, validate_certs=False, force_basic_auth=True, validate_certs=False,
follow_redirects='all',
use_proxy=False) use_proxy=False)
except HTTPError as e: except HTTPError as e:
return {'ret': False, 'msg': "HTTP Error: %s" % e.code} return {'ret': False, 'msg': "HTTP Error: %s" % e.code}