Skip to content
Permalink
Browse files
Merge pull request #104 from OpenDataSpace/JENKINS-28815
[JENKINS-28815] Providing nodes by "Image name" always works as by "Image ID"
  • Loading branch information
felfert committed Oct 8, 2015
2 parents 686a366 + 247b141 commit c36d74077e0c298e9f0356bc114da4f4060eb086
@@ -219,19 +219,23 @@ static ComputeServiceContext ctx(String providerName, String identity, String cr
.buildView(ComputeServiceContext.class);
}

public ComputeService newCompute() {
Properties overrides = new Properties();
if (!Strings.isNullOrEmpty(this.endPointUrl)) {
overrides.setProperty(Constants.PROPERTY_ENDPOINT, this.endPointUrl);
}
if (scriptTimeout > 0) {
overrides.setProperty(ComputeServiceProperties.TIMEOUT_SCRIPT_COMPLETE, String.valueOf(scriptTimeout));
}
if (startTimeout > 0) {
overrides.setProperty(ComputeServiceProperties.TIMEOUT_NODE_RUNNING, String.valueOf(startTimeout));
}
return ctx(this.providerName, this.identity, Secret.toString(credential), overrides, this.zones).getComputeService();
}

public ComputeService getCompute() {
if (this.compute == null) {
Properties overrides = new Properties();
if (!Strings.isNullOrEmpty(this.endPointUrl)) {
overrides.setProperty(Constants.PROPERTY_ENDPOINT, this.endPointUrl);
}
if (scriptTimeout > 0) {
overrides.setProperty(ComputeServiceProperties.TIMEOUT_SCRIPT_COMPLETE, String.valueOf(scriptTimeout));
}
if (startTimeout > 0) {
overrides.setProperty(ComputeServiceProperties.TIMEOUT_NODE_RUNNING, String.valueOf(startTimeout));
}
this.compute = ctx(this.providerName, this.identity, Secret.toString(credential), overrides, this.zones).getComputeService();
this.compute = newCompute();
}
return compute;
}
@@ -321,7 +325,7 @@ public JCloudsSlaveTemplate getTemplate(Label label) {
return null;
}

JCloudsSlave doProvisionFromTemplate(final JCloudsSlaveTemplate t) throws IOException {
JCloudsSlave doProvisionFromTemplate(final JCloudsSlaveTemplate t) throws IOException {
final StringWriter sw = new StringWriter();
final StreamTaskListener listener = new StreamTaskListener(sw);
JCloudsSlave node = t.provisionSlave(listener);
@@ -393,11 +397,11 @@ public String getDisplayName() {
public FormValidation doTestConnection(@QueryParameter String providerName, @QueryParameter String identity, @QueryParameter String credential,
@QueryParameter String cloudGlobalKeyId, @QueryParameter String endPointUrl, @QueryParameter String zones) throws IOException {
if (identity == null)
return FormValidation.error("Invalid (AccessId).");
return FormValidation.error("Invalid (AccessId).");
if (credential == null)
return FormValidation.error("Invalid credential (secret key).");
return FormValidation.error("Invalid credential (secret key).");
if (null == Util.fixEmptyAndTrim(cloudGlobalKeyId)) {
return FormValidation.error("Cloud RSA key is not specified.");
return FormValidation.error("Cloud RSA key is not specified.");
}

// Remove empty text/whitespace from the fields.
Loading

0 comments on commit c36d740

Please sign in to comment.