How to use the kazoo.exceptions.ZookeeperError function in kazoo

To help you get started, we’ve selected a few kazoo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github douban / dpark / dpark / pymesos / detector.py View on Github external
def start(self):
        adjust_zk_logging_level()
        self.zk.start()
        try:
            ChildrenWatch(self.zk, '', self.choose)
        except ZookeeperError:
            self.agent.onNoMasterDetectedMessage()
            self.stop()
github python-zk / kazoo / kazoo / exceptions.py View on Github external
EXCEPTIONS = defaultdict(_invalid_error_code)


def _zookeeper_exception(code):
    def decorator(klass):
        EXCEPTIONS[code] = klass
        klass.code = code
        return klass

    return decorator


@_zookeeper_exception(0)
class RolledBackError(ZookeeperError):
    pass


@_zookeeper_exception(-1)
class SystemZookeeperError(ZookeeperError):
    pass


@_zookeeper_exception(-2)
class RuntimeInconsistency(ZookeeperError):
    pass


@_zookeeper_exception(-3)
class DataInconsistency(ZookeeperError):
    pass
github python-zk / kazoo / kazoo / exceptions.py View on Github external
class MarshallingError(ZookeeperError):
    pass


@_zookeeper_exception(-6)
class UnimplementedError(ZookeeperError):
    pass


@_zookeeper_exception(-7)
class OperationTimeoutError(ZookeeperError):
    pass


@_zookeeper_exception(-8)
class BadArgumentsError(ZookeeperError):
    pass


@_zookeeper_exception(-13)
class NewConfigNoQuorumError(ZookeeperError):
    pass


@_zookeeper_exception(-14)
class ReconfigInProcessError(ZookeeperError):
    pass


@_zookeeper_exception(-100)
class APIError(ZookeeperError):
    pass
github python-zk / kazoo / kazoo / exceptions.py View on Github external
class NewConfigNoQuorumError(ZookeeperError):
    pass


@_zookeeper_exception(-14)
class ReconfigInProcessError(ZookeeperError):
    pass


@_zookeeper_exception(-100)
class APIError(ZookeeperError):
    pass


@_zookeeper_exception(-101)
class NoNodeError(ZookeeperError):
    pass


@_zookeeper_exception(-102)
class NoAuthError(ZookeeperError):
    pass


@_zookeeper_exception(-103)
class BadVersionError(ZookeeperError):
    pass


@_zookeeper_exception(-108)
class NoChildrenForEphemeralsError(ZookeeperError):
    pass
github python-zk / kazoo / kazoo / exceptions.py View on Github external
class NoChildrenForEphemeralsError(ZookeeperError):
    pass


@_zookeeper_exception(-110)
class NodeExistsError(ZookeeperError):
    pass


@_zookeeper_exception(-111)
class NotEmptyError(ZookeeperError):
    pass


@_zookeeper_exception(-112)
class SessionExpiredError(ZookeeperError):
    pass


@_zookeeper_exception(-113)
class InvalidCallbackError(ZookeeperError):
    pass


@_zookeeper_exception(-114)
class InvalidACLError(ZookeeperError):
    pass


@_zookeeper_exception(-115)
class AuthFailedError(ZookeeperError):
    pass
github rgs1 / zk_shell / zk_shell / copy_util.py View on Github external
def delete_path_recursively(self):
        try:
            self.client.delete(self.path, recursive=True)
        except NoNodeError:
            pass
        except NoAuthError:
            raise AuthError("delete", self.path)
        except ZookeeperError:
            raise CopyError("Zookeeper server error")
github python-zk / kazoo / kazoo / exceptions.py View on Github external
class DataInconsistency(ZookeeperError):
    pass


@_zookeeper_exception(-4)
class ConnectionLoss(ZookeeperError):
    pass


@_zookeeper_exception(-5)
class MarshallingError(ZookeeperError):
    pass


@_zookeeper_exception(-6)
class UnimplementedError(ZookeeperError):
    pass


@_zookeeper_exception(-7)
class OperationTimeoutError(ZookeeperError):
    pass


@_zookeeper_exception(-8)
class BadArgumentsError(ZookeeperError):
    pass


@_zookeeper_exception(-13)
class NewConfigNoQuorumError(ZookeeperError):
    pass
github python-zk / kazoo / kazoo / exceptions.py View on Github external
class ReconfigInProcessError(ZookeeperError):
    pass


@_zookeeper_exception(-100)
class APIError(ZookeeperError):
    pass


@_zookeeper_exception(-101)
class NoNodeError(ZookeeperError):
    pass


@_zookeeper_exception(-102)
class NoAuthError(ZookeeperError):
    pass


@_zookeeper_exception(-103)
class BadVersionError(ZookeeperError):
    pass


@_zookeeper_exception(-108)
class NoChildrenForEphemeralsError(ZookeeperError):
    pass


@_zookeeper_exception(-110)
class NodeExistsError(ZookeeperError):
    pass
github AppScale / appscale / AppDB / appscale / datastore / scripts / transaction_groomer.py View on Github external
def _register_groomer(self):
    """ Creates a ZooKeeper entry that broadcasts this service's presence. """
    logger.info('Registering service with ZooKeeper')
    node_prefix = '/'.join([self._registration_path, self._groomer_id]) + '-'

    # Make sure an older node from this groomer did not remain.
    self._clean_created_nodes()

    # The groomer must be registered before it can continue working.
    while True:
      try:
        full_path = self._zk_client.create(node_prefix, ephemeral=True,
                                           sequence=True)
        self._node = full_path[len(self._registration_path) + 1:]
        break
      except ZookeeperError:
        self._clean_created_nodes()
        continue
github python-zk / kazoo / kazoo / exceptions.py View on Github external
class BadVersionError(ZookeeperError):
    pass


@_zookeeper_exception(-108)
class NoChildrenForEphemeralsError(ZookeeperError):
    pass


@_zookeeper_exception(-110)
class NodeExistsError(ZookeeperError):
    pass


@_zookeeper_exception(-111)
class NotEmptyError(ZookeeperError):
    pass


@_zookeeper_exception(-112)
class SessionExpiredError(ZookeeperError):
    pass


@_zookeeper_exception(-113)
class InvalidCallbackError(ZookeeperError):
    pass


@_zookeeper_exception(-114)
class InvalidACLError(ZookeeperError):
    pass