[ovs-dev] [PATCH] python: Add SSL support to the python ovs client library

Numan Siddique nusiddiq at redhat.com
Wed Oct 5 11:12:31 UTC 2016


>
>
>
> stderr:
> Traceback (most recent call last):
>   File "../../../../tests/test-ovsdb.py", line 835, in <module>
>     main(sys.argv)
>   File "../../../../tests/test-ovsdb.py", line 830, in main
>     func(*args)
>   File "../../../../tests/test-ovsdb.py", line 592, in do_idl
>     while idl.change_seqno == seqno and not idl.run():
>   File "/home/blp/nicira/ovs/python/ovs/db/idl.py", line 188, in run
>     self.__send_monitor_request()
>   File "/home/blp/nicira/ovs/python/ovs/db/idl.py", line 431, in
> __send_monitor_request
>     self._session.send(msg)
>   File "/home/blp/nicira/ovs/python/ovs/jsonrpc.py", line 527, in send
>     return self.rpc.send(msg)
>   File "/home/blp/nicira/ovs/python/ovs/jsonrpc.py", line 243, in send
>     self.run()
>   File "/home/blp/nicira/ovs/python/ovs/jsonrpc.py", line 202, in run
>     retval = self.stream.send(self.output)
>   File "/home/blp/nicira/ovs/python/ovs/stream.py", line 461, in send
>     return super(SSLStream, self).send(buf)
>   File "/home/blp/nicira/ovs/python/ovs/stream.py", line 239, in send
>     return self.socket.send(buf)
>   File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 947, in
> send
>     raise TypeError("data must be a byte string")
> TypeError: data must be a byte string
>


​Thanks Ben for the review and testing it out.
I was able to reproduce the failure with pyOpenSSL version 0.14. This issue
is not seen with
the latest version 16 of pyOpenSSL. The send funciton of latest version
works because it checks and converts the buffer to byte string where as
0.14 doesn't.
https://github.com/pyca/pyopenssl/blob/master/src/OpenSSL/SSL.py#L1246

I will re-spin another patch with the fix.

Thanks
Numan

​


> stdout:
> ../../tests/ovsdb-idl.at:1232: exit code was 1, expected 0
> 2078. ovsdb-idl.at:1232: 2078. simple idl verify notify - SSL (
> ovsdb-idl.at:1232): FAILED (ovsdb-idl.at:1232)
>



More information about the dev mailing list