More explicit way of checking presence of image metadata in api/v1/images.py

Bug #1499038 reported by Itisha Dewan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Wishlist
Itisha Dewan

Bug Description

images.py:

if (orig_status == 'active' and image_meta.get(key) is not None
                   and image_meta.get(key) != orig_image_meta.get(key)):

The checking for the presence of image metadata can be made more explicit, rather than checking if it is None or not.

Revision history for this message
Itisha Dewan (ishadewan07) wrote :

Proposed fix:

We can reduce the if condition to this:

if image_meta.get(key) != orig_image_meta.get(key):

Changed in glance:
assignee: nobody → Itisha Dewan (ishadewan07)
Changed in glance:
status: New → Triaged
importance: Undecided → Wishlist
Changed in glance:
status: Triaged → In Progress
summary: - Redundant check for None value in api/v1/images.py
+ More explicit way of checking presence of image metadata in
+ api/v1/images.py
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/227229
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=3f79417ce73fbbd1112ce07ad7a2152e3ad23e95
Submitter: Jenkins
Branch: master

commit 3f79417ce73fbbd1112ce07ad7a2152e3ad23e95
Author: itisha <email address hidden>
Date: Thu Sep 24 02:05:39 2015 +0530

    An explicit check for the presence of a property

    A more explicit way of checking if the immutable image metadata is
    present or not.

    Closes-Bug: #1499038
    Change-Id: I72d372b8c2894cd3f8f0a3eebeae68886d4e0d65

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/glance 12.0.0.0b1

This issue was fixed in the openstack/glance 12.0.0.0b1 development milestone.

Changed in glance:
status: Fix Committed → Fix Released
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.