From 981621e9845934c109c5e4abd9b2ab6828744346 Mon Sep 17 00:00:00 2001 From: Richard Theis Date: Mon, 25 Jan 2016 12:52:49 -0600 Subject: Add "os port show" command Add "os port show" command. Change-Id: Id87c81640e74c60ae8f247c722c64fdadff022a2 Partial-Bug: #1519909 Partially-Implements: blueprint neutron-client --- openstackclient/common/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'openstackclient/common/utils.py') 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): -- cgit v1.2.1