diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-02-03 21:01:17 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-02-03 21:01:17 +0000 |
| commit | 65f8845ea8eb67c4bd6731cf5733bc3071811dc2 (patch) | |
| tree | 877245449d22e35018e5396b154ec1c336a5b1ec /openstackclient/common | |
| parent | 66df8d1413004bbb2d225ff199767dab8696fd45 (diff) | |
| parent | 981621e9845934c109c5e4abd9b2ab6828744346 (diff) | |
| download | python-openstackclient-65f8845ea8eb67c4bd6731cf5733bc3071811dc2.tar.gz | |
Merge "Add "os port show" command"
Diffstat (limited to 'openstackclient/common')
| -rw-r--r-- | openstackclient/common/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/openstackclient/common/utils.py b/openstackclient/common/utils.py index 1ca2bc57..a468629b 100644 --- a/openstackclient/common/utils.py +++ b/openstackclient/common/utils.py @@ -142,6 +142,16 @@ def format_list(data, separator=', '): return separator.join(sorted(data)) +def format_list_of_dicts(data): + """Return a formatted string of key value pairs for each dict + + :param data: a list of dicts + :rtype: a string formatted to key='value' with dicts separated by new line + """ + + return '\n'.join(format_dict(i) for i in data) + + def get_field(item, field): try: if isinstance(item, dict): |
