From b5de5357042c146a930097d52c3920808af89c42 Mon Sep 17 00:00:00 2001 From: Joel Diaz Date: Fri, 27 Jan 2017 20:39:06 +0000 Subject: oc_label ansible module used for adding/removing labels on various OpenShift objects --- .../src/test/integration/filter_plugins/filters.py | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 roles/lib_openshift/src/test/integration/filter_plugins/filters.py (limited to 'roles/lib_openshift/src/test/integration/filter_plugins/filters.py') diff --git a/roles/lib_openshift/src/test/integration/filter_plugins/filters.py b/roles/lib_openshift/src/test/integration/filter_plugins/filters.py new file mode 100644 index 000000000..6acbb47ec --- /dev/null +++ b/roles/lib_openshift/src/test/integration/filter_plugins/filters.py @@ -0,0 +1,25 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# vim: expandtab:tabstop=4:shiftwidth=4 +''' +Custom filters for use in testing +''' + +class FilterModule(object): + ''' Custom ansible filters ''' + + @staticmethod + def label_dict_to_key_value_list(label_dict): + ''' given a dict of labels/values, return list of key: value: pairs''' + + label_list = [] + for key in label_dict: + label_list.append({'key': key, 'value': label_dict[key]}) + + return label_list + + def filters(self): + ''' returns a mapping of filters to methods ''' + return { + "label_dict_to_key_value_list": self.label_dict_to_key_value_list, + } -- cgit v1.2.3