summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Henkel <tobias.henkel@bmw.de>2019-01-09 14:08:07 +0100
committerTobias Henkel <tobias.henkel@bmw.de>2019-01-09 14:08:07 +0100
commitbcaa2647121b2aa2c9a36c7f1f88824bd7b7cfe8 (patch)
tree95d8dd91638f661208ba72c2a66668fc1ccd548b
parent2427bfb277cabbbfd489abf1894f546d4e7e4b5e (diff)
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
Notes
Notes (review): Code-Review+2: Jens Harbott (frickler) <j.harbott@x-ion.de> Code-Review+2: David Shrewsbury <shrewsbury.dave@gmail.com> Workflow+1: David Shrewsbury <shrewsbury.dave@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 09 Jan 2019 14:34:12 +0000 Reviewed-on: https://review.openstack.org/629478 Project: openstack-infra/nodepool Branch: refs/heads/master
-rw-r--r--nodepool/driver/static/provider.py2
-rw-r--r--nodepool/tests/unit/test_driver_static.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/nodepool/driver/static/provider.py b/nodepool/driver/static/provider.py
index fd1c944..a256bd5 100644
--- a/nodepool/driver/static/provider.py
+++ b/nodepool/driver/static/provider.py
@@ -49,7 +49,7 @@ class StaticNodeProvider(Provider):
49 node["name"], node["connection-port"])) 49 node["name"], node["connection-port"]))
50 50
51 if not gather_hostkeys: 51 if not gather_hostkeys:
52 return 52 return []
53 53
54 # Check node host-key 54 # Check node host-key
55 if set(node["host-key"]).issubset(set(keys)): 55 if set(node["host-key"]).issubset(set(keys)):
diff --git a/nodepool/tests/unit/test_driver_static.py b/nodepool/tests/unit/test_driver_static.py
index c36c795..88b715d 100644
--- a/nodepool/tests/unit/test_driver_static.py
+++ b/nodepool/tests/unit/test_driver_static.py
@@ -177,7 +177,7 @@ class TestDriverStatic(tests.DBTestCase):
177 self.assertEqual(nodes[0].username, 'admin') 177 self.assertEqual(nodes[0].username, 'admin')
178 self.assertEqual(nodes[0].connection_port, 5986) 178 self.assertEqual(nodes[0].connection_port, 5986)
179 self.assertEqual(nodes[0].connection_type, 'winrm') 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 def test_static_multilabel(self): 182 def test_static_multilabel(self):
183 configfile = self.setup_config('static-multilabel.yaml') 183 configfile = self.setup_config('static-multilabel.yaml')