diff --git a/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java b/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java index b86e36d772c..54cd34d6742 100644 --- a/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java +++ b/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java @@ -93,7 +93,9 @@ final class RemovePluginCommand extends SettingCommand { // a message so the user knows in case they want to remove manually final Path pluginConfigDir = env.configFile().resolve(pluginName); if (Files.exists(pluginConfigDir)) { - terminal.println("-> Preserving plugin config files: " + pluginConfigDir); + terminal.println( + "-> Preserving plugin config files [" + pluginConfigDir + "] in case of upgrade, delete manually if not needed"); } } + } diff --git a/qa/evil-tests/src/test/java/org/elasticsearch/plugins/RemovePluginCommandTests.java b/qa/evil-tests/src/test/java/org/elasticsearch/plugins/RemovePluginCommandTests.java index b54c5ed00e4..ab4f00492b0 100644 --- a/qa/evil-tests/src/test/java/org/elasticsearch/plugins/RemovePluginCommandTests.java +++ b/qa/evil-tests/src/test/java/org/elasticsearch/plugins/RemovePluginCommandTests.java @@ -119,7 +119,7 @@ public class RemovePluginCommandTests extends ESTestCase { Files.createFile(configDir.resolve("fake.yml")); final MockTerminal terminal = removePlugin("fake", home); assertTrue(Files.exists(env.configFile().resolve("fake"))); - assertThat(terminal.getOutput(), containsString("-> Preserving plugin config files: " + configDir)); + assertThat(terminal.getOutput(), containsString(expectedConfigDirPreservedMessage(configDir))); assertRemoveCleaned(env); } @@ -127,7 +127,11 @@ public class RemovePluginCommandTests extends ESTestCase { Files.createDirectories(env.pluginsFile().resolve("fake")); final Path configDir = env.configFile().resolve("fake"); final MockTerminal terminal = removePlugin("fake", home); - assertThat(terminal.getOutput(), not(containsString("-> Preserving plugin config files: " + configDir))); + assertThat(terminal.getOutput(), not(containsString(expectedConfigDirPreservedMessage(configDir)))); + } + + private String expectedConfigDirPreservedMessage(final Path configDir) { + return "-> Preserving plugin config files [" + configDir + "] in case of upgrade, delete manually if not needed"; } }