Always add SecureStore module in WebAppInitializer

SecureStore module was only added when gerrit_site is found in the
database, not when it's specified as a system property. This was
causing Gerrit initialization error[1] when deploying in a web container
and configuring the site using gerrit.site_path property.

[1] https://groups.google.com/forum/#!topic/repo-discuss/oW7i93mZhRo

Change-Id: Ib723f1c37071142048f30585ab8e7a298c37664e
This commit is contained in:
Hugo Arès 2015-05-13 14:47:10 -04:00 committed by Saša Živkov
parent fae221fd47
commit c3bc589e29

View File

@ -210,6 +210,7 @@ public class WebAppInitializer extends GuiceServletContextListener
private Injector createDbInjector() { private Injector createDbInjector() {
final List<Module> modules = new ArrayList<>(); final List<Module> modules = new ArrayList<>();
AbstractModule secureStore = createSecureStoreModule(); AbstractModule secureStore = createSecureStoreModule();
modules.add(secureStore);
if (sitePath != null) { if (sitePath != null) {
Module sitePathModule = new AbstractModule() { Module sitePathModule = new AbstractModule() {
@Override @Override
@ -243,7 +244,6 @@ public class WebAppInitializer extends GuiceServletContextListener
}); });
} else { } else {
modules.add(secureStore);
modules.add(new LifecycleModule() { modules.add(new LifecycleModule() {
@Override @Override
protected void configure() { protected void configure() {