Allow a user to configure the number of retries
A typo has been corrected in c650a7a. This commit was first released in 1.3.1. Previous versions of Kazoo will just fail.
Use of `max_retries` has been deprecated. We also update the requirements to `kazoo >= 1.2` since this is the first version supporting such parameters.
joiner: handle invalid local data gracefully
Instead of throwing an exception, ignore invalid local data.
This commands will import local configuration to ZooKeeper but will not update the local configuration with ZooKeeper content. This is not the exact reverse of `zkfarmer export` since it is only able to import one node. This is a limited version of `zkfarmer join` where changes from ZooKeeper are ignored. This is useful when you have a large farm of joinder using a common node to sync configuration.
Those tests are shared with tests for `ZkFarmJoiner` when this is possible.
- `ZkFarmExporter` will take configuration from zookeeper and put it into the local filesystem. - `ZkFarmImporter` will take configuration from the local filesystem and put it into zookeeper. - `ZkFarmJoiner` will do both. The new class `ZkFarmImporter` will be used in the future to add the ability to import conf to zookeeper without pushing the changes to the local filesystem. To avoid code duplication, it retains the same FSM than `ZkFarmJoiner` but the `znode modified` state is unreachable because we do not listen to the appropriate zookeeper node.
joiner: add an option to work with a common node
In normal operations, each joiner will have its own zookeeper node. We add an option to make them work on a common node instead. The hostname is not added to the node and local modifications are not authoritative. Moreover, the node is not ephemeral. Instead of using an IP address, `common` is used as the node name.
conf: don't use keyword `errors` for `str.encode`
This is not supported with Python 2.6. Just use it as a positional argument.
conf: ensure we can encode unicode to PHP
Also, add a test that we are able to decode an UTF-8 encoded JSON file.
travis: fix use of environment variable
Use tox to run unittests
We also enable to run unittests from setup.py. This requires some changes, like adding the needed dependencies but also we have to be able to run setup.py with dependencies missing. We also need to ship files needed by setup.py.
php: fix dumping of arrays with integers
joiner: on some version of watchdog, the destination path is `dest_path`...
Booleans were not handled when serializing to PHP.
Python `join()` function only handles strings. We need to ensure that we only provide strings.
…th`, not `dst_path`
joiner: handle file moved events as well
When a file is moved from one location to the target location, the source location may not match what is required for the target location (for example, when the target location is a file). We handle this. This fixes a regression in 5c73ce.
join: make join work on files and not just directories
watcher: handle non-existent configuration file
`watchdog.observer.Observer` is not able to watch a file. It needs to watch a whole directory. We make it watch the parent directory and check we only get notified for real changes for our file/directory.
version: store version in one place
When a non-existent file is requested, the `Conf` object can return `None` instead of an empty object. We handle this case and consider we get an empty object instead.