[JENKINS-34710] - PluginWrapper should not throw IOException if somebody enables the enabled plugin (#2327)

This commit is contained in:
Oleg Nenashev committed 2016-05-11 12:11:02 +02:00
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);
}