Validation of non-permuted repeat function fails with mixed data sources

Bug #1732934 reported by Zane Bitter
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Khaled Qarout

Bug Description

To fix bug 1629899, we substitute an empty list for any None values in the for_each section of the repeat function. This allows us to use the function during property validation.

However, when the function is used with the permutations: false argument, we also check that the lengths of all the arguments match. The result is that if arguments come from different sources - e.g. one from get_attr and others from e.g. get_param - the lengths may not match and validation will fail.

A workaround is to create OS::Heat::Value resources for each of the for_each lists, so that all of the values can be obtained using get_attr.

We should probably bypass the length check if any of the for_each lists are None.

Revision history for this message
Rabi Mishra (rabi) wrote :

It seems that length check was added latter in https://review.openstack.org/#/c/473360/heat/engine/hot/functions.py

Revision history for this message
Zane Bitter (zaneb) wrote :

Yes, the permutations: false argument didn't exist at the time bug 1629899 was fixed. So not your fault ;)

Rico Lin (rico-lin)
Changed in heat:
milestone: queens-2 → queens-3
Khaled Qarout (khaledq)
Changed in heat:
assignee: nobody → Khaled Qarout (khaledq)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/527001
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=89643db0056c4b77e6ab67f6cc1b3435ee2b1435
Submitter: Zuul
Branch: master

commit 89643db0056c4b77e6ab67f6cc1b3435ee2b1435
Author: Khaled Qarout <email address hidden>
Date: Tue Dec 12 01:37:33 2017 -0500

    Bypass list length check for None values in repeat function

    Attributes may return "None" before the resource is created,
    so the length check for for_each lists in repeat function will fail.
    Bybass the length check for the None list

    Change-Id: Ida81060e62340b3ea37ba0fdd7443dc88ba6c5aa
    Closes-bug: #1732934

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

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

Reviewed: https://review.openstack.org/530942
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=bd8df9a8b9fb379709e00bb01bb36bf58a23581a
Submitter: Zuul
Branch: master

commit bd8df9a8b9fb379709e00bb01bb36bf58a23581a
Author: Luis Tomas Bolivar <email address hidden>
Date: Wed Jan 3 16:08:46 2018 +0100

    Fix bypass list length check when all values are None

    The patch https://review.openstack.org/#/c/527001/ bypassed the None
    list but did not consider the case where all the for_each lists are
    getting their values from attributes and therefore are None.

    This patch set fix it by also skipping the check if all the values
    are None -- as len(value_lens) would be 0 in that case.

    Closes-bug: #1732934
    Change-Id: Iba574bbd3877f9ca1ca755c384b3ddb47aec711c

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 10.0.0.0b3

This issue was fixed in the openstack/heat 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.