Loading CHANGES.md +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ This section will document changes to the library since the last release ## New features - Added IPv6 address support on all clients (Issue #8) - Added new exception type ClusterVersionFailureException (Requires drive version 2.0.4) ## Bug Fixes - Fixex bug that caused close() and connect() to fail on a connection that faulted (Issue #7) Loading kinetic/baseasync.py +4 −3 Original line number Diff line number Diff line Loading @@ -127,10 +127,11 @@ class BaseAsync(Client): return #skip the rest def innerSuccess(header, value): if (header.command.status.code != messages.Message.Status.SUCCESS) : onError(common.KineticMessageException(header.command.status)) else: try: operations._check_status(header) onSuccess(header, value) except Exception as ex: onError(ex) # get sequence self.update_header(header) Loading kinetic/baseclient.py +0 −4 Original line number Diff line number Diff line Loading @@ -327,10 +327,6 @@ class BaseClient(object): def send(self, header, value): self.network_send(header, value) resp = self.network_recv() if (resp[0].command.status.code != messages.Message.Status.SUCCESS) : raise common.KineticMessageException(resp[0].command.status) return resp ### with statement support ### Loading kinetic/client.py +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ class Client(BaseClient): self.update_header(header) # send message synchronously header, value = self.send(header, value) operations._check_status(header) return op.parse(header, value) except Exception as e: return op.onError(e) Loading kinetic/common.py +7 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ DEFAULT_CONNECT_TIMEOUT = 0.1 DEFAULT_SOCKET_TIMEOUT = 5 DEFAULT_CHUNK_SIZE = 4096 class Entry(object): #RPC: Note, you could build this as a class method, if you wanted the fromMessage to build Loading @@ -42,7 +43,7 @@ class Entry(object): elif (header.command.status.code == messages.Message.Status.NOT_FOUND): return None else: raise KineticMessageException(header.command.status) raise KineticClientException("Invalid response status, can' build entry from response.") def __init__(self, key, value, metadata=None): self.key = key Loading Loading @@ -141,6 +142,11 @@ class KineticMessageException(KineticException): def __str__(self): return self.code + (': %s' % self.value if self.value else '') class ClusterVersionFailureException(KineticMessageException): def __init__(self, status, cluster_version): super(ClusterVersionFailureException, self).__init__(status) self.cluster_version = cluster_version class HmacAlgorithms: INVALID_HMAC_ALGORITHM = -1 # Must come first, so default is invalid Loading Loading
CHANGES.md +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ This section will document changes to the library since the last release ## New features - Added IPv6 address support on all clients (Issue #8) - Added new exception type ClusterVersionFailureException (Requires drive version 2.0.4) ## Bug Fixes - Fixex bug that caused close() and connect() to fail on a connection that faulted (Issue #7) Loading
kinetic/baseasync.py +4 −3 Original line number Diff line number Diff line Loading @@ -127,10 +127,11 @@ class BaseAsync(Client): return #skip the rest def innerSuccess(header, value): if (header.command.status.code != messages.Message.Status.SUCCESS) : onError(common.KineticMessageException(header.command.status)) else: try: operations._check_status(header) onSuccess(header, value) except Exception as ex: onError(ex) # get sequence self.update_header(header) Loading
kinetic/baseclient.py +0 −4 Original line number Diff line number Diff line Loading @@ -327,10 +327,6 @@ class BaseClient(object): def send(self, header, value): self.network_send(header, value) resp = self.network_recv() if (resp[0].command.status.code != messages.Message.Status.SUCCESS) : raise common.KineticMessageException(resp[0].command.status) return resp ### with statement support ### Loading
kinetic/client.py +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ class Client(BaseClient): self.update_header(header) # send message synchronously header, value = self.send(header, value) operations._check_status(header) return op.parse(header, value) except Exception as e: return op.onError(e) Loading
kinetic/common.py +7 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ DEFAULT_CONNECT_TIMEOUT = 0.1 DEFAULT_SOCKET_TIMEOUT = 5 DEFAULT_CHUNK_SIZE = 4096 class Entry(object): #RPC: Note, you could build this as a class method, if you wanted the fromMessage to build Loading @@ -42,7 +43,7 @@ class Entry(object): elif (header.command.status.code == messages.Message.Status.NOT_FOUND): return None else: raise KineticMessageException(header.command.status) raise KineticClientException("Invalid response status, can' build entry from response.") def __init__(self, key, value, metadata=None): self.key = key Loading Loading @@ -141,6 +142,11 @@ class KineticMessageException(KineticException): def __str__(self): return self.code + (': %s' % self.value if self.value else '') class ClusterVersionFailureException(KineticMessageException): def __init__(self, status, cluster_version): super(ClusterVersionFailureException, self).__init__(status) self.cluster_version = cluster_version class HmacAlgorithms: INVALID_HMAC_ALGORITHM = -1 # Must come first, so default is invalid Loading