Skip to content

Commit f52e888

Browse files
committed
Followup: Reduce LOC in volume v3 service
This is a followup of[1] in which we are reducing LOC by removing redundant definition of columns. [1] https://review.opendev.org/c/openstack/python-openstackclient/+/922865 Change-Id: I2992d3ab678e751726906926b680e4aa9ad1d502
1 parent ca81b1a commit f52e888

1 file changed

Lines changed: 10 additions & 19 deletions

File tree

openstackclient/volume/v3/service.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,21 @@ class ListService(service_v2.ListService):
2525
def take_action(self, parsed_args):
2626
service_client = self.app.client_manager.volume
2727

28-
if parsed_args.long:
29-
columns = [
30-
"Binary",
31-
"Host",
32-
"Zone",
33-
"Status",
34-
"State",
35-
"Updated At",
36-
"Disabled Reason",
37-
]
38-
else:
39-
columns = [
40-
"Binary",
41-
"Host",
42-
"Zone",
43-
"Status",
44-
"State",
45-
"Updated At",
46-
]
28+
columns = [
29+
"Binary",
30+
"Host",
31+
"Zone",
32+
"Status",
33+
"State",
34+
"Updated At",
35+
]
4736

4837
if service_client.api_version >= api_versions.APIVersion('3.7'):
4938
columns.append("Cluster")
5039
if service_client.api_version >= api_versions.APIVersion('3.49'):
5140
columns.append("Backend State")
41+
if parsed_args.long:
42+
columns.append("Disabled Reason")
5243

5344
data = service_client.services.list(
5445
parsed_args.host, parsed_args.service

0 commit comments

Comments
 (0)