mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-10 02:26:18 +00:00
[FIXED JENKINS-21999] If a slave node does not exist it will throw a
null pointer exception. Instead we create a dummy launcher and return that if it is unable to get the slave node.
This commit is contained in:
1 parent
2ae83f6ab0
commit
d2a2ec589f
2 files changed
+38
-1
No files matched your search
@@ -841,6 +841,31 @@ public abstract class Launcher {
|
||||
}
|
||||
}
|
||||
|
||||
public static class DummyLauncher extends Launcher {
|
||||
|
||||
public DummyLauncher(TaskListener listener) {
|
||||
super(listener, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Proc launch(ProcStarter starter) throws IOException {
|
||||
listener.error("Can not call launch on a dummy launcher.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Channel launchChannel(String[] cmd, OutputStream out, FilePath workDir, Map<String, String> envVars) throws IOException, InterruptedException {
|
||||
listener.error("Can not call launchChannel on a dummy launcher.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill(Map<String, String> modelEnvVars) throws IOException, InterruptedException {
|
||||
// Kill method should do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Launches processes remotely by using the given channel.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user