Skip to content

Instantly share code, notes, and snippets.

@imeredith
Created May 23, 2012 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imeredith/7c045cf3d015c21fbc85 to your computer and use it in GitHub Desktop.
Save imeredith/7c045cf3d015c21fbc85 to your computer and use it in GitHub Desktop.
diff --git a/core/src/main/java/hudson/model/ComputerSet.java b/core/src/main/java/hudson/model/ComputerSet.java
index 03ddfbb..21999f8 100644
--- a/core/src/main/java/hudson/model/ComputerSet.java
+++ b/core/src/main/java/hudson/model/ComputerSet.java
@@ -140,7 +140,7 @@ public final class ComputerSet extends AbstractModelObject {
public int getTotalExecutors() {
int r=0;
for (Computer c : get_all()) {
- if(c.isOnline())
+ if(c.getNode().getMode() != Node.Mode.EXCLUSIVE && c.isOnline())
r += c.countExecutors();
}
return r;
@@ -153,7 +153,7 @@ public final class ComputerSet extends AbstractModelObject {
public int getBusyExecutors() {
int r=0;
for (Computer c : get_all()) {
- if(c.isOnline())
+ if(c.getNode().getMode() != Node.Mode.EXCLUSIVE && c.isOnline())
r += c.countBusy();
}
return r;
@@ -165,7 +165,7 @@ public final class ComputerSet extends AbstractModelObject {
public int getIdleExecutors() {
int r=0;
for (Computer c : get_all())
- if(c.isOnline() || c.isConnecting())
+ if(c.getNode().getMode() != Node.Mode.EXCLUSIVE && (c.isOnline() || c.isConnecting()))
r += c.countIdle();
return r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment