Failing validation for new resources with reference

Bug #1347571 reported by Sergey Kraynev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Zane Bitter

Bug Description

Fix for bug #1192142 covers only resources which return None value during resolve get_resource function. Unfortunately there are some resources, which may return u'None' or their name.
You may check it follow steps below:
- add network constraint for port resource

         NETWORK: properties.Schema(
             properties.Schema.STRING,
- _('Network this port belongs to.')
+ _('Network this port belongs to.'),
+ constraints=[
+ constraints.CustomConstraint('neutron.network')
+ ]
+
         ),

- Create template with two resources with reference:

heat_template_version: 2013-05-23

resources:
  private_net:
    type: OS::Neutron::Net
    properties:
      name: private_net_name

  port1:
    type: OS::Neutron::Port
    properties:
      name: name
      network: {get_resource: private_net}

- try to create stack using template above.

you will see next error:
ERROR: Property error : port1: network Error validating value u'None': Unable to find network with name 'None'

This problem affects other custom constraints in case, when we use reference on not created resource.

Changed in heat:
assignee: nobody → Sergey Kraynev (skraynev)
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/108951

Changed in heat:
status: New → In Progress
Revision history for this message
Angus Salkeld (asalkeld) wrote :
Changed in heat:
importance: Undecided → Medium
Angus Salkeld (asalkeld)
Changed in heat:
milestone: none → juno-rc1
Changed in heat:
assignee: Sergey Kraynev (skraynev) → Zane Bitter (zaneb)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/108951
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=e1e852856047313159699f6a814135b6a6fde5e5
Submitter: Jenkins
Branch: master

commit e1e852856047313159699f6a814135b6a6fde5e5
Author: Sergey Kraynev <email address hidden>
Date: Wed Jul 23 06:10:02 2014 -0400

    Skip validation if depends on not created resource

    Using references on resources defined in template may be cause
    of error during validation. This fix checks reference on another
    resource and skips validation if resource is in INIT state.

    Change-Id: I95531a1603de1e8c4b9f0f4b05b62eebc48beb3c
    Co-Authored-By: Zane Bitter <email address hidden>
    Closes-Bug: #1347571
    Closes-Bug: #1339942

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-rc1 → 2014.2
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.