summaryrefslogtreecommitdiffstats
path: root/roles/openshift_sanitize_inventory/filter_plugins/openshift_logging.py
blob: d42c9bdb9d7f77ce2f6c110593429be14a341e00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'''
 Openshift Logging class that provides useful filters used in Logging.

 This should be removed after map_from_pairs is no longer used in __deprecations_logging.yml
'''


def map_from_pairs(source, delim="="):
    ''' Returns a dict given the source and delim delimited '''
    if source == '':
        return dict()

    return dict(item.split(delim) for item in source.split(","))


# pylint: disable=too-few-public-methods
class FilterModule(object):
    ''' OpenShift Logging Filters '''

    # pylint: disable=no-self-use, too-few-public-methods
    def filters(self):
        ''' Returns the names of the filters provided by this class '''
        return {
            'map_from_pairs': map_from_pairs
        }