StackStorm / StackStorm/st2

Success instead of expected failure in Action result

Open
#3,133 10 comments 0 reactions 1 assignee View on GitHub

@Kami is already working on this.

Since Dec 20, 2016.

bug
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

Python runner code

def run(self):
        r = requests.get('https://google.com')
        print r
        return (False, r)

I expect the status to be 'failed' because I am returning False as the tuple's status indicator, per the documentation. Actual output:

.
id: 585486e602ebd502e0980392
status: succeeded
parameters:
result:
  exit_code: 0
  result: None
  stderr: ''
  stdout: '<Response [200]>

    '

The same thing happens when I use self instead of r - the issue might happen when any object is returned as part of the tuple. The docs imply that the result can be any value:

If the run method finishes without exceptions, the execution is successful, and the value returned by the method (any value: boolean, string, list, dict, etc.) is considered its result. Raising an exception will report the execution as failed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.