diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2016-01-25 12:52:49 -0600 |
|---|---|---|
| committer | Richard Theis <rtheis@us.ibm.com> | 2016-02-02 08:40:05 -0600 |
| commit | 981621e9845934c109c5e4abd9b2ab6828744346 (patch) | |
| tree | b7f28f77de03bff0ed077e05ca07ddc359ecfe46 /openstackclient/common/utils.py | |
| parent | f36177ebdd4ea25028337efaf667c23d62e3bf9e (diff) | |
| download | python-openstackclient-981621e9845934c109c5e4abd9b2ab6828744346.tar.gz | |
Add "os port show" command
Add "os port show" command.
Change-Id: Id87c81640e74c60ae8f247c722c64fdadff022a2
Partial-Bug: #1519909
Partially-Implements: blueprint neutron-client
Diffstat (limited to 'openstackclient/common/utils.py')
| -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 3ae30c8f..451484c8 100644 --- a/openstackclient/common/utils.py +++ b/openstackclient/common/utils.py @@ -169,6 +169,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): |
