From d55b97e5b132841a19b04bca2e4f3ab0424a40df Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 16 Sep 2022 17:54:20 +0200 Subject: [PATCH] Deal with sshd being absent This plugin is no longer part of a default installation and not needed in our CI. --- files/puppet_helper.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/puppet_helper.groovy b/files/puppet_helper.groovy index 6f9d46137..299885c2c 100644 --- a/files/puppet_helper.groovy +++ b/files/puppet_helper.groovy @@ -241,7 +241,8 @@ class Actions { user.addProperty(pw_param) if ( public_keys != "" ) { - def keys_param = new org.jenkinsci.main.modules.cli.auth.ssh.UserPropertyImpl(public_keys) + util.requirePlugin('sshd') + def keys_param = this.class.classLoader.loadClass('org.jenkinsci.main.modules.cli.auth.ssh$UserPropertyImpl').newInstance(public_keys) user.addProperty(keys_param) } @@ -294,10 +295,11 @@ class Actions { def public_keys = conf['public_keys'] if (public_keys) { + util.requirePlugin('sshd') assert public_keys instanceof List // convert list of keys into a single string def keys = public_keys.join("\n") - def keys_param = new org.jenkinsci.main.modules.cli.auth.ssh.UserPropertyImpl(keys) + def keys_param = this.class.classLoader.loadClass('org.jenkinsci.main.modules.cli.auth.ssh$UserPropertyImpl').newInstance(keys) user.addProperty(keys_param) }