diff --git a/src/main/java/hudson/plugins/ec2/EC2Cloud.java b/src/main/java/hudson/plugins/ec2/EC2Cloud.java index 2ee776c95..dd666b81f 100644 --- a/src/main/java/hudson/plugins/ec2/EC2Cloud.java +++ b/src/main/java/hudson/plugins/ec2/EC2Cloud.java @@ -132,7 +132,7 @@ public abstract class EC2Cloud extends Cloud { // if this system property is defined and its value points to a valid ssh private key on disk // then this will be used instead of any configured ssh credential - private static final String sshPrivateKeyFilePath =EC2Cloud.class.getName() + "sshPrivateKeyFilePath"; + private static final String SSH_PRIVATE_KEY_FILEPATH = EC2Cloud.class.getName() + ".sshPrivateKeyFilePath"; private transient ReentrantLock slaveCountingLock = new ReentrantLock(); @@ -215,6 +215,7 @@ public EC2PrivateKey resolvePrivateKey(){ return null; } + @CheckForNull private static EC2PrivateKey fetchPrivateKeyFromDisk() { String filename = System.getProperty(sshPrivateKeyFilePath, ""); if (!filename.isEmpty()) {