提交 7d01b853 编写于 作者: K kohsuke

improved error diagnostics. See...

improved error diagnostics. See http://www.nabble.com/Hudson-Slave-access---Remote-Dir-tt18478152.html

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10862 71c3de6d-444a-0410-be80-ed276b4c234a
上级 b499ff8e
......@@ -2243,6 +2243,30 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node,
}.process();
}
/**
* Performs syntactical check on the remote FS for slaves.
*
* TODO: find a better home for this method.
*/
public void doRemoteFSCheck(StaplerRequest req, StaplerResponse rsp, @QueryParameter("value") final String value) throws IOException, ServletException {
new FormFieldValidator(req,rsp,false) {
protected void check() throws IOException, ServletException {
if(Util.fixEmptyAndTrim(value)==null) {
error("Remote directory is mandatory");
return;
}
if(value.startsWith("\\\\") || value.startsWith("/net/")) {
warning("Are you sure you want to use network mounted file system for FS root? " +
"Note that this directory needs not be visible to the master.");
return;
}
ok();
}
}.process();
}
/**
* Serves static resources placed along with Jelly view files.
* <p>
......
......@@ -60,7 +60,7 @@
<s:entry title="${%Remote FS root}" help="/help/system-config/master-slave/remoteFS.html">
<s:textbox name="slave.remoteFS" value="${s.remoteFS}"
checkUrl="'fieldCheck?errorText='+escape('${%Remote directory is mandatory.}')+'&amp;value='+escape(this.value)"/>
checkUrl="'remoteFSCheck?value='+escape(this.value)"/>
</s:entry>
<s:entry title="${%Labels}" help="/help/system-config/master-slave/label.html">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册