From b2fdc1cb5e38e39250af702d1e19ed691e4df7d5 Mon Sep 17 00:00:00 2001 From: Eric Wolinetz Date: Wed, 23 Aug 2017 09:56:34 -0500 Subject: Creating structure to warn for use of deprecated variables and set them in a single location before they are no longer honored --- .../filter_plugins/openshift_logging.py | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 roles/openshift_sanitize_inventory/filter_plugins/openshift_logging.py (limited to 'roles/openshift_sanitize_inventory/filter_plugins') diff --git a/roles/openshift_sanitize_inventory/filter_plugins/openshift_logging.py b/roles/openshift_sanitize_inventory/filter_plugins/openshift_logging.py new file mode 100644 index 000000000..d42c9bdb9 --- /dev/null +++ b/roles/openshift_sanitize_inventory/filter_plugins/openshift_logging.py @@ -0,0 +1,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 + } -- cgit v1.2.3