Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinston Prakash2014-06-05 00:50:01 -0400
committerWinston Prakash2014-06-05 00:50:01 -0400
commit4c556502bc5db1633f823cbbb0cce14cd3be3e1f (patch)
tree031da9fa58fbc7a41d264c73d43344ae185611f4 /hudson-core/src/main/resources/hudson
parent1a293b9f44d72701ca2e9c00cdc07d871fc44ea5 (diff)
downloadorg.eclipse.hudson.core-4c556502bc5db1633f823cbbb0cce14cd3be3e1f.tar.gz
org.eclipse.hudson.core-4c556502bc5db1633f823cbbb0cce14cd3be3e1f.tar.xz
org.eclipse.hudson.core-4c556502bc5db1633f823cbbb0cce14cd3be3e1f.zip
Fix: 436620 - Cannot launch slave created as a team node
Diffstat (limited to 'hudson-core/src/main/resources/hudson')
-rw-r--r--hudson-core/src/main/resources/hudson/model/Hudson/jnlp-error.jelly28
-rw-r--r--hudson-core/src/main/resources/hudson/slaves/JNLPLauncher/main.jelly18
-rw-r--r--hudson-core/src/main/resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly5
3 files changed, 40 insertions, 11 deletions
diff --git a/hudson-core/src/main/resources/hudson/model/Hudson/jnlp-error.jelly b/hudson-core/src/main/resources/hudson/model/Hudson/jnlp-error.jelly
new file mode 100644
index 00000000..61110419
--- /dev/null
+++ b/hudson-core/src/main/resources/hudson/model/Hudson/jnlp-error.jelly
@@ -0,0 +1,28 @@
+<!-- **************************************************************************
+#
+# Copyright (c) 2014, Oracle Corporation
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#
+# Winston Prakash
+#
+#************************************************************************** -->
+
+<!--
+ This is used to create the first user.
+-->
+<?jelly escape-by-default='true'?>
+<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
+ <st:statusCode value="404" />
+ <l:layout title="Slave JNLP Error">
+ <l:main-panel>
+ <h1>Failed to fetch JNLP</h1>
+ <p>The JNLP for the specified slave could not be retrieved. Check the slave name and retry.</p>
+ </l:main-panel>
+ </l:layout>
+</j:jelly>
diff --git a/hudson-core/src/main/resources/hudson/slaves/JNLPLauncher/main.jelly b/hudson-core/src/main/resources/hudson/slaves/JNLPLauncher/main.jelly
index 178a123c..4db9b6d6 100644
--- a/hudson-core/src/main/resources/hudson/slaves/JNLPLauncher/main.jelly
+++ b/hudson-core/src/main/resources/hudson/slaves/JNLPLauncher/main.jelly
@@ -17,7 +17,8 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
- <j:choose>
+ <j:set var="jnlpRootURL" value="${app.rootUrl}" />
+ <j:choose>
<j:when test="${app.slaveAgentPort==-1}">
<div class="error">
${%slaveAgentPort.disabled}
@@ -25,14 +26,15 @@
</div>
</j:when>
<j:when test="${it.offline and !it.temporarilyOffline}">
- <l:isAdmin><!-- TODO: we need a permission to launch a slave -->
- <p>
+
+ <j:if test="${app.teamManagementEnabled ? it.hasPermission(it.CONFIGURE) : h.hasPermission(app.ADMINISTER)}">
+ <p>
${%Connect slave to Hudson one of these ways:}
</p>
<ul>
<li>
<p>
- <a href="slave-agent.jnlp" id="jnlp-link">
+ <a href="${jnlpRootURL}slaveJnlp?name=${it.name}" id="jnlp-link">
<img src="${imagesURL}/webstart.gif" alt="${%launch agent}" />
</a>
${%Launch agent from browser on slave}
@@ -42,13 +44,13 @@
<p>
${%Run from slave command line:}
</p>
- <pre>javaws ${h.inferHudsonURL(request)}${it.url}slave-agent.jnlp</pre>
+ <pre>javaws ${jnlpRootURL}slaveJnlp?name=${it.name}</pre>
</li>
<li>
<p>
${%Or if the slave is headless:}
</p>
- <pre>java -jar <a href="${rootURL}/jnlpJars/slave.jar">slave.jar</a> -jnlpUrl ${h.inferHudsonURL(request)}${it.url}slave-agent.jnlp</pre>
+ <pre>java -jar <a href="${rootURL}/jnlpJars/slave.jar">slave.jar</a> -jnlpUrl ${jnlpRootURL}slaveJnlp?name=${it.name}</pre>
</li>
</ul>
<!--
@@ -57,8 +59,8 @@
(tweak launch parameters)
</a>
</p>
- -->
- </l:isAdmin>
+ -->
+ </j:if>
</j:when>
<j:otherwise>
<p>
diff --git a/hudson-core/src/main/resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly b/hudson-core/src/main/resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly
index 2c06319d..d8129be0 100644
--- a/hudson-core/src/main/resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly
+++ b/hudson-core/src/main/resources/hudson/slaves/SlaveComputer/slave-agent.jnlp.jelly
@@ -20,14 +20,13 @@
<st:contentType value="application/x-java-jnlp-file" />
<j:new var="h" className="hudson.Functions" />
<j:set var="rootURL" value="${app.rootUrl}" />
-
<!--
See http://www.dallaway.com/acad/webstart/ for obtaining the certificate.
-->
<l:isAdminOrTest test="true">
<!-- See http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html for the syntax -->
<jnlp spec="1.0+"
- codebase="${rootURL}computer/${h.encode(it.node.nodeName)}/">
+ codebase="${rootURL}/computer/${h.encode(it.node.nodeName)}/">
<information>
<title>Slave Agent for ${it.displayName}</title>
@@ -49,7 +48,7 @@
<j2se version="1.5+" java-vm-args="${it.launcher.vmargs}"/>
</j:otherwise>
</j:choose>
- <jar href="${rootURL}jnlpJars/remoting.jar"/>
+ <jar href="${rootURL}/jnlpJars/remoting.jar"/>
<property name="hudson.showWindowsServiceInstallLink" value="false" />
</resources>

Back to the top