diff options
author | Scott Dodson <sdodson@redhat.com> | 2018-01-23 13:18:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-23 13:18:32 -0500 |
commit | 1c9c43e886500f53e23b2ab58b67b4a271e140ac (patch) | |
tree | 7223e8dd9befbb29d2915d1f50c7c970f31cccf4 /roles/lib_utils | |
parent | 1dc60bb8a49afaf2e6efcf9a3740f1f112671872 (diff) | |
parent | e18a06d2a14c5933243773f0aca7a891177f3e40 (diff) | |
download | openshift-1c9c43e886500f53e23b2ab58b67b4a271e140ac.tar.gz openshift-1c9c43e886500f53e23b2ab58b67b4a271e140ac.tar.bz2 openshift-1c9c43e886500f53e23b2ab58b67b4a271e140ac.tar.xz openshift-1c9c43e886500f53e23b2ab58b67b4a271e140ac.zip |
Merge pull request #6783 from mgugino-upstream-stage/node-syscon-add-mounts
Add ability to mount volumes into system container nodes
Diffstat (limited to 'roles/lib_utils')
-rw-r--r-- | roles/lib_utils/filter_plugins/oo_filters.py | 14 |
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 } |