mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
[FIXED JENKINS-24340] - Do not disable jobs if supportsMakeDisabled() 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>
This commit is contained in:
1 parent
a6766763c1
commit
a78f1d3246
1 file changed
+4
@@ -690,9 +690,13 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
Reference in new issue
Block a user