cmanaha / python-elasticsearch-logger

Python Elasticsearch handler for the standard python logging framework
Other
232 stars 116 forks source link

enum34: KeyError in _INDEX_FREQUENCY_FUNCION_DICT lookup #57

Open tacsnack opened 5 years ago

tacsnack commented 5 years ago

With enum34 installed (due to other dependencies in a common environment) a KeyError is raised doing the _INDEX_FREQUENCY_FUNCION_DICT lookup.

    self._index_name_func = CMRESHandler._INDEX_FREQUENCY_FUNCION_DICT[self.index_name_frequency]
KeyError: 0

This occurs due to the fact that enum.py treated enums as ints and enum34 treats them as the class. Happy to help resolve this one as this will be a step to making this package py3 compatible potentially.

Thanks for your work on this. A really great package.