Add "Is Public" column in volume type list

I think admin users will like to see the "Is Public" column
in volume type list since they can know the volume type
is public or private, so add "Is Public" column in volume
type list

Change-Id: I3f6e297a7adf82a275debbd87d2c4da415aa1360
Closes-Bug: #1643861
This commit is contained in:
Huanxuan Ao 2016-11-22 20:35:27 +08:00 committed by Steve Martinelli
parent f4536e708d
commit 5e070c36a1
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>`_]