Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/hudson/plugins/libvirt/PluginImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,30 @@
}

@POST
public FormValidation doCheckStartupWaitingPeriodSeconds(@QueryParameter String secsValue)
public FormValidation doCheckStartupWaitingPeriodSeconds(@QueryParameter String value)
throws IOException, ServletException {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);
try {
int v = Integer.parseInt(secsValue);
int v = Integer.parseInt(value);
if (v < 0) {
return FormValidation.error("Negative value..");
} else if (v == 0) {
return FormValidation.warning("You declared this virtual machine to be ready right away. "
+ "It probably needs a couple of seconds before it is ready to process jobs!");
} else {
return FormValidation.ok();
}
} catch (NumberFormatException e) {
return FormValidation.error("Not a number..");
}
}

@POST
public FormValidation doCheckStartupTimesToRetryOnFailure(@QueryParameter String retriesValue)
public FormValidation doCheckStartupTimesToRetryOnFailure(@QueryParameter String value)
throws IOException, ServletException {
Jenkins.get().checkPermission(Jenkins.ADMINISTER);
try {
int v = Integer.parseInt(retriesValue);
int v = Integer.parseInt(value);

Check warning on line 133 in src/main/java/hudson/plugins/libvirt/PluginImpl.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 114-133 are not covered by tests
if (v < 0) {
return FormValidation.error("Negative value.");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
</f:entry>

<f:entry title="${%Startup Idle (sec)}" field="startupWaitingPeriodSeconds" help="/plugin/libvirt-slave/help-libvirt-waitingperiod.html">
<f:textbox checkMethod="post" default="60" checkUrl="'${rootURL}/plugin/libvirt-slave/checkStartupWaitingPeriodSeconds?secsValue='+this.value"/>
<f:textbox checkMethod="post" default="60" checkUrl="${rootURL}/plugin/libvirt-slave/checkStartupWaitingPeriodSeconds" checkDependsOn=""/>
</f:entry>

<f:entry title="${%Times to Retry Startup}" field="startupTimesToRetryOnFailure" help="/plugin/libvirt-slave/help-libvirt-timesToRetryOnFailure.html">
<f:textbox checkMethod="post" default="0" checkUrl="'${rootURL}/plugin/libvirt-slave/checkStartupTimesToRetryOnFailure?retriesValue='+this.value"/>
<f:textbox checkMethod="post" default="0" checkUrl="${rootURL}/plugin/libvirt-slave/checkStartupTimesToRetryOnFailure" checkDependsOn=""/>
</f:entry>

<f:entry title="${%# of executors}" field="numExecutors">
<f:textbox checkMethod="post"/>
<f:textbox checkMethod="post" default="1"/>
</f:entry>

<f:entry title="${%Remote FS root}" field="remoteFS">
Expand Down
Loading