From 06b41b422d41217b5586c771d4e71da65c3d8919 Mon Sep 17 00:00:00 2001 From: Borui Tao Date: Wed, 4 Apr 2018 14:18:11 -0400 Subject: [PATCH] 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 --- gerrit-pgm/src/main/java/com/google/gerrit/pgm/Daemon.java | 2 +- .../main/java/com/google/gerrit/httpd/WebAppInitializer.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) 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 cfa2dfa561..e85adcf561 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 @@ public class Daemon extends SiteProgram { 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 634abb9b80..2450ae7340 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 @@ public class WebAppInitializer extends GuiceServletContextListener implements Fi 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); }