Skip to content

Commit

Permalink
Deal with sshd being absent
Browse files Browse the repository at this point in the history
This plugin is no longer part of a default installation and not needed
in our CI.
  • Loading branch information
ekohl committed Sep 16, 2022
1 parent 1635199 commit d55b97e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions files/puppet_helper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit d55b97e

Please sign in to comment.