Merge "Add "Is Public" column in volume type list"

This commit is contained in:
Jenkins 2016-12-02 18:32:49 +00:00 committed by Gerrit Code Review
commit 2daeb30296
5 changed files with 20 additions and 8 deletions

View File

@ -158,11 +158,13 @@ class TestTypeList(TestType):
columns = (
"ID",
"Name"
"Name",
"Is Public",
)
columns_long = (
"ID",
"Name",
"Is Public",
"Properties"
)
@ -171,12 +173,14 @@ class TestTypeList(TestType):
data.append((
t.id,
t.name,
t.is_public,
))
data_long = []
for t in volume_types:
data_long.append((
t.id,
t.name,
t.is_public,
utils.format_dict(t.extra_specs),
))

View File

@ -165,7 +165,8 @@ class TestTypeList(TestType):
columns = [
"ID",
"Name"
"Name",
"Is Public",
]
columns_long = columns + [
"Description",
@ -177,12 +178,14 @@ class TestTypeList(TestType):
data.append((
t.id,
t.name,
t.is_public,
))
data_long = []
for t in volume_types:
data_long.append((
t.id,
t.name,
t.is_public,
t.description,
utils.format_dict(t.extra_specs),
))

View File

@ -111,10 +111,10 @@ class ListVolumeType(command.Lister):
def take_action(self, parsed_args):
if parsed_args.long:
columns = ('ID', 'Name', 'Extra Specs')
column_headers = ('ID', 'Name', 'Properties')
columns = ('ID', 'Name', 'Is Public', 'Extra Specs')
column_headers = ('ID', 'Name', 'Is Public', 'Properties')
else:
columns = ('ID', 'Name')
columns = ('ID', 'Name', 'Is Public')
column_headers = columns
data = self.app.client_manager.volume.volume_types.list()
return (column_headers,

View File

@ -176,10 +176,11 @@ class ListVolumeType(command.Lister):
def take_action(self, parsed_args):
if parsed_args.long:
columns = ['ID', 'Name', 'Description', 'Extra Specs']
column_headers = ['ID', 'Name', 'Description', 'Properties']
columns = ['ID', 'Name', 'Is Public', 'Description', 'Extra Specs']
column_headers = [
'ID', 'Name', 'Is Public', 'Description', 'Properties']
else:
columns = ['ID', 'Name']
columns = ['ID', 'Name', 'Is Public']
column_headers = columns
is_public = None

View File

@ -0,0 +1,4 @@
---
features:
- Add ``Is Public`` column to ``volume type list``.
[Bug `1643861 <https://bugs.launchpad.net/python-openstackclient/+bug/1643861>`_]