Skip to content

Commit

Permalink
Merge pull request #15 from pjanouse/JENKINS-32571-cleanup
Browse files Browse the repository at this point in the history
[JENKINS-32571] Follow-up & clean-up
  • Loading branch information
rsandell committed Mar 14, 2016
2 parents e27cb2e + 167cd62 commit cd049fc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/hudson/cli/CLICommandInvoker.java
Expand Up @@ -120,8 +120,6 @@ public Result invokeWithArgs(final String... args) {

public Result invoke() {

Result result;
Error executionError = null;
setAuth();

final ByteArrayOutputStream out = new ByteArrayOutputStream();
Expand All @@ -131,11 +129,9 @@ public Result invoke() {
args, locale, stdin, new PrintStream(out), new PrintStream(err)
);

result = new Result(returnCode, out, err);

restoreAuth();

return result;
return new Result(returnCode, out, err);
}

private static class GrantPermissions extends AuthorizationStrategy {
Expand Down Expand Up @@ -169,6 +165,7 @@ public Collection<String> getGroups() {
return Collections.emptySet();
}
}

private void setAuth() {

if (permissions.isEmpty()) return;
Expand Down

0 comments on commit cd049fc

Please sign in to comment.