'image-show' does not show attributes whose value is 'None'

Bug #1551225 reported by Wenjun Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Wenjun Wang

Bug Description

When I used cmd "glance image-show <image-uuid>",I can not get attributes whose value is 'None',
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 6bbe6376930f06d69f40d74e2d081ed6 |
| container_format | bare |
| created_at | 2016-01-21T07:41:47.000000 |
| deleted | False |
| disk_format | iso |
| id | 1c0c80eb-15a2-4104-a5d4-c30a866fc7c9 |
| is_public | True |
| min_disk | 0 |
| min_ram | 0 |
| name | win2007_iso |
| owner | 32bfe3124bb2478aad3e6aa1cee09f14 |
| protected | False |
| size | 4489216000 |
| status | active |
| updated_at | 2016-01-21T07:43:47.000000 |
+------------------+--------------------------------------+
The attribute will be removed whose value is 'None' in function meta of class ImageSerializer,

https://github.com/openstack/glance/blob/master/glance/common/utils.py#L257

user will not know these attributes in this case.

So I suggest to remove the filter for value with 'None'.

I want to get the return values like this:

+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 6bbe6376930f06d69f40d74e2d081ed6 |
| container_format | bare |
| created_at | 2016-01-21T07:41:47.000000 |
| deleted | False |
| deleted_at | None |
| disk_format | iso |
| id | 1c0c80eb-15a2-4104-a5d4-c30a866fc7c9 |
| is_public | True |
| min_disk | 0 |
| min_ram | 0 |
| name | win2007_iso |
| owner | 32bfe3124bb2478aad3e6aa1cee09f14 |
| protected | False |
| size | 4489216000 |
| status | active |
| updated_at | 2016-01-21T07:43:47.000000 |
| virtual_size | None |
+------------------+--------------------------------------+

Wenjun Wang (wangwenjun)
description: updated
Changed in python-glanceclient:
assignee: nobody → Wenjun Wang (wangwenjun)
Wenjun Wang (wangwenjun)
affects: python-glanceclient → glance
Revision history for this message
Niall Bunting (niall-bunting) wrote :

According to your example you get see the two extra fields:

| deleted_at | None |
| virtual_size | None |

What is the benefit of seeing these extra two fields?

Revision history for this message
Wenjun Wang (wangwenjun) wrote :

Hi Niall:

I cound not see the attribute when I set it to None,I will not sure it is missed or not setted.
It will also be confused about this for an application.
I don't think there are benefits to hide these fields.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (master)

Change abandoned by Nikhil Komawar (<email address hidden>) on branch: master
Review: https://review.openstack.org/286034
Reason: I see no movement on this patch and/or associated bug. Please reopen as/when you find appropriate.

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.