Skip to content

Commit 5e070c3

Browse files
Huanxuan Aostevemar
authored andcommitted
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
1 parent f4536e7 commit 5e070c3

5 files changed

Lines changed: 20 additions & 8 deletions

File tree

openstackclient/tests/unit/volume/v1/test_type.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,13 @@ class TestTypeList(TestType):
158158

159159
columns = (
160160
"ID",
161-
"Name"
161+
"Name",
162+
"Is Public",
162163
)
163164
columns_long = (
164165
"ID",
165166
"Name",
167+
"Is Public",
166168
"Properties"
167169
)
168170

@@ -171,12 +173,14 @@ class TestTypeList(TestType):
171173
data.append((
172174
t.id,
173175
t.name,
176+
t.is_public,
174177
))
175178
data_long = []
176179
for t in volume_types:
177180
data_long.append((
178181
t.id,
179182
t.name,
183+
t.is_public,
180184
utils.format_dict(t.extra_specs),
181185
))
182186

openstackclient/tests/unit/volume/v2/test_type.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ class TestTypeList(TestType):
165165

166166
columns = [
167167
"ID",
168-
"Name"
168+
"Name",
169+
"Is Public",
169170
]
170171
columns_long = columns + [
171172
"Description",
@@ -177,12 +178,14 @@ class TestTypeList(TestType):
177178
data.append((
178179
t.id,
179180
t.name,
181+
t.is_public,
180182
))
181183
data_long = []
182184
for t in volume_types:
183185
data_long.append((
184186
t.id,
185187
t.name,
188+
t.is_public,
186189
t.description,
187190
utils.format_dict(t.extra_specs),
188191
))

openstackclient/volume/v1/volume_type.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ def get_parser(self, prog_name):
111111

112112
def take_action(self, parsed_args):
113113
if parsed_args.long:
114-
columns = ('ID', 'Name', 'Extra Specs')
115-
column_headers = ('ID', 'Name', 'Properties')
114+
columns = ('ID', 'Name', 'Is Public', 'Extra Specs')
115+
column_headers = ('ID', 'Name', 'Is Public', 'Properties')
116116
else:
117-
columns = ('ID', 'Name')
117+
columns = ('ID', 'Name', 'Is Public')
118118
column_headers = columns
119119
data = self.app.client_manager.volume.volume_types.list()
120120
return (column_headers,

openstackclient/volume/v2/volume_type.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,11 @@ def get_parser(self, prog_name):
176176

177177
def take_action(self, parsed_args):
178178
if parsed_args.long:
179-
columns = ['ID', 'Name', 'Description', 'Extra Specs']
180-
column_headers = ['ID', 'Name', 'Description', 'Properties']
179+
columns = ['ID', 'Name', 'Is Public', 'Description', 'Extra Specs']
180+
column_headers = [
181+
'ID', 'Name', 'Is Public', 'Description', 'Properties']
181182
else:
182-
columns = ['ID', 'Name']
183+
columns = ['ID', 'Name', 'Is Public']
183184
column_headers = columns
184185

185186
is_public = None
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
features:
3+
- Add ``Is Public`` column to ``volume type list``.
4+
[Bug `1643861 <https://bugs.launchpad.net/python-openstackclient/+bug/1643861>`_]

0 commit comments

Comments
 (0)