resource-signal Mistral workflow with params results in ResourceFailure: AttributeError

Bug #1453558 reported by Moshe Elisha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Tomer Shtilman

Bug Description

Sending a signal to a resource of type OS::Mistral::Workflow with params results in: ResourceFailure: AttributeError: 'NoneType' object has no attribute 'iteritems'.

This issue occurs when there are no params property defined in the workflow.
If arbitrary params are allowed - this should be fixed.
If params must be defined in the workflow - there should be a validation that the signal param is expected (like there is with inputs).

The template and log are attached.

Reproduce by executing:

heat stack-create -f mistral-template.yaml Mistral

heat resource-signal Mistral workflow -D '{"params": {"task_name": "create_vm"}}'

Revision history for this message
Moshe Elisha (melisha) wrote :
Changed in heat:
assignee: nobody → Moshe Elisha (melisha)
Moshe Elisha (melisha)
description: updated
Changed in heat:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Renat Akhmerov (rakhmerov) wrote :

“params” is a set of arbitrary runtime workflow parameters that we provide when we launch a certain workflow. They shouldn’t be confused though with “input” which describes input data that the workflow is supposed to process. “params” may contain, for example, variable “env” which describes an environment this workflow will run with (env may contain some certain variables similar to environment variables in operating systems). “params” may also contain workflow type specific meta values. For example, reverse workflows require parameter “task_name” that specifies the target task in the graph that we need to reach to consider workflow completed.

In other words, I think it’s not so easy to implement any validation, only because a set of workflow types will be growing (e.g., we plan to add priority based wf and linear wf) which may need some other meta params influencing their work. Hence we should assume arbitrary number of key-value pairs here.

Revision history for this message
Moshe Elisha (melisha) wrote :

Thank you Renat for this excellent explanation - we will fix by allowing params even if no params defined in the workflow.

Changed in heat:
assignee: Moshe Elisha (melisha) → Tomer Shtilman (tomer-shtilman)
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/188017

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

commit 6b0895fa7ed6bbacc549f5377aaf6c2a7d68e199
Author: Tomer Shtilman <email address hidden>
Date: Wed Jun 3 13:45:37 2015 +0000

    Allowing params to be sent to the workflow

    even when not defined in the template

    Closes-Bug: #1453558

    Change-Id: I320431819346e54631b3bf88b85b8fac365a41cd

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-1 → 5.0.0
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.