Simplify ZooKeeper client initialization

The ZooKeeperClient now provides a fromConfig() method that parses all
necessary configuration values to instantiate a ZooKeeperClient.
Previously, this needed to be done in every component to initialize the
connection to ZooKeeper.

Change-Id: I5fa4ddab5f85c658291f1262ee0392a60086846e
This commit is contained in:
Felix Edel
2021-02-15 14:37:06 +01:00
committed by James E. Blair
parent 24405c9c74
commit b4d8a4e74b
11 changed files with 91 additions and 117 deletions

View File

@@ -31,9 +31,9 @@ class TestNodepoolIntegration(BaseTestCase):
super(TestNodepoolIntegration, self).setUp()
self.statsd = None
self.zk_client = zuul.zk.ZooKeeperClient()
self.zk_client = zuul.zk.ZooKeeperClient('localhost:2181')
self.addCleanup(self.zk_client.disconnect)
self.zk_client.connect('localhost:2181')
self.zk_client.connect()
self.hostname = socket.gethostname()
self.provisioned_requests = []