From 897e9d81cfc0dd429971f9e8091b4828480accec Mon Sep 17 00:00:00 2001 From: Marc Handalian Date: Thu, 27 May 2021 10:29:05 -0700 Subject: [PATCH] Remove checks for legacy .yaml and .json config files. Signed-off-by: Marc Handalian --- .../node/InternalSettingsPreparer.java | 8 ------- .../node/InternalSettingsPreparerTests.java | 22 ------------------- 2 files changed, 30 deletions(-) diff --git a/server/src/main/java/org/opensearch/node/InternalSettingsPreparer.java b/server/src/main/java/org/opensearch/node/InternalSettingsPreparer.java index 828a8e146a202..7d0166cb5c7fd 100644 --- a/server/src/main/java/org/opensearch/node/InternalSettingsPreparer.java +++ b/server/src/main/java/org/opensearch/node/InternalSettingsPreparer.java @@ -81,14 +81,6 @@ public static Environment prepareEnvironment(Settings input, Map initializeSettings(output, input, properties); Environment environment = new Environment(output.build(), configPath); - if (Files.exists(environment.configFile().resolve("opensearch.yaml"))) { - throw new SettingsException("opensearch.yaml was deprecated in 5.5.0 and must be renamed to opensearch.yml"); - } - - if (Files.exists(environment.configFile().resolve("opensearch.json"))) { - throw new SettingsException("opensearch.json was deprecated in 5.5.0 and must be converted to opensearch.yml"); - } - output = Settings.builder(); // start with a fresh output Path path = environment.configFile().resolve("opensearch.yml"); if (Files.exists(path)) { diff --git a/server/src/test/java/org/opensearch/node/InternalSettingsPreparerTests.java b/server/src/test/java/org/opensearch/node/InternalSettingsPreparerTests.java index 6c93a66e3d914..32d18c85014b5 100644 --- a/server/src/test/java/org/opensearch/node/InternalSettingsPreparerTests.java +++ b/server/src/test/java/org/opensearch/node/InternalSettingsPreparerTests.java @@ -114,28 +114,6 @@ public void testGarbageIsNotSwallowed() throws IOException { } } - @AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/358") - public void testYamlNotAllowed() throws IOException { - InputStream yaml = getClass().getResourceAsStream("/config/opensearch.yml"); - Path config = homeDir.resolve("config"); - Files.createDirectory(config); - Files.copy(yaml, config.resolve("opensearch.yaml")); - SettingsException e = expectThrows(SettingsException.class, () -> InternalSettingsPreparer.prepareEnvironment( - Settings.builder().put(baseEnvSettings).build(), emptyMap(), null, DEFAULT_NODE_NAME_SHOULDNT_BE_CALLED)); - assertEquals("opensearch.yaml was deprecated in 5.5.0 and must be renamed to opensearch.yml", e.getMessage()); - } - - @AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/358") - public void testJsonNotAllowed() throws IOException { - InputStream yaml = getClass().getResourceAsStream("/config/opensearch.json"); - Path config = homeDir.resolve("config"); - Files.createDirectory(config); - Files.copy(yaml, config.resolve("opensearch.json")); - SettingsException e = expectThrows(SettingsException.class, () -> InternalSettingsPreparer.prepareEnvironment( - Settings.builder().put(baseEnvSettings).build(), emptyMap(), null, DEFAULT_NODE_NAME_SHOULDNT_BE_CALLED)); - assertEquals("opensearch.json was deprecated in 5.5.0 and must be converted to opensearch.yml", e.getMessage()); - } - public void testSecureSettings() { MockSecureSettings secureSettings = new MockSecureSettings(); secureSettings.setString("foo", "secret");