From 56e0172805524d464ecb59285f9053ffdbfe3487 Mon Sep 17 00:00:00 2001 From: Ben Kero Date: Thu, 13 Jul 2017 10:50:14 -0700 Subject: [PATCH] Add SSH Host Key Verifier Strategy Since version 1.15, the Jenkins SSH Slave Plugin has added a requirement for a SSH Host Key Verification Strategy. This defaults to requiring that the host key is already accepted by the Jenkins SSH environment. This path reactivates the old and expected behavior of accepting, but throwing a warning in the job logs whenever a host is SSHed into that has an unknown SSH host key. Change-Id: I2316cac0b2bb6ff2f0f4abc7dfd5307d80edf1b3 --- nodepool/jenkins_manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nodepool/jenkins_manager.py b/nodepool/jenkins_manager.py index 5a2a1b312..034d50c65 100644 --- a/nodepool/jenkins_manager.py +++ b/nodepool/jenkins_manager.py @@ -29,11 +29,19 @@ class CreateNodeTask(Task): if 'credentials_id' in self.args: launcher_params = {'port': 22, 'credentialsId': self.args['credentials_id'], + 'sshHostKeyVerificationStrategy': + {'stapler-class': + ('hudson.plugins.sshslaves.verifiers.' + 'NonVerifyingKeyVerificationStrategy')}, 'host': self.args['host']} else: launcher_params = {'port': 22, 'username': self.args['username'], 'privatekey': self.args['private_key'], + 'sshHostKeyVerificationStrategy': + {'stapler-class': + ('hudson.plugins.sshslaves.verifiers.' + 'NonVerifyingKeyVerificationStrategy')}, 'host': self.args['host']} args = dict( name=self.args['name'],