提交 96f06f1d 编写于 作者: K kohsuke

fixed #150.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1162 71c3de6d-444a-0410-be80-ed276b4c234a
上级 38024d99
......@@ -4,6 +4,7 @@ import hudson.FilePath;
import hudson.Launcher;
import hudson.Proc;
import hudson.Util;
import hudson.model.Descriptor.FormException;
import hudson.util.ArgumentListBuilder;
import java.io.File;
......@@ -56,7 +57,7 @@ public final class Slave implements Node {
*/
private Mode mode;
public Slave(String name, String description, String command, String remoteFS, File localFS, int numExecutors, Mode mode) {
public Slave(String name, String description, String command, String remoteFS, File localFS, int numExecutors, Mode mode) throws FormException {
this.name = name;
this.description = description;
this.command = command;
......@@ -64,6 +65,13 @@ public final class Slave implements Node {
this.localFS = localFS;
this.numExecutors = numExecutors;
this.mode = mode;
if (!name.equals(""))
throw new FormException("Invalid slave configuration. Name is empty", null);
if (!localFS.exists())
throw new FormException("Invalid slave configuration for " + name + ". No such directory exists: " + localFS, null);
if (remoteFS.equals(""))
throw new FormException("Invalid slave configuration for " + name + ". No remote directory given", null);
}
public String getNodeName() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册