diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/core/registry/docstore/ConfigFormat.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/core/registry/docstore/ConfigFormat.java index ddab606f9ed..723b975b6cc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/core/registry/docstore/ConfigFormat.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/core/registry/docstore/ConfigFormat.java @@ -18,6 +18,8 @@ package org.apache.slider.core.registry.docstore; +import java.util.Locale; + public enum ConfigFormat { JSON("json"), @@ -51,7 +53,7 @@ public enum ConfigFormat { */ public static ConfigFormat resolve(String type) { for (ConfigFormat format: values()) { - if (format.getSuffix().equals(type)) { + if (format.getSuffix().equals(type.toLowerCase(Locale.ENGLISH))) { return format; } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/providers/ProviderUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/providers/ProviderUtils.java index c5e6782ad17..39986c12038 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/providers/ProviderUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/providers/ProviderUtils.java @@ -611,7 +611,7 @@ public class ProviderUtils implements RoleKeys, SliderKeys { } ConfigFormat configFormat = ConfigFormat.resolve(configFileType); if (configFormat == null) { - throw new BadConfigException("Config format " + configFormat + + throw new BadConfigException("Config format " + configFileType + " doesn't exist"); } localizeConfigFile(launcher, roleName, roleGroup, configEntry.getKey(),