Skip to content

Commit

Permalink
[FIXED JENKINS-21772] Only cache CLI credentials in ~/.hudson if it e…
Browse files Browse the repository at this point in the history
…xists.
  • Loading branch information
daniel-beck authored and vjuranek committed Feb 12, 2014
1 parent 6e8278b commit 237dda4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/java/hudson/cli/ClientAuthenticationCache.java
Expand Up @@ -43,7 +43,11 @@ public ClientAuthenticationCache(Channel channel) throws IOException, Interrupte
store = (channel==null ? MasterComputer.localChannel : channel).call(new Callable<FilePath, IOException>() {
public FilePath call() throws IOException {
File home = new File(System.getProperty("user.home"));
return new FilePath(new File(home, ".hudson/cli-credentials"));
File hudsonHome = new File(home, ".hudson");
if (hudsonHome.exists()) {
return new FilePath(new File(hudsonHome, "cli-credentials"));
}
return new FilePath(new File(home, ".jenkins/cli-credentials"));
}
});
if (store.exists()) {
Expand Down

0 comments on commit 237dda4

Please sign in to comment.