{"action":"created","comment":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/comments/72392855","id":72392855,"diff_hunk":"@@ -158,32 +157,50 @@ def run(self, action_parameters):\n         if ACTION_OUTPUT_RESULT_DELIMITER in stdout:\n             split = stdout.split(ACTION_OUTPUT_RESULT_DELIMITER)\n             assert len(split) == 3\n-            result = split[1].strip()\n+            action_result = split[1].strip()\n             stdout = split[0] + split[2]\n         else:\n-            result = None\n-\n+            action_result = None\n         try:\n-            result = json.loads(result)\n+            action_result = json.loads(action_result)\n         except:\n             pass\n+        action_status = None","path":"st2actions/st2actions/runners/pythonrunner.py","position":24,"original_position":24,"commit_id":"a8f18802d7f2304785e69f8394a53a8c4b539757","original_commit_id":"a8f18802d7f2304785e69f8394a53a8c4b539757","user":{"login":"Kami","id":125088,"avatar_url":"https://avatars.githubusercontent.com/u/125088?v=3","gravatar_id":"","url":"https://api.github.com/users/Kami","html_url":"https://github.com/Kami","followers_url":"https://api.github.com/users/Kami/followers","following_url":"https://api.github.com/users/Kami/following{/other_user}","gists_url":"https://api.github.com/users/Kami/gists{/gist_id}","starred_url":"https://api.github.com/users/Kami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kami/subscriptions","organizations_url":"https://api.github.com/users/Kami/orgs","repos_url":"https://api.github.com/users/Kami/repos","events_url":"https://api.github.com/users/Kami/events{/privacy}","received_events_url":"https://api.github.com/users/Kami/received_events","type":"User","site_admin":false},"body":"This could perhaps be refactored in a separate utility method to make it a bit easier to read and test.","created_at":"2016-07-27T07:33:56Z","updated_at":"2016-07-27T07:33:57Z","html_url":"https://github.com/StackStorm/st2/pull/2835#discussion_r72392855","pull_request_url":"https://api.github.com/repos/StackStorm/st2/pulls/2835","_links":{"self":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/comments/72392855"},"html":{"href":"https://github.com/StackStorm/st2/pull/2835#discussion_r72392855"},"pull_request":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/2835"}}},"pull_request":{"url":"https://api.github.com/repos/StackStorm/st2/pulls/2835","id":78949687,"html_url":"https://github.com/StackStorm/st2/pull/2835","diff_url":"https://github.com/StackStorm/st2/pull/2835.diff","patch_url":"https://github.com/StackStorm/st2/pull/2835.patch","issue_url":"https://api.github.com/repos/StackStorm/st2/issues/2835","number":2835,"state":"open","locked":false,"title":"[RFR]: Enhancement: python action should be allowed to return status #2742","user":{"login":"humblearner","id":11877841,"avatar_url":"https://avatars.githubusercontent.com/u/11877841?v=3","gravatar_id":"","url":"https://api.github.com/users/humblearner","html_url":"https://github.com/humblearner","followers_url":"https://api.github.com/users/humblearner/followers","following_url":"https://api.github.com/users/humblearner/following{/other_user}","gists_url":"https://api.github.com/users/humblearner/gists{/gist_id}","starred_url":"https://api.github.com/users/humblearner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humblearner/subscriptions","organizations_url":"https://api.github.com/users/humblearner/orgs","repos_url":"https://api.github.com/users/humblearner/repos","events_url":"https://api.github.com/users/humblearner/events{/privacy}","received_events_url":"https://api.github.com/users/humblearner/received_events","type":"User","site_admin":false},"body":"**Changed files:**\r\n- st2actions/st2actions/runners/python_action_wrapper.py\r\n- st2actions/st2actions/runners/pythonrunner.py\r\n- st2tests/st2tests/resources/packs/pythonactions/actions/pascal_row.py\r\n- st2actions/tests/unit/test_pythonrunner.py\r\n \r\n\r\n**Test Cases:**\r\n_Modified_:\r\n- test_simple_action_without_status\r\n- test_stdout_interception_and_parsing\r\n\r\n_New_:\r\n- test_simple_action_with_status_succeeded\r\n- test_simple_action_with_status_failed\r\n- test_simple_action_with_status_failed_result_none\r\n\r\n**Caveats:**\r\n- Assumption: User must provide status as \"succeeded\" or \"failed\" (case insensitive). It may fail otherwise. No check for this.","created_at":"2016-07-27T00:52:06Z","updated_at":"2016-07-27T07:33:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e41ee4b6fa1906bb921fa9754583f323d5b3b45","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/StackStorm/st2/pulls/2835/commits","review_comments_url":"https://api.github.com/repos/StackStorm/st2/pulls/2835/comments","review_comment_url":"https://api.github.com/repos/StackStorm/st2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/StackStorm/st2/issues/2835/comments","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/a8f18802d7f2304785e69f8394a53a8c4b539757","head":{"label":"StackStorm:enhancement/python_action_return_status","ref":"enhancement/python_action_return_status","sha":"a8f18802d7f2304785e69f8394a53a8c4b539757","user":{"login":"StackStorm","id":4969009,"avatar_url":"https://avatars.githubusercontent.com/u/4969009?v=3","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"repo":{"id":19051806,"name":"st2","full_name":"StackStorm/st2","owner":{"login":"StackStorm","id":4969009,"avatar_url":"https://avatars.githubusercontent.com/u/4969009?v=3","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/StackStorm/st2","description":"StackStorm (aka \"IFTTT for Ops\") is event-driven automation commonly used for auto-remediation, security responses, facilitated troubleshooting, complex deployments, and more. Includes rules engine, workflow,1800+ integrations (see /st2contrib), native ChatOps and so forth.  Installer available at http://docs.stackstorm.com/install/index.html. Ping us on slack - https://stackstorm-community.slack.com/. ","fork":false,"url":"https://api.github.com/repos/StackStorm/st2","forks_url":"https://api.github.com/repos/StackStorm/st2/forks","keys_url":"https://api.github.com/repos/StackStorm/st2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StackStorm/st2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StackStorm/st2/teams","hooks_url":"https://api.github.com/repos/StackStorm/st2/hooks","issue_events_url":"https://api.github.com/repos/StackStorm/st2/issues/events{/number}","events_url":"https://api.github.com/repos/StackStorm/st2/events","assignees_url":"https://api.github.com/repos/StackStorm/st2/assignees{/user}","branches_url":"https://api.github.com/repos/StackStorm/st2/branches{/branch}","tags_url":"https://api.github.com/repos/StackStorm/st2/tags","blobs_url":"https://api.github.com/repos/StackStorm/st2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StackStorm/st2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StackStorm/st2/git/refs{/sha}","trees_url":"https://api.github.com/repos/StackStorm/st2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/{sha}","languages_url":"https://api.github.com/repos/StackStorm/st2/languages","stargazers_url":"https://api.github.com/repos/StackStorm/st2/stargazers","contributors_url":"https://api.github.com/repos/StackStorm/st2/contributors","subscribers_url":"https://api.github.com/repos/StackStorm/st2/subscribers","subscription_url":"https://api.github.com/repos/StackStorm/st2/subscription","commits_url":"https://api.github.com/repos/StackStorm/st2/commits{/sha}","git_commits_url":"https://api.github.com/repos/StackStorm/st2/git/commits{/sha}","comments_url":"https://api.github.com/repos/StackStorm/st2/comments{/number}","issue_comment_url":"https://api.github.com/repos/StackStorm/st2/issues/comments{/number}","contents_url":"https://api.github.com/repos/StackStorm/st2/contents/{+path}","compare_url":"https://api.github.com/repos/StackStorm/st2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StackStorm/st2/merges","archive_url":"https://api.github.com/repos/StackStorm/st2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StackStorm/st2/downloads","issues_url":"https://api.github.com/repos/StackStorm/st2/issues{/number}","pulls_url":"https://api.github.com/repos/StackStorm/st2/pulls{/number}","milestones_url":"https://api.github.com/repos/StackStorm/st2/milestones{/number}","notifications_url":"https://api.github.com/repos/StackStorm/st2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StackStorm/st2/labels{/name}","releases_url":"https://api.github.com/repos/StackStorm/st2/releases{/id}","deployments_url":"https://api.github.com/repos/StackStorm/st2/deployments","created_at":"2014-04-23T00:51:34Z","updated_at":"2016-07-26T10:54:17Z","pushed_at":"2016-07-27T00:52:06Z","git_url":"git://github.com/StackStorm/st2.git","ssh_url":"git@github.com:StackStorm/st2.git","clone_url":"https://github.com/StackStorm/st2.git","svn_url":"https://github.com/StackStorm/st2","homepage":"http://www.stackstorm.com/","size":17807,"stargazers_count":1473,"watchers_count":1473,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":161,"mirror_url":null,"open_issues_count":135,"forks":161,"open_issues":135,"watchers":1473,"default_branch":"master"}},"base":{"label":"StackStorm:master","ref":"master","sha":"06a31611754bb9320f845814c4bccd8379d3cdc2","user":{"login":"StackStorm","id":4969009,"avatar_url":"https://avatars.githubusercontent.com/u/4969009?v=3","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"repo":{"id":19051806,"name":"st2","full_name":"StackStorm/st2","owner":{"login":"StackStorm","id":4969009,"avatar_url":"https://avatars.githubusercontent.com/u/4969009?v=3","gravatar_id":"","url":"https://api.github.com/users/StackStorm","html_url":"https://github.com/StackStorm","followers_url":"https://api.github.com/users/StackStorm/followers","following_url":"https://api.github.com/users/StackStorm/following{/other_user}","gists_url":"https://api.github.com/users/StackStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/StackStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackStorm/subscriptions","organizations_url":"https://api.github.com/users/StackStorm/orgs","repos_url":"https://api.github.com/users/StackStorm/repos","events_url":"https://api.github.com/users/StackStorm/events{/privacy}","received_events_url":"https://api.github.com/users/StackStorm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/StackStorm/st2","description":"StackStorm (aka \"IFTTT for Ops\") is event-driven automation commonly used for auto-remediation, security responses, facilitated troubleshooting, complex deployments, and more. Includes rules engine, workflow,1800+ integrations (see /st2contrib), native ChatOps and so forth.  Installer available at http://docs.stackstorm.com/install/index.html. Ping us on slack - https://stackstorm-community.slack.com/. ","fork":false,"url":"https://api.github.com/repos/StackStorm/st2","forks_url":"https://api.github.com/repos/StackStorm/st2/forks","keys_url":"https://api.github.com/repos/StackStorm/st2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StackStorm/st2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StackStorm/st2/teams","hooks_url":"https://api.github.com/repos/StackStorm/st2/hooks","issue_events_url":"https://api.github.com/repos/StackStorm/st2/issues/events{/number}","events_url":"https://api.github.com/repos/StackStorm/st2/events","assignees_url":"https://api.github.com/repos/StackStorm/st2/assignees{/user}","branches_url":"https://api.github.com/repos/StackStorm/st2/branches{/branch}","tags_url":"https://api.github.com/repos/StackStorm/st2/tags","blobs_url":"https://api.github.com/repos/StackStorm/st2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StackStorm/st2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StackStorm/st2/git/refs{/sha}","trees_url":"https://api.github.com/repos/StackStorm/st2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StackStorm/st2/statuses/{sha}","languages_url":"https://api.github.com/repos/StackStorm/st2/languages","stargazers_url":"https://api.github.com/repos/StackStorm/st2/stargazers","contributors_url":"https://api.github.com/repos/StackStorm/st2/contributors","subscribers_url":"https://api.github.com/repos/StackStorm/st2/subscribers","subscription_url":"https://api.github.com/repos/StackStorm/st2/subscription","commits_url":"https://api.github.com/repos/StackStorm/st2/commits{/sha}","git_commits_url":"https://api.github.com/repos/StackStorm/st2/git/commits{/sha}","comments_url":"https://api.github.com/repos/StackStorm/st2/comments{/number}","issue_comment_url":"https://api.github.com/repos/StackStorm/st2/issues/comments{/number}","contents_url":"https://api.github.com/repos/StackStorm/st2/contents/{+path}","compare_url":"https://api.github.com/repos/StackStorm/st2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StackStorm/st2/merges","archive_url":"https://api.github.com/repos/StackStorm/st2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StackStorm/st2/downloads","issues_url":"https://api.github.com/repos/StackStorm/st2/issues{/number}","pulls_url":"https://api.github.com/repos/StackStorm/st2/pulls{/number}","milestones_url":"https://api.github.com/repos/StackStorm/st2/milestones{/number}","notifications_url":"https://api.github.com/repos/StackStorm/st2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StackStorm/st2/labels{/name}","releases_url":"https://api.github.com/repos/StackStorm/st2/releases{/id}","deployments_url":"https://api.github.com/repos/StackStorm/st2/deployments","created_at":"2014-04-23T00:51:34Z","updated_at":"2016-07-26T10:54:17Z","pushed_at":"2016-07-27T00:52:06Z","git_url":"git://github.com/StackStorm/st2.git","ssh_url":"git@github.com:StackStorm/st2.git","clone_url":"https://github.com/StackStorm/st2.git","svn_url":"https://github.com/StackStorm/st2","homepage":"http://www.stackstorm.com/","size":17807,"stargazers_count":1473,"watchers_count":1473,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":161,"mirror_url":null,"open_issues_count":135,"forks":161,"open_issues":135,"watchers":1473,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/2835"},"html":{"href":"https://github.com/StackStorm/st2/pull/2835"},"issue":{"href":"https://api.github.com/repos/StackStorm/st2/issues/2835"},"comments":{"href":"https://api.github.com/repos/StackStorm/st2/issues/2835/comments"},"review_comments":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/2835/comments"},"review_comment":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/StackStorm/st2/pulls/2835/commits"},"statuses":{"href":"https://api.github.com/repos/StackStorm/st2/statuses/a8f18802d7f2304785e69f8394a53a8c4b539757"}}}}
{"actor":{"display_login":"Kami"}}