diff options
author | David Pursehouse <dpursehouse@collab.net> | 2017-03-16 05:44:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-03-16 05:44:14 +0000 |
commit | be3ec9856c2b637ace70e5b905e79cb6b944de65 (patch) | |
tree | 560d2b426a17aa1533316e1409fe7c2bf87b4c8c | |
parent | 7a3c6ef6064ee7db54dbecfbd86cdbe687d11d18 (diff) | |
parent | 07d7f65fedd897880b5a6bd23bac22c80f6a2e37 (diff) |
Merge "LfsPluginAuthCommand: Don't spam error log when LFS plugin is missing" into stable-2.13
-rw-r--r-- | gerrit-sshd/src/main/java/com/google/gerrit/sshd/plugin/LfsPluginAuthCommand.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/plugin/LfsPluginAuthCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/plugin/LfsPluginAuthCommand.java index 0c8d024f1a..3f4ca616d0 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/plugin/LfsPluginAuthCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/plugin/LfsPluginAuthCommand.java @@ -24,11 +24,18 @@ import com.google.inject.Provider; import org.eclipse.jgit.lib.Config; import org.kohsuke.args4j.Argument; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; public class LfsPluginAuthCommand extends SshCommand { + private static final Logger log = + LoggerFactory.getLogger(LfsPluginAuthCommand.class); + private static final String CONFIGURATION_ERROR = "Server configuration error:" + + " LFS auth over SSH is not properly configured."; + public interface LfsSshPluginAuth { String authenticate(CurrentUser user, List<String> args) throws UnloggedFailure, Failure; @@ -65,11 +72,11 @@ public class LfsPluginAuthCommand extends SshCommand { } @Override - protected void run() throws UnloggedFailure, Failure, Exception { + protected void run() throws UnloggedFailure, Exception { LfsSshPluginAuth pluginAuth = auth.get(); if (pluginAuth == null) { - throw new Failure(1, "Server configuration error:" - + " LFS auth over SSH is not properly configured."); + log.warn(CONFIGURATION_ERROR); + throw new UnloggedFailure(1, CONFIGURATION_ERROR); } stdout.print(pluginAuth.authenticate(user.get(), args)); |