Skip to content

Commit

Permalink
fix: TOOLS-2976 manage truncate fails when set DNE
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Schmidt committed Oct 3, 2024
1 parent e6fc77b commit 1543496
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/live_cluster/client/assocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ async def _create_socket_for_addrinfo(self, addrinfo):

"""We are creating our own socket, optionally wrapping it with an SSL.Context (not the same as ssl.SSLContext)
to get an SSL.Connection (same interface as a socket.socket). Further up the stack we pass this socket to asyncio.open_connection
to create streams. The perfered way of creating a socket would be to
to create streams. The preferred way of creating a socket would be to
allow asyncio create the socket (ssl or not) by passing the ssl_context (or None) to asyncio.open_connection. However, ssl_context must
be an instance of ssl.SSLContext, which is not compatible with SSL.Context which is what we use. SSL.Context enables a higher level
of control over certificate verification which we need (see ./ssl_context.py). Another solution might be to create a custom implementation
of he asyncio Transport that uses pyOpenSSL.SSL.Context (or use https://github.com/horazont/aioopenssl) but that would be a
of the asyncio Transport that uses pyOpenSSL.SSL.Context (or use https://github.com/horazont/aioopenssl) but that would be a
considerable amount of work.
"""
await asyncio.wait_for(
Expand Down
2 changes: 1 addition & 1 deletion lib/live_cluster/client/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ async def info_all_namespace_statistics(self):
async def info_set_statistics(self, namespace, set_):
set_stat = await self._info("sets/{}/{}".format(namespace, set_))

if set_stat[-1] == ";":
if set_stat and set_stat[-1] == ";":
set_stat = client_util.info_colon_to_dict(set_stat[0:-1])
else:
set_stat = client_util.info_colon_to_dict(set_stat)
Expand Down

0 comments on commit 1543496

Please sign in to comment.