YARN-5828. Native services client errors out when config formats are uppercase. Contributed by Billie Rinaldi
This commit is contained in:
parent
7757f6fe4a
commit
d1ee95981e
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue