Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hudson-core/src/main/java/hudson/slaves/AbstractCloudSlave.java6
-rw-r--r--hudson-core/src/main/java/hudson/slaves/NodeProvisioner.java11
2 files changed, 15 insertions, 2 deletions
diff --git a/hudson-core/src/main/java/hudson/slaves/AbstractCloudSlave.java b/hudson-core/src/main/java/hudson/slaves/AbstractCloudSlave.java
index 4fffb896..82ca40ac 100644
--- a/hudson-core/src/main/java/hudson/slaves/AbstractCloudSlave.java
+++ b/hudson-core/src/main/java/hudson/slaves/AbstractCloudSlave.java
@@ -57,7 +57,11 @@ public abstract class AbstractCloudSlave extends Slave {
_terminate(new StreamTaskListener(System.out, Charset.defaultCharset()));
} finally {
try {
- Hudson.getInstance().removeNode(this);
+ Hudson hudson = Hudson.getInstance();
+ hudson.removeNode(this);
+ if (hudson.isTeamManagementEnabled()) {
+ hudson.getTeamManager().removeNode(getNodeName());
+ }
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to remove " + name, e);
}
diff --git a/hudson-core/src/main/java/hudson/slaves/NodeProvisioner.java b/hudson-core/src/main/java/hudson/slaves/NodeProvisioner.java
index 3260f5dd..20d397d2 100644
--- a/hudson-core/src/main/java/hudson/slaves/NodeProvisioner.java
+++ b/hudson-core/src/main/java/hudson/slaves/NodeProvisioner.java
@@ -123,7 +123,16 @@ public class NodeProvisioner {
PlannedNode f = itr.next();
if (f.future.isDone()) {
try {
- hudson.addNode(f.future.get());
+ Node node = f.future.get();
+ // Add to public team
+ hudson.addNode(node);
+ if (hudson.isTeamManagementEnabled()) {
+ try {
+ hudson.getTeamManager().addNode(null, node.getNodeName());
+ } catch (Exception e) {
+ LOGGER.log(Level.SEVERE, "Node cannot be added to public team", e);
+ }
+ }
LOGGER.info(f.displayName + " provisioning successfully completed. We have now " + hudson.getComputers().length + " computer(s)");
} catch (InterruptedException e) {
throw new AssertionError(e); // since we confirmed that the future is already done

Back to the top