summaryrefslogtreecommitdiff
path: root/zuul/zk
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2022-07-17 10:31:38 -0700
committerJames E. Blair <jim@acmegating.com>2022-07-17 10:32:48 -0700
commitdcd860cfc17c2829502c84c4bd2f74a35ae06160 (patch)
tree28434d9af42cfbe8feb8216965388a5c1a37b5b0 /zuul/zk
parentdd9579fc1ac89afe496352dadd568645d3c54c23 (diff)
downloadzuul-dcd860cfc17c2829502c84c4bd2f74a35ae06160.tar.gz
Fix nodepool label query
Nodepool updated its internal interface for registering launchers. Since Zuul uses that internal interface to determine what labels are available, update it to match. Change-Id: Iffa0c1c1d9ef8d195c5e1ea1b625de9d119add3b
Diffstat (limited to 'zuul/zk')
-rw-r--r--zuul/zk/nodepool.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/zuul/zk/nodepool.py b/zuul/zk/nodepool.py
index 109053f11..1be4dc2b5 100644
--- a/zuul/zk/nodepool.py
+++ b/zuul/zk/nodepool.py
@@ -12,6 +12,7 @@
import json
import logging
+import os
import time
from enum import Enum
from typing import Optional, List
@@ -43,7 +44,7 @@ class ZooKeeperNodepool(ZooKeeperBase):
Class implementing Nodepool related ZooKeeper interface.
"""
NODES_ROOT = "/nodepool/nodes"
- LAUNCHER_ROOT = "/nodepool/launchers"
+ COMPONENT_ROOT = "/nodepool/components"
REQUEST_ROOT = '/nodepool/requests'
REQUEST_LOCK_ROOT = "/nodepool/requests-lock"
HOLD_REQUEST_ROOT = '/zuul/hold-requests'
@@ -95,9 +96,6 @@ class ZooKeeperNodepool(ZooKeeperBase):
self._node_tree.close()
self._node_tree = None
- def _launcherPath(self, launcher):
- return "%s/%s" % (self.LAUNCHER_ROOT, launcher)
-
def _nodePath(self, node):
return "%s/%s" % (self.NODES_ROOT, node)
@@ -113,15 +111,15 @@ class ZooKeeperNodepool(ZooKeeperBase):
:returns: A list of Launcher objects, or empty list if none are found.
"""
+ root_path = os.path.join(self.COMPONENT_ROOT, 'pool')
try:
- launcher_ids = self.kazoo_client\
- .get_children(self.LAUNCHER_ROOT)
+ pools = self.kazoo_client.get_children(root_path)
except NoNodeError:
return []
objs = []
- for launcher in launcher_ids:
- path = self._launcherPath(launcher)
+ for pool in pools:
+ path = os.path.join(root_path, pool)
try:
data, _ = self.kazoo_client.get(path)
except NoNodeError: