mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 23:55:52 +00:00
[JENKINS-34710] - PluginWrapper should not throw IOException if somebody enables the enabled plugin (#2327)
This commit is contained in:
1 parent
58a5d2249d
commit
c83a8fdf0d
1 file changed
+4
@@ -441,6 +441,10 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
* Enables this plugin next time Jenkins runs.
|
||||
*/
|
||||
public void enable() throws IOException {
|
||||
if (!disableFile.exists()) {
|
||||
LOGGER.log(Level.FINEST, "Plugin {0} has been already enabled. Skipping the enable() operation", getShortName());
|
||||
return;
|
||||
}
|
||||
if(!disableFile.delete())
|
||||
throw new IOException("Failed to delete "+disableFile);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user