Default host_keys to empty list in static driver

Everywhere in nodepool we default the host_keys to an empty list and
zuul relies on this behavior. However the static driver sets this to
None for non-ssh connections. Change this to return an empty list to
match the behavior of the other drivers.

Change-Id: I3f14803c35a2039d2c53f4939857a531ce900097
This commit is contained in:
Tobias Henkel 2019-01-09 14:08:07 +01:00
parent 2427bfb277
commit bcaa264712
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ class StaticNodeProvider(Provider):
node["name"], node["connection-port"]))
if not gather_hostkeys:
return
return []
# Check node host-key
if set(node["host-key"]).issubset(set(keys)):

View File

@ -177,7 +177,7 @@ class TestDriverStatic(tests.DBTestCase):
self.assertEqual(nodes[0].username, 'admin')
self.assertEqual(nodes[0].connection_port, 5986)
self.assertEqual(nodes[0].connection_type, 'winrm')
self.assertEqual(nodes[0].host_keys, None)
self.assertEqual(nodes[0].host_keys, [])
def test_static_multilabel(self):
configfile = self.setup_config('static-multilabel.yaml')