Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failed tests caused by syntax change in the server side #192

Merged
merged 4 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion nebula2/gclient/net/Connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


import time
from nebula2.Config import SSL_config
Aiee marked this conversation as resolved.
Show resolved Hide resolved

from nebula2.fbthrift.transport import TSocket, TTransport, TSSLSocket
from nebula2.fbthrift.transport.TTransport import TTransportException
Expand Down Expand Up @@ -34,6 +35,7 @@ def __init__(self):
self._ip = None
self._port = None
self._timeout = 0
self._ssl_conf = None

def open(self, ip, port, timeout):
"""open the connection
Expand All @@ -57,6 +59,7 @@ def open_SSL(self, ip, port, timeout, ssl_config=None):
self._ip = ip
self._port = port
self._timeout = timeout
self._ssl_conf = ssl_config
try:
if ssl_config is not None:
s = TSSLSocket.TSSLSocket(
Expand Down Expand Up @@ -92,7 +95,10 @@ def _reopen(self):
:return:
"""
self.close()
self.open(self._ip, self._port, self._timeout)
if self._ssl_conf != None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not None or if not self._ssl_conf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the correction. Seems I messed up with cpp syntax.

self.open_SSL(self._ip, self._port, self._timeout, self._ssl_conf)
else:
self.open(self._ip, self._port, self._timeout)

def authenticate(self, user_name, password):
"""authenticate to graphd
Expand Down
1 change: 0 additions & 1 deletion tests/test_ssl_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def setup_class(self):
# self signed SSL config
self.ssl_selfs_signed_config = SSL_config()
self.ssl_selfs_signed_config.cert_reqs = ssl.CERT_OPTIONAL
self.ssl_selfs_signed_config.cert_reqs = ssl.CERT_OPTIONAL
self.ssl_selfs_signed_config.ca_certs = os.path.join(
current_dir, 'secrets/test.self-signed.pem'
)
Expand Down