Wrap option for "ironic driver-properties" gives larger table width then expected

Bug #1562927 reported by Kyrylo Romanenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-ironicclient
Triaged
Low
Vadim Hmyrov

Bug Description

Wrap option for "ironic driver-properties" gives larger width than expected in output.
Examples:
$ ironic driver-properties agent_ssh --wrap 30
+--------------------------+--------------------------------+
| Property | Description |
+--------------------------+--------------------------------+
...
actual width of table is 61 char

$ ironic driver-properties agent_ssh --wrap 40
+--------------------------+------------------------------------------+
| Property | Description |
+--------------------------+------------------------------------------+
...
actual width of table is 71 char

$ ironic driver-properties agent_ssh --wrap 60
+--------------------------+-------------------------------------------------------------+
| Property | Description |
+--------------------------+-------------------------------------------------------------+
...
actual width of table is 90 chars

$ ironic driver-properties agent_ssh --wrap 80
+--------------------------+----------------------------------------------------------------------------------+
| Property | Description |
+--------------------------+----------------------------------------------------------------------------------+
...
actual width of table is 111 chars

summary: - Wrap option for "ironic driver-properties" gives larger width then
+ Wrap option for "ironic driver-properties" gives larger table width then
expected
Dmitry Tantsur (divius)
Changed in python-ironicclient:
status: New → Triaged
importance: Undecided → Low
Vadim Hmyrov (vhmyrov)
Changed in python-ironicclient:
assignee: nobody → Vadim Hmyrov (vhmyrov)
description: updated
Revision history for this message
Vadim Hmyrov (vhmyrov) wrote :

The "--wrap (width)" flag diminishes the "Description" column to the given width. IMO this is how it is meant to work. Could someone please confirm that this flag should wrap the whole table to the given width?

Revision history for this message
Kyrylo Romanenko (kromanenko) wrote :

It really appears to work with 2nd column (command calls the print_dict method):
https://github.com/openstack/python-ironicclient/blob/master/ironicclient/common/cliutils.py#L211

Also there is test regarding to this topic: https://review.openstack.org/#/c/297077/

Revision history for this message
Kyrylo Romanenko (kromanenko) wrote :

So we need to check only width of 2nd column.

Revision history for this message
Vadim Hmyrov (vhmyrov) wrote :

The width of column 2 is correct ('--wrap 30' displays column 2 with width = 30 symbols), so it looks like a non-bug.

Revision history for this message
Kyrylo Romanenko (kromanenko) wrote :

The second column also somehow larger than user-defined wrapping width, but this is very small issue :)
$ ironic driver-properties agent_ssh --wrap 30
+--------------------------+--------------------------------+
| Property | Description |
+--------------------------+--------------------------------+
| deploy_forces_oob_reboot | Whether Ironic should force a |
| | reboot of the Node via the |
| | out-of-band channel after |
| | deployment is complete. |
...

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.