Permalink
Browse files

Merge zookeeper.namespace config setting into zookeeper.connection,

as that's more familiar to ZK devs and matches the inclusion of a path in the queuey connection setting
  • Loading branch information...
1 parent d6129c0 commit e924d72364f27804348f58d539af438950d2db3a @hannosch hannosch committed Apr 2, 2012
Showing with 13 additions and 21 deletions.
  1. +4 −8 docs/config.rst
  2. +2 −3 docs/index.rst
  3. +1 −2 etc/qdo-worker.conf
  4. +1 −2 qdo/config.py
  5. +1 −1 qdo/tests/base.py
  6. +3 −3 qdo/tests/test_config.py
  7. +1 −2 qdo/worker.py
View
@@ -50,11 +50,7 @@ app_key
connection
Which :term:`Zookeeper` servers to connect to. Defaults to
- `127.0.0.1:2181,127.0.0.1:2184,127.0.0.1:2187` for a local three server
- ensemble. In production these would be three different hosts, for example:
- `10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181`
-
-namespace
- The path to the root :term:`Zookeeper` node, under which `qdo` will store
- all its information. Defaults to `mozilla-qdo`. The node needs to be
- created before `qdo-worker` is run.
+ `127.0.0.1:2181,127.0.0.1:2184,127.0.0.1:2187/mozilla-qdo` for a local
+ three server ensemble, using `mozilla-qdo` as the top-level namespace.
+ In production these would be three different hosts, for example:
+ `10.0.0.1:2181,10.0.0.2:2181,10.0.0.3:2181/mozilla-qdo`
View
@@ -16,7 +16,7 @@ Quick intro
===========
Assuming you have a working installation and setup of Queuey and Zookeeper,
-you need at least one Python module named `hello.py`::
+you need at least one Python module named for example `hello.py`::
from contextlib import contextmanager
@@ -45,8 +45,7 @@ And one config file named `hello.conf`:
job = hello:job
[zookeeper]
- connection = 127.0.0.1:2181
- namespace = hello
+ connection = 127.0.0.1:2181/hello
[queuey]
connection = https://127.0.0.1:5000/v1/queuey/
View
@@ -4,8 +4,7 @@ ca_bundle = etc/ssl/localhost.crt
job = qdo.testing:example_job
[zookeeper]
-connection = 127.0.0.1:2181,127.0.0.1:2184,127.0.0.1:2187
-namespace = mozilla-qdo
+connection = 127.0.0.1:2181,127.0.0.1:2184,127.0.0.1:2187/mozilla-qdo
[queuey]
connection = https://127.0.0.1:5001/v1/queuey/
View
@@ -27,8 +27,7 @@ def load_defaults(self):
self[u'queuey.app_key'] = None
self[u'zookeeper.connection'] = \
- u'127.0.0.1:2181,127.0.0.1:2184,127.0.0.1:2187'
- self[u'zookeeper.namespace'] = ZOO_DEFAULT_NS
+ u'127.0.0.1:2181,127.0.0.1:2184,127.0.0.1:2187/' + ZOO_DEFAULT_NS
self[u'metlog.logger'] = u'qdo-worker'
self[u'metlog.sender'] = {}
View
@@ -14,7 +14,7 @@
from qdo.queuey import QueueyConnection
from qdo.zk import connect as zk_connect
-# as specified in the queuey-dev.ini
+# as specified in the queuey.ini
TEST_APP_KEY = u'f25bfb8fe200475c8a0532a9cbe7651e'
View
@@ -24,18 +24,18 @@ def test_defaults(self):
u'https://127.0.0.1:5001/v1/queuey/')
zk_section = settings.getsection(u'zookeeper')
self.assertEqual(zk_section[u'connection'],
- u'127.0.0.1:2181,127.0.0.1:2184,127.0.0.1:2187')
+ u'127.0.0.1:2181,127.0.0.1:2184,127.0.0.1:2187/mozilla-qdo')
def test_configure(self):
extra = {
u'qdo-worker.wait_interval': 30,
u'queuey.url': u'https://10.0.0.1:2345',
- u'zookeeper.connection': u'10.0.0.2:3456',
+ u'zookeeper.connection': u'10.0.0.2:3456/qdo',
}
settings = self._make_one(extra)
qdo_section = settings.getsection(u'qdo-worker')
self.assertEqual(qdo_section[u'wait_interval'], 30)
queuey_section = settings.getsection(u'queuey')
self.assertEqual(queuey_section[u'url'], u'https://10.0.0.1:2345')
zk_section = settings.getsection(u'zookeeper')
- self.assertEqual(zk_section[u'connection'], u'10.0.0.2:3456')
+ self.assertEqual(zk_section[u'connection'], u'10.0.0.2:3456/qdo')
View
@@ -59,8 +59,7 @@ def configure(self):
result = __import__(mod, globals(), locals(), fun)
self.job = getattr(result, fun)
zk_section = self.settings.getsection(u'zookeeper')
- self.zk_root_url = zk_section[u'connection'] + u'/' + \
- zk_section[u'namespace']
+ self.zk_root_url = zk_section[u'connection']
queuey_section = self.settings.getsection(u'queuey')
self.queuey_conn = QueueyConnection(
queuey_section[u'app_key'],

0 comments on commit e924d72

Please sign in to comment.