compare_dicts in test_util.py handles parms of (None, None) incorrectly

Bug #1447800 reported by Matt Rutkowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Heat Translator
Fix Released
Medium
srinivas_tadepalli

Bug Description

Recently a test was added to test the function "compare_dicts(dict1, dict2)" ; however, the way the code is written, it "short crircuits on the first "None" it sees and assumes that dict1 != dict2. This seems wrong (although an unlikely case) as None does equal Non (or better None is None). So the util SHOULD recognize this case and the test case in test_utils.py should be adjusted accordingly.

Revision history for this message
Matt Rutkowski (mrutkows) wrote :

Please note perhaps the method should throw an exception if both dicts are None? Either way this util SHOULD NOT assume that the inputs are from templates so the comment "#compare generated and expected hot templates" should never even be a consideration for this generic function.

Revision history for this message
Sahdev Zala (spzala) wrote :

@Srinivas, can you please take a look after we complete the Requirements work? Thanks!

Changed in heat-translator:
assignee: nobody → srinivas_tadepalli (srinivas-tadepalli)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat-translator (master)

Reviewed: https://review.openstack.org/171412
Committed: https://git.openstack.org/cgit/openstack/heat-translator/commit/?id=66394b802c43cf104da62ebefeaf0e8ef3b3f9d1
Submitter: Jenkins
Branch: master

commit 66394b802c43cf104da62ebefeaf0e8ef3b3f9d1
Author: Steve Martinelli <email address hidden>
Date: Mon Apr 27 12:18:40 2015 -0400

    Create a unit test for wordpress specification in TOSCA

    Create a TOSCA-HOT translation unit test template and use that to
    unit test TOSCA wordpress example.

    Note, to implement this patch some changes had to be made to the
    wordpress TOSCA file as translation of certain pieces were not fully
    supported, as described in bug #1440247. As a result of the change in
    wordpress TOSCA file some existing test cases had to be skipped as
    well. It is important to re-enable the skipped code and revert the
    changes made to wordpress TOSCA file as part of bug #1440247 patch.

    Also, shell scripts that support mysql, web server, and wordpress
    installation and configuration were also updated to make sure the
    HOT translation works with the ubuntu-software-config-os-init image.

    To address bug #1447800 handling of null dictionaries was also
    improved.

    Change-Id: I2710eabb0a74c4d75498ac2d0fe3e50ea50133ab
    Closes-Bug: #1435545
    Closes-Bug: #1447800
    Partial-Bug: #1436420
    Related-Bug: #1440247

Changed in heat-translator:
status: New → Fix Committed
Changed in heat-translator:
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.