Browse Source

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
tags/3.5.0
Tobias Henkel 4 months ago
parent
commit
bcaa264712
No account linked to committer's email address
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      nodepool/driver/static/provider.py
  2. 1
    1
      nodepool/tests/unit/test_driver_static.py

+ 1
- 1
nodepool/driver/static/provider.py View File

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

+ 1
- 1
nodepool/tests/unit/test_driver_static.py View File

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

Loading…
Cancel
Save