From e11424417fec73a01f0542c215b0b48a02eeadc6 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Sat, 25 Sep 2021 12:51:14 -0700 Subject: [PATCH] Expose slot number from metastatic driver The static driver now exposes the slot number in the ZK node record. Do the same for the metastatic driver so that Zuul can use it. Change-Id: I41492c53f5e21e63eddecc1ac0fe5e50c50f298b --- nodepool/driver/metastatic/adapter.py | 1 + nodepool/driver/statemachine.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/nodepool/driver/metastatic/adapter.py b/nodepool/driver/metastatic/adapter.py index 28e08a599..a668d15f8 100644 --- a/nodepool/driver/metastatic/adapter.py +++ b/nodepool/driver/metastatic/adapter.py @@ -133,6 +133,7 @@ class MetastaticInstance(statemachine.Instance): 'node': node.id, } self.external_id = node.id + self.slot = slot def getQuotaInformation(self): return QuotaInformation(instances=1) diff --git a/nodepool/driver/statemachine.py b/nodepool/driver/statemachine.py index de62e982a..3b51b42d3 100644 --- a/nodepool/driver/statemachine.py +++ b/nodepool/driver/statemachine.py @@ -161,6 +161,7 @@ class StateMachineNodeLauncher(stats.StatsReporter): node.region = instance.region node.az = instance.az node.driver_data = instance.driver_data + node.slot = instance.slot # Optionally, if the node has updated values that we set from # the image attributes earlier, set those. @@ -742,6 +743,7 @@ class Instance: * az: str * region: str * driver_data: any + * slot: int And the following are even more optional (as they are usually already set from the image configuration): @@ -766,6 +768,7 @@ class Instance: self.region = None self.metadata = {} self.driver_data = None + self.slot = None def __repr__(self): state = []