[backport 2.7] Fixes HTTP redirect issue (#45513) (#47822)

* Fixes HTTP redirect issue (#45513)

(cherry picked from commit e701b5a412)

* add changelog fragment
This commit is contained in:
Jacob 2018-11-01 13:10:44 -04:00 committed by Toshio Kuratomi
parent 951572bec1
commit e6ed883ffd
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "Fix issue with HTTP redirects with redfish_facts module (https://github.com/ansible/ansible/pull/45704)"

View file

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