Feature "default values for input" doesn't work

Bug #1449391 reported by Anastasia Kuznetsova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
High
Lingxian Kong
Kilo
Fix Released
High
Lingxian Kong
Liberty
Fix Released
High
Lingxian Kong

Bug Description

Steps to reproduce:
1. Create file with wf definition, that contain 'input' keyword and provide some default value for it.
For example:
---
version: '2.0'
wf1:
  type: reverse
  input:
    - greeting: "Hi"
  tasks:
    addressee:
      action: std.echo output="John"
      publish:
        name: <% $.addressee %>
    goodbye:
      action: std.echo output="<% $.greeting %>, <% $.name %>"
      requires: [addressee]
2. Execute "mistral workflow-create <file.yaml>"

Observed result:
A server error occurred. Please contact the administrator.
Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 639, in __call__
    return self._call_app(env, start_response)
  File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token/__init__.py", line 559, in _call_app
    return self._app(env, _fake_start_response)
  File "/usr/local/lib/python2.7/dist-packages/pecan/middleware/recursive.py", line 56, in __call__
    return self.application(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/pecan/core.py", line 812, in __call__
    return super(Pecan, self).__call__(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/pecan/core.py", line 661, in __call__
    self.invoke_controller(controller, args, kwargs, state)
  File "/usr/local/lib/python2.7/dist-packages/pecan/core.py", line 561, in invoke_controller
    result = controller(*args, **kwargs)
  File "/home/ubuntu/mistral/mistral/utils/rest_utils.py", line 48, in wrapped
    return func(*args, **kwargs)
  File "/home/ubuntu/mistral/mistral/api/controllers/v2/workflow.py", line 122, in put
    workflow_list = [Workflow.from_dict(wf) for wf in models_dicts]
  File "/home/ubuntu/mistral/mistral/api/controllers/v2/workflow.py", line 73, in from_dict
    setattr(e, 'input', ", ".join(input) if input else None)
TypeError: sequence item 0: expected string, dict found

Changed in mistral:
importance: Undecided → High
Lingxian Kong (kong)
Changed in mistral:
assignee: nobody → Lingxian Kong (kong)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

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

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

Reviewed: https://review.openstack.org/178122
Committed: https://git.openstack.org/cgit/stackforge/mistral/commit/?id=f5b8cd8e9a41bca7e5f2f344d9b6c1f6d157db33
Submitter: Jenkins
Branch: master

commit f5b8cd8e9a41bca7e5f2f344d9b6c1f6d157db33
Author: LingxianKong <email address hidden>
Date: Tue Apr 28 16:11:54 2015 +0800

    Fix error when getting workflow with default input value

    Change-Id: I2bf6fbbcd035b129ead11d2bafb7bc1f01df3d3b
    Closes-bug: #1449391

Changed in mistral:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/178633

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (stable/kilo)

Reviewed: https://review.openstack.org/178633
Committed: https://git.openstack.org/cgit/stackforge/mistral/commit/?id=a88c2f80247e13a0d692f2e74857888005aca220
Submitter: Jenkins
Branch: stable/kilo

commit a88c2f80247e13a0d692f2e74857888005aca220
Author: LingxianKong <email address hidden>
Date: Tue Apr 28 16:11:54 2015 +0800

    Fix error when getting workflow with default input value

    Change-Id: I2bf6fbbcd035b129ead11d2bafb7bc1f01df3d3b
    Closes-bug: #1449391
    (cherry picked from commit f5b8cd8e9a41bca7e5f2f344d9b6c1f6d157db33)

Changed in mistral:
milestone: 1.0.0 → none
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.