Remove zk host list parsing
Just pass through the zookeeper host list string unparsed since
that what we're going to expect from our config file.
Change-Id: Ife8fd97860ad35c793ef956adbb9d626569f60bf
diff --git a/tests/base.py b/tests/base.py
index c81ac7d..bbf4d36 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -1300,11 +1300,12 @@
self.config, self.sched)
self.nodepool = zuul.nodepool.Nodepool(self.sched)
self.zk = zuul.zk.ZooKeeper()
- self.zk.connect([self.zk_config])
+ self.zk.connect(self.zk_config)
- self.fake_nodepool = FakeNodepool(self.zk_config.host,
- self.zk_config.port,
- self.zk_config.chroot)
+ self.fake_nodepool = FakeNodepool(
+ self.zk_chroot_fixture.zookeeper_host,
+ self.zk_chroot_fixture.zookeeper_port,
+ self.zk_chroot_fixture.zookeeper_chroot)
self.sched.setLauncher(self.launch_client)
self.sched.setMerger(self.merge_client)
@@ -1380,7 +1381,7 @@
def setupZK(self):
self.zk_chroot_fixture = self.useFixture(ChrootedKazooFixture())
- self.zk_config = zuul.zk.ZooKeeperConnectionConfig(
+ self.zk_config = '%s:%s%s' % (
self.zk_chroot_fixture.zookeeper_host,
self.zk_chroot_fixture.zookeeper_port,
self.zk_chroot_fixture.zookeeper_chroot)
diff --git a/tests/unit/test_nodepool.py b/tests/unit/test_nodepool.py
index 6462f9a..19c7e05 100644
--- a/tests/unit/test_nodepool.py
+++ b/tests/unit/test_nodepool.py
@@ -30,22 +30,23 @@
super(BaseTestCase, self).setUp()
self.zk_chroot_fixture = self.useFixture(ChrootedKazooFixture())
- self.zk_config = zuul.zk.ZooKeeperConnectionConfig(
+ self.zk_config = '%s:%s%s' % (
self.zk_chroot_fixture.zookeeper_host,
self.zk_chroot_fixture.zookeeper_port,
self.zk_chroot_fixture.zookeeper_chroot)
self.zk = zuul.zk.ZooKeeper()
- self.zk.connect([self.zk_config])
+ self.zk.connect(self.zk_config)
self.provisioned_requests = []
# This class implements the scheduler methods zuul.nodepool
# needs, so we pass 'self' as the scheduler.
self.nodepool = zuul.nodepool.Nodepool(self)
- self.fake_nodepool = FakeNodepool(self.zk_config.host,
- self.zk_config.port,
- self.zk_config.chroot)
+ self.fake_nodepool = FakeNodepool(
+ self.zk_chroot_fixture.zookeeper_host,
+ self.zk_chroot_fixture.zookeeper_port,
+ self.zk_chroot_fixture.zookeeper_chroot)
def waitForRequests(self):
# Wait until all requests are complete.