Skip to content

Commit f9c6d50

Browse files
committed
Changed error message
1 parent 7ddff9b commit f9c6d50

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/cli/InstallPluginAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ private void verifyLocationNotInPluginsDirectory(String pluginLocation) throws U
349349
if (pluginRealPath.startsWith(pluginsDirectory)) {
350350
throw new UserException(
351351
ExitCodes.USAGE,
352-
"plugin location [" + pluginLocation + "] is inside the plugins directory [" + pluginsDirectory + "]"
352+
"Installation of plugin in location [" + pluginLocation + "] from inside the plugins directory is not permitted."
353353
);
354354
}
355355
}

distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/cli/InstallPluginActionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ public void testSpaceInUrl() throws Exception {
586586
assertPlugin("fake", pluginDir, env.v2());
587587
}
588588

589-
public void testInstallFromInsidePluginsDirectory() throws Exception {
589+
public void testCannotInstallFromInsidePluginsDirectory() throws Exception {
590590
InstallablePlugin pluginZip = createPluginZip("fake", pluginDir);
591591
Path pluginZipInsidePlugins = env.v2().pluginsDir().resolve("fake.zip");
592592
try (InputStream in = FileSystemUtils.openFileURLStream(new URL(pluginZip.getLocation()))) {
@@ -596,7 +596,7 @@ public void testInstallFromInsidePluginsDirectory() throws Exception {
596596
assumeTrue("requires file URL scheme", location.startsWith("file:"));
597597
InstallablePlugin modifiedPlugin = new InstallablePlugin("fake", location);
598598
UserException e = expectThrows(UserException.class, () -> installPlugin(modifiedPlugin));
599-
assertThat(e.getMessage(), startsWith("plugin location [" + location + "] is inside the plugins directory"));
599+
assertThat(e.getMessage(), startsWith("Installation of plugin in location [" + location + "] from inside the plugins directory is not permitted."));
600600
}
601601

602602
public void testMalformedUrlNotMaven() {

0 commit comments

Comments
 (0)