summaryrefslogtreecommitdiffstats
path: root/roles/openshift_storage_glusterfs/filter_plugins
diff options
context:
space:
mode:
authorJose A. Rivera <jarrpa@redhat.com>2017-03-14 19:04:58 -0500
committerJose A. Rivera <jarrpa@redhat.com>2017-04-10 10:58:52 -0500
commit1a72183498f89644aacd32ae52ed3a65d85c86b3 (patch)
tree13083277411db742491aa8c7b4ef3c65412f02b7 /roles/openshift_storage_glusterfs/filter_plugins
parentde6629addd794c6daaf018943097cc0d6aba5b23 (diff)
downloadopenshift-1a72183498f89644aacd32ae52ed3a65d85c86b3.tar.gz
openshift-1a72183498f89644aacd32ae52ed3a65d85c86b3.tar.bz2
openshift-1a72183498f89644aacd32ae52ed3a65d85c86b3.tar.xz
openshift-1a72183498f89644aacd32ae52ed3a65d85c86b3.zip
GlusterFS playbook and role
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Diffstat (limited to 'roles/openshift_storage_glusterfs/filter_plugins')
-rw-r--r--roles/openshift_storage_glusterfs/filter_plugins/openshift_storage_glusterfs.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/roles/openshift_storage_glusterfs/filter_plugins/openshift_storage_glusterfs.py b/roles/openshift_storage_glusterfs/filter_plugins/openshift_storage_glusterfs.py
new file mode 100644
index 000000000..88801e487
--- /dev/null
+++ b/roles/openshift_storage_glusterfs/filter_plugins/openshift_storage_glusterfs.py
@@ -0,0 +1,23 @@
+'''
+ Openshift Storage GlusterFS class that provides useful filters used in GlusterFS
+'''
+
+
+def map_from_pairs(source, delim="="):
+ ''' Returns a dict given the source and delim delimited '''
+ if source == '':
+ return dict()
+
+ return dict(source.split(delim) for item in source.split(","))
+
+
+# pylint: disable=too-few-public-methods
+class FilterModule(object):
+ ''' OpenShift Storage GlusterFS 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
+ }