saving metadata of array type error

Bug #1606988 reported by Ryan Peters
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Travis Tripp

Bug Description

After saving metadata of type array on an image, when you go to edit and remove that metadata and re-save. Metadata is not removed and remains on the image.

To reproduce:
If you don't have metadata with an array type, add the json in the file attached at:
 - /admin/metadata_defs > Import Namespace

Then go to:
 - /admin/images and Update Metadata on one of the images.

Add one of the Storage Types (eg. SAN_storage) and click Save. Notice metadata saved to image on image detail page.

After it saves, click Update Metadata for the same image. Remove the metadata you just added in the previous step and click Save. After saving notice that metadata is still on the image and was not deleted.

Revision history for this message
Ryan Peters (rjpeter2) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/348119

Changed in horizon:
assignee: nobody → Travis Tripp (travis-tripp)
status: New → In Progress
Changed in horizon:
importance: Undecided → High
milestone: none → newton-3
Revision history for this message
Travis Tripp (travis-tripp) wrote :
Download full text (3.2 KiB)

Just some investigation comments.

[12:48 PM] Travis Tripp: i'll see if i can code around it in horizon
[12:48 PM] Travis Tripp: but it is a glance api issue
[12:48 PM] Travis Tripp: ttripp@ubuntu:~$ glance --os-image-api-version 1 image-show 34bc69fe-aa2a-4292-9272-8da80e72cc5b
+-------------------------+--------------------------------------+
| Property                | Value                                |
+-------------------------+--------------------------------------+
| Property 'storage_raid' | <in> RAID0                           |
| container_format        | bare                                 |
| created_at              | 2016-07-28T03:36:56.000000           |
| deleted                 | False                                |
| disk_format             | raw                                  |
| id                      | 34bc69fe-aa2a-4292-9272-8da80e72cc5b |
| is_public               | False                                |
| min_disk                | 0                                    |
| min_ram                 | 0                                    |
| name                    | arraytest                            |
| owner                   | 1e653364122d400cb2256f81ac90cd63     |
| protected               | False                                |
| size                    | 5969                                 |
| status                  | active                               |
| updated_at              | 2016-07-28T04:25:02.000000           |
+-------------------------+--------------------------------------+
ttripp@ubuntu:~$ glance --os-image-api-version 2 image-show 34bc69fe-aa2a-4292-9272-8da80e72cc5b
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | None                                 |
| container_format | bare                                 |
| created_at       | 2016-07-28T03:36:56Z                 |
| description      |                                      |
| disk_format      | raw                                  |
| id               | 34bc69fe-aa2a-4292-9272-8da80e72cc5b |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | arraytest                            |
| owner            | 1e653364122d400cb2256f81ac90cd63     |
| protected        | False                                |
| size             | 5969                                 |
| status           | active                               |
| storage_RAID     | <in> RAID0                           |
| tags             | []                                   |
| updated_at       | 2016-07-28T04:25:02Z                 |
| virtual_size     | None                                 |
| visibility       | private                              |
+------------------+--------------------------------------+
ttripp@ubuntu:~$
[12:49 PM] Travis Tripp: notice the capitalization differences in the storage_RAID
[12:49 PM] Travis Tripp: property
[12:49 PM] Travis Tripp: glance v1 lowercases
[12:49 PM] Travis Tripp: v2 doesn't
[12:49 PM] Tra...

Read more...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/348119
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=12f9ef8d54fdd4eaf73a2f521632964bf5a84571
Submitter: Jenkins
Branch: master

commit 12f9ef8d54fdd4eaf73a2f521632964bf5a84571
Author: Travis Tripp <email address hidden>
Date: Wed Jul 27 22:42:36 2016 -0600

    Remove array metadata when no items + fix case

    Array metadata appends an operator automatically, which
    means the value will still contain something and it
    doesn't get detected for removal.

    In addition, bad APIs like glance v1 will store a property
    with mixed case, but then return only lower case when
    listing them. However, it will not remove the property
    when you request to remove it unless it matches the original
    case (sad panda). So, this patch will reset the proper
    casing for properties defined as metadata definitions before
    making the request to save the metadata.

    Change-Id: I1e5a6fde35b7be6118f21ac46ad0aea088280215
    Closes-Bug: 1606988

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 10.0.0.0b3

This issue was fixed in the openstack/horizon 10.0.0.0b3 development milestone.

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.