user_data displayed via CLI messes up output table

Bug #1669140 reported by Sam Morrison
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Low
Stephen Finucane

Bug Description

We just switch over to nova API V2.1 and with that the server returns more data.

One of the extra fields it returns is user data returned as OS-EXT-SRV-ATTR:user_data.

This is a large hash of text that then causes the output table to be all messed up due to it not being wrapped.

I don't think there is a need to display this attribute via the CLI so I think it should be hidden.

I'm using python-novaclient==7.1.0

Sam Morrison (sorrison)
description: updated
Revision history for this message
melanie witt (melwitt) wrote :

You didn't mention what command you're using, but if it's 'nova show' I think you can pass the --wrap option to make it wrap all of the fields. --wrap defaults to 0, or no wrap.

Revision history for this message
Sam Morrison (sorrison) wrote :

Ah whoops, yeah it is a `nova show`.

OK using --wrap the table prints a bit nicer but it still is hard to read as now it's quite long in terms of vertical length.

I don't see any reason why anyone would want to see the big long hash that is userdata displayed when they do a `nova show`? it's not human readable.

Revision history for this message
melanie witt (melwitt) wrote :

Yeah, sorry, I was thinking to workaround until other changes are made, --wrap might help you.

I don't know the history of why user data is included in the output of 'nova show'. There are some who use the CLI to query server data (as part of automation) so I suppose it's possible to use it for something that way.

Are you suggesting just hiding it in the 'nova show' but leave it in the server response? I think the awkward thing there would be that it would create a mismatch between the fields that are in the server response vs the 'nova show' output. AFAIK, they have always been the same in that 'nova show' just creates a table from the server response.

I would suggest emailing the openstack-dev ML with the [nova] tag to get input from more folks including those who know more about 'nova show' and the prospect of hiding selected fields.

Changed in python-novaclient:
assignee: nobody → NidhiMittalHada (nidhimittal19)
Changed in python-novaclient:
assignee: NidhiMittalHada (nidhimittal19) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.opendev.org/708850

Changed in python-novaclient:
assignee: nobody → Stephen Finucane (stephenfinucane)
status: New → In Progress
Changed in python-novaclient:
status: In Progress → Confirmed
importance: Undecided → Low
Changed in python-novaclient:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.opendev.org/708850
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=03dca4bc823c82054869dfaf6925d5e1e068ac51
Submitter: Zuul
Branch: master

commit 03dca4bc823c82054869dfaf6925d5e1e068ac51
Author: Stephen Finucane <email address hidden>
Date: Thu Feb 20 11:01:40 2020 +0000

    Don't print user_data for 'nova show'

    User data is a blob of data that the user can specify when they launch
    an instance. It's generally binary data, which means it's not something
    we should show by default on the CLI. Stop doing that.

    Change-Id: If8f6cc040d0077a7902a5fd425e67d74d7925a46
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1669140

Changed in python-novaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-novaclient 17.0.0

This issue was fixed in the openstack/python-novaclient 17.0.0 release.

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.