Skip to content

Commit

Permalink
[JENKINS-14247] retrieve polling node from Launcher
Browse files Browse the repository at this point in the history
hudson.model.Computer#currentComputer resolves to master during polling
hudson.Launcher#getComputer is deprecated and unsafe but seem to work in this context
  • Loading branch information
ndeloof committed Dec 6, 2012
1 parent 69890c9 commit bfee5ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -734,8 +734,9 @@ protected Date getBuildTime(Run<?, ?> lastBuild) {
* @param launcher actual launcher to launch commands with
* @return a clear tool launcher that uses Hudson for launching commands
*/
public ClearToolLauncher createClearToolLauncher(TaskListener listener, FilePath workspace, Launcher launcher) {
return new HudsonClearToolLauncher(PluginImpl.BASE_DESCRIPTOR.getCleartoolExe(), getDescriptor().getDisplayName(), listener, workspace, launcher);
public ClearToolLauncher createClearToolLauncher(TaskListener listener, FilePath workspace, Launcher launcher) throws IOException, InterruptedException {
String cleartoolExe = PluginImpl.BASE_DESCRIPTOR.getCleartoolExe(launcher.getComputer().getNode(), listener);
return new HudsonClearToolLauncher(cleartoolExe, getDescriptor().getDisplayName(), listener, workspace, launcher);
}

protected ClearTool createClearTool(VariableResolver<String> variableResolver, ClearToolLauncher launcher) {
Expand Down
Expand Up @@ -274,7 +274,7 @@ protected SaveChangeLogAction createSaveChangeLogAction(ClearToolLauncher launch
return new UcmSaveChangeLogAction();
}

public ClearTool createClearTool(AbstractBuild<?, ?> build, Launcher launcher) {
public ClearTool createClearTool(AbstractBuild<?, ?> build, Launcher launcher) throws IOException, InterruptedException {
BuildVariableResolver variableResolver = new BuildVariableResolver(build);
ClearToolLauncher clearToolLauncher = createClearToolLauncher(launcher.getListener(), build.getWorkspace(), launcher);
return createClearTool(variableResolver, clearToolLauncher);
Expand Down

0 comments on commit bfee5ed

Please sign in to comment.