From 3a4d53a93bb62f5bd2e21db1727ef74f771075d8 Mon Sep 17 00:00:00 2001 From: Richard Theis <rtheis@us.ibm.com> Date: Tue, 12 Apr 2016 12:42:13 -0500 Subject: [PATCH] Fix prefixes output for subnet pool list Fixed "os subnet pool list" command to properly disply the list of subnet pool prefixes in the "Prefixes" column. This fix is consistent with the "os subnet pool create" and "os subnet pool show" command output. Change-Id: I431d85c3b7f5bf8a327500decf3a15063fc5b120 Closes-Bug: #1569480 --- openstackclient/network/v2/subnet_pool.py | 2 +- openstackclient/tests/network/v2/test_subnet_pool.py | 4 ++-- releasenotes/notes/bug-1569480-c52e330548bfbd78.yaml | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/bug-1569480-c52e330548bfbd78.yaml diff --git a/openstackclient/network/v2/subnet_pool.py b/openstackclient/network/v2/subnet_pool.py index 6b6fc090f9..f1fd9a61e9 100644 --- a/openstackclient/network/v2/subnet_pool.py +++ b/openstackclient/network/v2/subnet_pool.py @@ -184,7 +184,7 @@ class ListSubnetPool(command.Lister): return (headers, (utils.get_item_properties( s, columns, - formatters={}, + formatters=_formatters, ) for s in data)) diff --git a/openstackclient/tests/network/v2/test_subnet_pool.py b/openstackclient/tests/network/v2/test_subnet_pool.py index 093e26c67e..df4d27eba1 100644 --- a/openstackclient/tests/network/v2/test_subnet_pool.py +++ b/openstackclient/tests/network/v2/test_subnet_pool.py @@ -246,7 +246,7 @@ class TestListSubnetPool(TestSubnetPool): data.append(( pool.id, pool.name, - pool.prefixes, + utils.format_list(pool.prefixes), )) data_long = [] @@ -254,7 +254,7 @@ class TestListSubnetPool(TestSubnetPool): data_long.append(( pool.id, pool.name, - pool.prefixes, + utils.format_list(pool.prefixes), pool.default_prefixlen, pool.address_scope_id, )) diff --git a/releasenotes/notes/bug-1569480-c52e330548bfbd78.yaml b/releasenotes/notes/bug-1569480-c52e330548bfbd78.yaml new file mode 100644 index 0000000000..ccec658bc3 --- /dev/null +++ b/releasenotes/notes/bug-1569480-c52e330548bfbd78.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - Fixed ``subnet pool list`` command to properly disply the + list of subnet pool prefixes in the ``Prefixes`` column. + This fix is consistent with the ``subnet pool create`` and + ``subnet pool show`` command output. + [Bug `1569480 <https://bugs.launchpad.net/bugs/1569480>`_]