Error validating a port without properties

Bug #1685808 reported by Thomas Herve
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Thomas Herve

Bug Description

Filling this while I debug. I tried to create a OS::Neutron::Port without any property, and it failed with the following traceback:

2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource Traceback (most recent call last):
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resource.py", line 764, in _action_recorder
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource yield
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resource.py", line 866, in _do_action
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource yield self.action_handler_task(action, args=handler_args)
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/scheduler.py", line 334, in wrapper
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource step = next(subtask)
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resource.py", line 811, in action_handler_task
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource handler_data = handler(*args)
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource File "/usr/lib/python2.7/site-packages/heat/engine/resources/openstack/neutron/port.py", line 422, in handle_create
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource props['network_id'] = props.pop(self.NETWORK)
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource KeyError: 'network'
2017-04-24 14:10:38.578 22364 ERROR heat.engine.resource

But network is required, so it should have failed validation.

Rico Lin (rico-lin)
Changed in heat:
status: New → Triaged
Revision history for this message
Thomas Herve (therve) wrote :

So there error has been introduced by https://review.openstack.org/#/c/420022/. We skipped required attribute when there is a translation :/.

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/460103

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/460103
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=536e26f31c7820fe507dbe620d2cdc3cdb453c0c
Submitter: Jenkins
Branch: master

commit 536e26f31c7820fe507dbe620d2cdc3cdb453c0c
Author: Thomas Herve <email address hidden>
Date: Wed Apr 26 15:08:34 2017 +0200

    Fix translated required properties

    In the recent refactoring done in
    I953a52e9b165d3ea4fb2fc57ceea8083c7f8f30c, we didn't handle translated
    require properties correctly, forgetting to raise an error when the
    property was required. This fixes that path.

    Change-Id: If335ca193301d304963738773d10e7370d5b5d85
    Closes-Bug: #1685808

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

Related fix proposed to branch: master
Review: https://review.openstack.org/460405

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

This issue was fixed in the openstack/heat 9.0.0.0b2 development milestone.

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

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

commit 2b980b3243a3c107d6de7e8ad0237c6e17eac9b9
Author: ricolin <email address hidden>
Date: Thu Apr 27 13:58:05 2017 +0800

    Add unit test for translate with no translate value

    This happens in validate values, just add unit test to make sure we
    always raise error when it happens.
    Related-Bug: #1685808

    Change-Id: Ifa9f2920f6ae55d0a5f09e4d1a5bed6c93d47b6f

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.