Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
state_fut, states.States.LOST)
fut.cancel()
await self.delete_unique_znode(znode_label)
class Lock:
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc, tb):
await on_exit()
return Lock()
class LockLostError(exc.ZKError):
pass
async def watch_loop(self, path):
while self.callbacks[path]:
log.debug("Fetching data for %s", path)
try:
result = await self.fetch(path)
except exc.NoNode:
result = exc.NoNode
except exc.ZKError as e:
log.exception('Exception in watch loop: {}'.format(e))
log.info('Waiting for safe state...')
await self.client.session.ensure_safe_state()
continue
except Exception:
log.exception('Not handled in watch loop:')
raise
for callback in self.callbacks[path].copy():
maybe_future(callback(result), loop=self.client.loop)
if WatchEvent.CREATED not in self.watched_events and result == exc.NoNode:
return
try:
await self.client.wait_for_events(self.watched_events, path)
except asyncio.CancelledError:
pass
class ConnectError(ZKError):
def __init__(self, host, port, server_id=None):
self.host = host
self.port = port
self.server_id = server_id
def __str__(self):
return "Error connecting to %s:%s" % (self.host, self.port)
class NoServersError(ZKError):
pass
class SessionLost(ZKError):
pass
class InvalidClientState(ZKError):
pass
class TimeoutError(ZKError):
pass
class UnfinishedRead(ZKError):
pass
class FailedRetry(ZKError):
return "Error connecting to %s:%s" % (self.host, self.port)
class NoServersError(ZKError):
pass
class SessionLost(ZKError):
pass
class InvalidClientState(ZKError):
pass
class TimeoutError(ZKError):
pass
class UnfinishedRead(ZKError):
pass
class FailedRetry(ZKError):
pass
class InvalidStateTransition(ZKError):
pass
response_error_xref = {}
self.port = port
self.server_id = server_id
def __str__(self):
return "Error connecting to %s:%s" % (self.host, self.port)
class NoServersError(ZKError):
pass
class SessionLost(ZKError):
pass
class InvalidClientState(ZKError):
pass
class TimeoutError(ZKError):
pass
class UnfinishedRead(ZKError):
pass
class FailedRetry(ZKError):
pass
class InvalidStateTransition(ZKError):
class ZKError(Exception):
pass
class ConnectError(ZKError):
def __init__(self, host, port, server_id=None):
self.host = host
self.port = port
self.server_id = server_id
def __str__(self):
return "Error connecting to %s:%s" % (self.host, self.port)
class NoServersError(ZKError):
pass
class SessionLost(ZKError):
pass
class InvalidClientState(ZKError):
pass
class TimeoutError(ZKError):
pass
class UnfinishedRead(ZKError):
pass
class TimeoutError(ZKError):
pass
class UnfinishedRead(ZKError):
pass
class FailedRetry(ZKError):
pass
class InvalidStateTransition(ZKError):
pass
response_error_xref = {}
class ResponseErrorMeta(type):
def __new__(cls, name, bases, attrs):
new_class = super(ResponseErrorMeta, cls).__new__(
cls, name, bases, attrs
)
response_error_xref[new_class.error_code] = new_class
return new_class
pass
class SessionLost(ZKError):
pass
class InvalidClientState(ZKError):
pass
class TimeoutError(ZKError):
pass
class UnfinishedRead(ZKError):
pass
class FailedRetry(ZKError):
pass
class InvalidStateTransition(ZKError):
pass
response_error_xref = {}
class ResponseErrorMeta(type):
response_error_xref = {}
class ResponseErrorMeta(type):
def __new__(cls, name, bases, attrs):
new_class = super(ResponseErrorMeta, cls).__new__(
cls, name, bases, attrs
)
response_error_xref[new_class.error_code] = new_class
return new_class
class ResponseError(ZKError, metaclass=ResponseErrorMeta):
error_code = None
def __str__(self):
return self.__class__.__name__
class UnknownError(ResponseError):
def __init__(self, error_code):
print(repr(error_code))
self.error_code = error_code
def __str__(self):
return "Unknown error code: %s" % self.error_code
pass
class InvalidClientState(ZKError):
pass
class TimeoutError(ZKError):
pass
class UnfinishedRead(ZKError):
pass
class FailedRetry(ZKError):
pass
class InvalidStateTransition(ZKError):
pass
response_error_xref = {}
class ResponseErrorMeta(type):
def __new__(cls, name, bases, attrs):
new_class = super(ResponseErrorMeta, cls).__new__(
cls, name, bases, attrs
)