Fixed parser to treat enum values as case-insensitive

This commit is contained in:
dvanaken 2020-01-09 18:12:38 -05:00 committed by Dana Van Aken
parent 2adab245c0
commit 2f79bfdc17
1 changed files with 3 additions and 1 deletions

View File

@ -61,8 +61,10 @@ class BaseParser:
def convert_enum(self, enum_value, metadata): def convert_enum(self, enum_value, metadata):
enumvals = metadata.enumvals.split(',') enumvals = metadata.enumvals.split(',')
lower_enumvals = [ev.lower() for ev in enumvals]
lower_enum_value = enum_value.lower()
try: try:
res = enumvals.index(enum_value) res = lower_enumvals.index(lower_enum_value)
except ValueError: except ValueError:
raise Exception('Invalid enum value for variable {} ({})'.format( raise Exception('Invalid enum value for variable {} ({})'.format(
metadata.name, enum_value)) metadata.name, enum_value))