From 7d01b8536c53a1551d96a790e03b20993a1faed6 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 17 Jul 2008 04:57:08 +0000 Subject: [PATCH] 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 --- core/src/main/java/hudson/model/Hudson.java | 24 +++++++++++++++++++ .../model/Hudson/configureExecutors.jelly | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index fc21ee03db..adccb05a8d 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -2243,6 +2243,30 @@ public final class Hudson extends View implements ItemGroup, 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. *

diff --git a/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly b/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly index 0e91a2a554..94740c9c2c 100644 --- a/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly +++ b/core/src/main/resources/hudson/model/Hudson/configureExecutors.jelly @@ -60,7 +60,7 @@ + checkUrl="'remoteFSCheck?value='+escape(this.value)"/> -- GitLab