Skip to content

Commit

Permalink
[JENKINS-32571] Follow-up & clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanouse committed Mar 10, 2016
1 parent e1d9256 commit 167cd62
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 167cd62

Please sign in to comment.