Fix missing node tuple arg in static provider

Bug was introduced in https://review.opendev.org/#/c/701969/

Change-Id: Id32361a3c45c9e2c6fe6439c62a85952fe302c73
This commit is contained in:
Simon Westphahl 2020-01-14 08:23:04 +01:00
parent 3dc1824934
commit b0c0d27384
2 changed files with 25 additions and 1 deletions

View File

@ -208,7 +208,7 @@ class StaticNodeProvider(Provider):
'''
host_keys = self.checkHost(static_node)
node_tuple = nodeTuple(static_node)
nodes = self.getRegisteredReadyNodes()
nodes = self.getRegisteredReadyNodes(node_tuple)
new_attrs = (
static_node["labels"],
static_node["username"],

View File

@ -236,6 +236,30 @@ class TestDriverStatic(tests.DBTestCase):
self.assertEqual(nodes[0].connection_type, 'winrm')
self.assertEqual(nodes[0].host_keys, [])
def test_static_node_update_startup(self):
'''
Test that updates a static node on config change at startup.
'''
configfile = self.setup_config('static-basic.yaml')
pool = self.useNodepool(configfile, watermark_sleep=1)
pool.start()
self.log.debug("Waiting for initial node")
nodes = self.waitForNodes('fake-label')
pool.stop()
configfile = self.setup_config('static-multilabel.yaml')
pool = self.useNodepool(configfile, watermark_sleep=1)
pool.start()
self.log.debug("Waiting for new label")
nodes = self.waitForNodes('fake-label2')
self.assertEqual(len(nodes), 1)
# Check that the node was updated and not re-created
self.assertEqual(nodes[0].id, "0000000000")
self.assertIn('fake-label', nodes[0].type)
self.assertIn('fake-label2', nodes[0].type)
def test_static_multilabel(self):
configfile = self.setup_config('static-multilabel.yaml')
pool = self.useNodepool(configfile, watermark_sleep=1)