Skip to content

Commit

Permalink
Merge pull request #498 from jasonjohnson/rest-transport-cert-verify
Browse files Browse the repository at this point in the history
Update RestTransport to honor verify and cert settings
  • Loading branch information
sudorandom committed Mar 4, 2015
2 parents 6240a96 + ed70e00 commit 61710a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SoftLayer/tests/transport_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ def test_basic(self, request):
request.assert_called_with(
'GET', 'http://something.com/SoftLayer_Service/Resource.json',
headers={},
verify=True,
cert=None,
proxies=None,
timeout=None)

Expand Down Expand Up @@ -305,6 +307,8 @@ def test_valid_proxy(self, request):
'GET', 'http://something.com/SoftLayer_Service/Resource.json',
proxies={'https': 'http://localhost:3128',
'http': 'http://localhost:3128'},
verify=True,
cert=None,
timeout=mock.ANY,
headers=mock.ANY)

Expand All @@ -325,6 +329,8 @@ def test_with_id(self, request):
'GET',
'http://something.com/SoftLayer_Service/getObject/2.json',
headers={},
verify=True,
cert=None,
proxies=None,
timeout=None)

Expand Down
2 changes: 2 additions & 0 deletions SoftLayer/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def __call__(self, request):
resp = requests.request('GET', url,
headers=request.transport_headers,
timeout=request.timeout,
verify=request.verify,
cert=request.cert,
proxies=_proxies_dict(request.proxy))
LOGGER.debug("=== RESPONSE ===")
LOGGER.debug(resp.headers)
Expand Down

0 comments on commit 61710a2

Please sign in to comment.