--column actually filters rows for openstack token issue

Bug #1564444 reported by Matthew Edmonds
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
cliff
New
Undecided
Unassigned
python-openstackclient
Invalid
Undecided
Unassigned

Bug Description

The --column actually acts on rows rather than columns for openstack token issue:

# openstack token issue -c project_id
+------------+----------------------------------+
| Field | Value |
+------------+----------------------------------+
| project_id | f866b93adc8247328d372367f448ed33 |
+------------+----------------------------------+

This is confusing and inconsistent from other commands, e.g. openstack project list:

# openstack project list -c ID
+----------------------------------+
| ID |
+----------------------------------+
| 35d7501ec6794eb6b13d2d897c603daf |
| c743108159c7483b8063a10c02d4a586 |
| f866b93adc8247328d372367f448ed33 |
+----------------------------------+

The table returned for openstack token issue should be structured as columns rather than as rows, like other subcommands.

Revision history for this message
Karthik (kali-karthik) wrote :

So u mean to say project ID should be on a column and Field Value rows should not be present?

Revision history for this message
Steve Martinelli (stevemar) wrote :

This is cliff's documented behaviour. When a single item it uses cliff's ShowOne class [1], which we use for create/show (and in this case, issue). When listing multiple items, the Lister class [2] is used.

Think of -c as a way to get either a column when listing lots of value or a field value when the command returns a single value.

Do you think the documentation / wording needs to be improved?

[1] https://github.com/openstack/cliff/blob/master/cliff/show.py
[2] https://github.com/openstack/cliff/blob/master/cliff/lister.py

Changed in python-openstackclient:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.