Created
January 30, 2018 16:17
-
-
Save dav1x/50d3db00d7e716d9371ab87cbd2265b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# pylint: disable=too-many-lines | |
""" | |
Custom filters for use in openshift-ansible | |
""" | |
import os | |
import pdb | |
import random | |
import re | |
import argparse | |
def lib_utils_oo_dict_to_keqv_list(data): | |
"""Take a dict and return a list of k=v pairs | |
Input data: | |
{'a': 1, 'b': 2} | |
Return data: | |
['a=1', 'b=2'] | |
""" | |
return ['='.join(str(e) for e in x) for x in data.items()] | |
if __name__ == '__main__': | |
data = {} | |
data['region'] = {} | |
data['region'] = 'infra' | |
print lib_utils_oo_dict_to_keqv_list(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dav1x-m:openshift-ansible dphillip$ ./test.py
['region=infra']