diff options
author | Joel Diaz <jdiaz@redhat.com> | 2017-01-27 20:39:06 +0000 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2017-02-01 15:08:32 -0500 |
commit | b5de5357042c146a930097d52c3920808af89c42 (patch) | |
tree | b35d132b049f8a9c05e48b98b7603ea7d996455d /roles/lib_openshift/src/test/integration/filter_plugins | |
parent | 287282e3a1c36ea2c7bc9eb14e463fd347c7d95a (diff) | |
download | openshift-b5de5357042c146a930097d52c3920808af89c42.tar.gz openshift-b5de5357042c146a930097d52c3920808af89c42.tar.bz2 openshift-b5de5357042c146a930097d52c3920808af89c42.tar.xz openshift-b5de5357042c146a930097d52c3920808af89c42.zip |
oc_label ansible module
used for adding/removing labels on various OpenShift objects
Diffstat (limited to 'roles/lib_openshift/src/test/integration/filter_plugins')
-rw-r--r-- | roles/lib_openshift/src/test/integration/filter_plugins/filters.py | 25 |
1 files changed, 25 insertions, 0 deletions
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: <key> value: <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, + } |