support ssl in quantum client

Registered by yong sheng gong

make sure quantum client support ssl quantum server

Blueprint information

Status:
Complete
Approver:
yong sheng gong
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Approved
Series goal:
Accepted for 2.0
Implementation:
Implemented
Milestone target:
milestone icon 2.2.1-2.2.6
Started by
Akihiro Motoki
Completed by
Akihiro Motoki

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/quantum-client-ssl,n,z

Addressed by: https://review.openstack.org/24776
    Handle SSL certificates validation properly.

Addressed by: https://review.openstack.org/27270
    Don't convert httplib2 exceptions to status codes
[yong sheng gong]: I think 27270 is safe to get in (I mean the compatibility):
before it:
>>> from quantumclient.quantum import client
>>> quantum = client.Client('2.0', endpoint_url='http://test4/', token='OS_TOKEN')
>>> quantum.create_network({'network':{}})
REQ: curl -i http://test4//v2.0/networks.json -X POST -H "X-Auth-Token: OS_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-quantumclient" -d '{"network": {}}'

RESP:{'status': '400', 'content-length': 34, 'content-type': 'text/plain'} Unable to find the server at test4

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "quantumclient/v2_0/client.py", line 108, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "quantumclient/v2_0/client.py", line 297, in create_network
    return self.post(self.networks_path, body=body)
  File "quantumclient/v2_0/client.py", line 847, in post
    headers=headers, params=params)
  File "quantumclient/v2_0/client.py", line 770, in do_request
    self._handle_fault_response(status_code, replybody)
  File "quantumclient/v2_0/client.py", line 740, in _handle_fault_response
    exception_handler_v20(status_code, des_error_body)
  File "quantumclient/v2_0/client.py", line 88, in exception_handler_v20
    message=message)
quantumclient.common.exceptions.QuantumClientException: Unable to find the server at test4

after it:
>>> from quantumclient.quantum import client
>>> quantum = client.Client('2.0', endpoint_url='http://test4/', token='OS_TOKEN')
>>> quantum.create_network({'network':{}})

REQ: curl -i http://test4//v2.0/networks.json -X POST -H "X-Auth-Token: OS_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-quantumclient" -d '{"network": {}}'

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "quantumclient/v2_0/client.py", line 108, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "quantumclient/v2_0/client.py", line 313, in create_network
    return self.post(self.networks_path, body=body)
  File "quantumclient/v2_0/client.py", line 1016, in post
    headers=headers, params=params)
  File "quantumclient/v2_0/client.py", line 930, in do_request
    resp, replybody = self.httpclient.do_request(action, method, body=body)
  File "quantumclient/client.py", line 163, in do_request
    **kwargs)
  File "quantumclient/client.py", line 139, in _cs_request
    raise exceptions.ConnectionFailed(reason=e)
quantumclient.common.exceptions.ConnectionFailed: Connection to quantum failed: Unable to find the server at test4

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.