Fix index ssh commands with elasticsearch type
Previously, executing the index changes and project ssh commands on the
elasticsearch index type Gerrit site would result in the error: "fatal:
gerrit: index not found". This change modifies the condition that
restricts the indexing of changes and projects to only Lucene type site
so that the index commands are available for the elasticsearch type
site.
Bug: Issue 8690
Change-Id: I139ffad045b4d855f7b341c769fa38c3831cd58c
diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java
index cfa2dfa..e85adcf 100644
--- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java
+++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java
@@ -486,7 +486,7 @@
slave,
sysInjector.getInstance(DownloadConfig.class),
sysInjector.getInstance(LfsPluginAuthCommand.Module.class)));
- if (!slave && indexType == IndexType.LUCENE) {
+ if (!slave) {
modules.add(new IndexCommandsModule());
}
return sysInjector.createChildInjector(modules);
diff --git a/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java b/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java
index 634abb9..2450ae7 100644
--- a/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java
+++ b/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java
@@ -391,9 +391,7 @@
false,
sysInjector.getInstance(DownloadConfig.class),
sysInjector.getInstance(LfsPluginAuthCommand.Module.class)));
- if (indexType == IndexType.LUCENE) {
- modules.add(new IndexCommandsModule());
- }
+ modules.add(new IndexCommandsModule());
return sysInjector.createChildInjector(modules);
}