Skip to content

Commit

Permalink
[FIXED JENKINS-24340] - Do not disable jobs if supportsMakeDisabled()…
Browse files Browse the repository at this point in the history
… returns false

This changes prevents the improper usage of method without the preliminary supportsMakeDisabled() check.
As an example, Subversion plugin behaves in such way (JENKINS-24341)

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
(cherry picked from commit a78f1d3)
  • Loading branch information
oleg-nenashev authored and olivergondza committed Nov 7, 2014
1 parent 3eefad8 commit 1b0d8fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -690,9 +690,13 @@ public FormValidation doCheckRetryCount(@QueryParameter String value)throws IOEx

/**
* Marks the build as disabled.
* The method will ignore the disable command if {@link #supportsMakeDisabled()}
* returns false. The enable command will be executed in any case.
* @param b true - disable, false - enable
*/
public void makeDisabled(boolean b) throws IOException {
if(disabled==b) return; // noop
if (b && !supportsMakeDisabled()) return; // do nothing if the disabling is unsupported
this.disabled = b;
if(b)
Jenkins.getInstance().getQueue().cancel(this);
Expand Down

0 comments on commit 1b0d8fb

Please sign in to comment.