提交 c3bc2214 编写于 作者: N Nicolas De loof

Merge pull request #1781 from ndeloof/isUnix

Make it easier to determine Computer is Unix or Windows
......@@ -28,6 +28,7 @@ import edu.umd.cs.findbugs.annotations.OverrideMustInvoke;
import edu.umd.cs.findbugs.annotations.When;
import hudson.EnvVars;
import hudson.Extension;
import hudson.Functions;
import hudson.Launcher.ProcStarter;
import hudson.Util;
import hudson.cli.declarative.CLIMethod;
......@@ -522,7 +523,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
@CLIMethod(name="online-node")
public void cliOnline() throws ExecutionException, InterruptedException {
checkPermission(CONNECT);
setTemporarilyOffline(false,null);
setTemporarilyOffline(false, null);
}
/**
......@@ -545,6 +546,16 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
return nodeName != null ? nodeName : "";
}
/**
* True if this computer is a Unix machine (as opposed to Windows machine).
*
* @return
* null if the computer is disconnected and therefore we don't know whether it is Unix or not.
*/
public Boolean isUnix() {
return !Functions.isWindows();
}
/**
* Returns the {@link Node} that this computer represents.
*
......
......@@ -172,12 +172,7 @@ public class SlaveComputer extends Computer {
this.acceptingTasks = acceptingTasks;
}
/**
* True if this computer is a Unix machine (as opposed to Windows machine).
*
* @return
* null if the computer is disconnected and therefore we don't know whether it is Unix or not.
*/
@Override
public Boolean isUnix() {
return isUnix;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册