summaryrefslogtreecommitdiffstats
path: root/roles/lib_utils
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2018-01-18 13:12:33 -0500
committerMichael Gugino <mgugino@redhat.com>2018-01-18 13:12:33 -0500
commite18a06d2a14c5933243773f0aca7a891177f3e40 (patch)
tree149a79a6a07259693b81e9cfd2b56837a0f8b444 /roles/lib_utils
parent6a26d0c0799cf5915c61205450e18ff010485beb (diff)
downloadopenshift-e18a06d2a14c5933243773f0aca7a891177f3e40.tar.gz
openshift-e18a06d2a14c5933243773f0aca7a891177f3e40.tar.bz2
openshift-e18a06d2a14c5933243773f0aca7a891177f3e40.tar.xz
openshift-e18a06d2a14c5933243773f0aca7a891177f3e40.zip
Add ability to mount volumes into system container nodes
This commit adds the ability to mount volumes into system containerized nodes. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1534933
Diffstat (limited to 'roles/lib_utils')
-rw-r--r--roles/lib_utils/filter_plugins/oo_filters.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/roles/lib_utils/filter_plugins/oo_filters.py b/roles/lib_utils/filter_plugins/oo_filters.py
index 9f73510c4..ef996fefe 100644
--- a/roles/lib_utils/filter_plugins/oo_filters.py
+++ b/roles/lib_utils/filter_plugins/oo_filters.py
@@ -4,6 +4,7 @@
"""
Custom filters for use in openshift-ansible
"""
+import json
import os
import pdb
import random
@@ -586,6 +587,18 @@ that result to this filter plugin.
return secret_name
+def lib_utils_oo_l_of_d_to_csv(input_list):
+ """Map a list of dictionaries, input_list, into a csv string
+ of json values.
+
+ Example input:
+ [{'var1': 'val1', 'var2': 'val2'}, {'var1': 'val3', 'var2': 'val4'}]
+ Example output:
+ u'{"var1": "val1", "var2": "val2"},{"var1": "val3", "var2": "val4"}'
+ """
+ return ','.join(json.dumps(x) for x in input_list)
+
+
def map_from_pairs(source, delim="="):
''' Returns a dict given the source and delim delimited '''
if source == '':
@@ -623,5 +636,6 @@ class FilterModule(object):
"lib_utils_oo_contains_rule": lib_utils_oo_contains_rule,
"lib_utils_oo_selector_to_string_list": lib_utils_oo_selector_to_string_list,
"lib_utils_oo_filter_sa_secrets": lib_utils_oo_filter_sa_secrets,
+ "lib_utils_oo_l_of_d_to_csv": lib_utils_oo_l_of_d_to_csv,
"map_from_pairs": map_from_pairs
}