Skip to content

Commit

Permalink
[JENKINS-38187] Log a warning message in case setSlaveAgentPort is ca…
Browse files Browse the repository at this point in the history
…lled when the port is enforced
  • Loading branch information
Vlatombe committed Sep 27, 2016
1 parent d2bf5d9 commit 38d14de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -1116,7 +1116,9 @@ public boolean isSlaveAgentPortEnforced() {
* 0 to indicate random available TCP port. -1 to disable this service.
*/
public void setSlaveAgentPort(int port) throws IOException {
if (!SLAVE_AGENT_PORT_ENFORCE) {
if (SLAVE_AGENT_PORT_ENFORCE) {
LOGGER.log(Level.WARNING, "setSlaveAgentPort({0}) call ignored because system property {1} is true", new String[] { Integer.toString(port), Jenkins.class.getName()+".slaveAgentPortEnforce" });
} else {
forceSetSlaveAgentPort(port);
}
}
Expand Down

0 comments on commit 38d14de

Please sign in to comment.