Barbican Order resource doesn't have enough validation

Bug #1540937 reported by Sergey Kraynev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Oleksii Chuprykov

Bug Description

Currently we have only one validation for Order resource added in patch:
https://review.openstack.org/#/c/269737/

However we need add extra check for properties, which can not be used with some other order "type"s.

F.e. If I try to use "request_type" property with "type": key.
We will get follow traceback in heat-engine.log:

Traceback (most recent call last):
2016-02-02 07:59:28.358 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 626, in _action_recorder
2016-02-02 07:59:28.358 TRACE heat.engine.resource yield
2016-02-02 07:59:28.358 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 697, in _do_action
2016-02-02 07:59:28.358 TRACE heat.engine.resource yield self.action_handler_task(action, args=handler_args)
2016-02-02 07:59:28.358 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 295, in wrapper
2016-02-02 07:59:28.358 TRACE heat.engine.resource step = next(subtask)
2016-02-02 07:59:28.358 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 668, in action_handler_task
2016-02-02 07:59:28.358 TRACE heat.engine.resource handler_data = handler(*args)
2016-02-02 07:59:28.358 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/barbican/order.py", line 179, in handle_create
2016-02-02 07:59:28.358 TRACE heat.engine.resource order = self.client().orders.create(**info)
2016-02-02 07:59:28.358 TRACE heat.engine.resource File "/opt/stack/python-barbicanclient/barbicanclient/orders.py", line 422, in create
2016-02-02 07:59:28.358 TRACE heat.engine.resource if not order_type:
2016-02-02 07:59:28.358 TRACE heat.engine.resource TypeError: __init__() got an unexpected keyword argument 'request_type'

Follow options can be used only for "certificate" type:

request_type
subject_dn
source_container_ref
ca_id
profile
request_data

only for "asymmetric" type:

pass_phrase

Also all other properties except:
"name" can not be applied for "certificate" type

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

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

commit fe7d14fba973e6fe75de17afc35c6401cb974812
Author: Oleksii Chuprykov <email address hidden>
Date: Thu Feb 11 19:39:38 2016 +0200

    Add more validation to barbican order

    Change-Id: I37d014f46b5ba0f2732507f54bebe0a82b872092
    Closes-Bug: #1540937

Changed in heat:
status: In Progress → Fix Released
Thomas Herve (therve)
summary: - Babrbican Order resource has not enough validation
+ Barbican Order resource doesn't have enough validation
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0b3

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