Remove checks for legacy .yaml and .json config files. (#792)

Signed-off-by: Marc Handalian <handalm@amazon.com>
This commit is contained in:
Marc Handalian 2021-06-03 12:09:57 -07:00 committed by GitHub
parent b3c8f71e2d
commit da78b889c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 30 deletions

View File

@ -81,14 +81,6 @@ public class InternalSettingsPreparer {
initializeSettings(output, input, properties); initializeSettings(output, input, properties);
Environment environment = new Environment(output.build(), configPath); 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 output = Settings.builder(); // start with a fresh output
Path path = environment.configFile().resolve("opensearch.yml"); Path path = environment.configFile().resolve("opensearch.yml");
if (Files.exists(path)) { if (Files.exists(path)) {

View File

@ -114,28 +114,6 @@ public class InternalSettingsPreparerTests extends OpenSearchTestCase {
} }
} }
@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() { public void testSecureSettings() {
MockSecureSettings secureSettings = new MockSecureSettings(); MockSecureSettings secureSettings = new MockSecureSettings();
secureSettings.setString("foo", "secret"); secureSettings.setString("foo", "secret");