Published outputs cannot be updated

Bug #1415668 reported by Winson Chan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
High
Winson Chan

Bug Description

~/tmp$ cat test-output-rewrite.yaml
version: "2.0"
name: "test-output-rewrite"

workflows:

    main:
        type: direct
        input:
            - subject
            - adjective
        output:
            tagline: "{$.printed_subject} is {$.printed_adjective}!"
        task-defaults:
          on-error:
            - fail
        tasks:
            print_subject_1:
                action: std.echo
                input:
                    output: "{$.subject}"
                publish:
                    printed_subject: $.print_subject_1
                on-success:
                    - print_subject_2
            print_subject_2:
                action: std.echo
                input:
                    output: "This {$.subject} thing"
                publish:
                    printed_subject: $.print_subject_2
                on-success:
                    - print_adjective
            print_adjective:
                action: std.echo
                input:
                    output: "{$.adjective}"
                publish:
                    printed_adjective: $.print_adjective

~/tmp$ mistral workbook-create test-output-rewrite.yaml
Starting new HTTP connection (1): localhost
+------------+----------------------------+
| Field | Value |
+------------+----------------------------+
| Name | test-output-rewrite |
| Tags | <none> |
| Created at | 2015-01-28 22:27:15.383479 |
| Updated at | None |
+------------+----------------------------+

~/tmp$ mistral execution-create test-output-rewrite.main '{"subject": "mistral", "adjective": "awesome"}'
Starting new HTTP connection (1): localhost
+------------+--------------------------------------+
| Field | Value |
+------------+--------------------------------------+
| ID | 5268cb03-5288-4b50-9eb7-b7ed7e3c595f |
| Workflow | test-output-rewrite.main |
| State | RUNNING |
| Created at | 2015-01-28T22:28:09.737474 |
| Updated at | 2015-01-28T22:28:09.816277 |
+------------+--------------------------------------+

~/tmp$ mistral task-get-output 9e0d6151-14df-463d-a3b2-b11032b2622c
Starting new HTTP connection (1): localhost
{
    "printed_subject": "This mistral thing"
}

~/tmp$ mistral execution-list
Starting new HTTP connection (1): localhost
+--------------------------------------+--------------------------+---------+---------------------+---------------------+
| ID | Workflow | State | Created at | Updated at |
+--------------------------------------+--------------------------+---------+---------------------+---------------------+
| 5268cb03-5288-4b50-9eb7-b7ed7e3c595f | test-output-rewrite.main | SUCCESS | 2015-01-28 22:28:09 | 2015-01-28 22:28:10 |
+--------------------------------------+--------------------------+---------+---------------------+---------------------+
vagrant@arkham:~/tmp$ mistral execution-get-output 5268cb03-5288-4b50-9eb7-b7ed7e3c595f
Starting new HTTP connection (1): localhost
{
    "tagline": "mistral is awesome!"
}

The expected tagline should be "This mistral thing is awesome!"...

Revision history for this message
Dmitri Zimine (i-dz) wrote :

https://github.com/stackforge/mistral/blob/master/mistral/utils/__init__.py#L117-L124

idea: suggest to add "override=False" in method signature:

def merge_dicts(left, right, override=False):

Changed in mistral:
importance: Undecided → High
assignee: nobody → Winson Chan (winson-c-chan)
milestone: none → kilo-2
status: New → Confirmed
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/151473

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

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

commit 9300408fb176c138f21df8b5f1e932b8b9c2df7d
Author: Winson Chan <email address hidden>
Date: Thu Jan 29 23:46:54 2015 +0000

    Fix sequential tasks publishing the same variable

    Fixes a bug where a second task cannot update a published variable.
    Modifies the merge_dicts utility to have an overwrite flag. Modifies the
    evaluate_task_outbound_context method to allow overwrite when merging
    dicts.

    Closes bug: 1415668

    Change-Id: I579f932d422228233ad2d22f21999b48a9b92b9f

Changed in mistral:
status: In Progress → Fix Committed
Changed in mistral:
status: Fix Committed → Fix Released
Changed in mistral:
milestone: kilo-2 → 2015.1
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.