{"action":"opened","issue":{"url":"https://api.github.com/repos/fabric/fabric/issues/1438","repository_url":"https://api.github.com/repos/fabric/fabric","labels_url":"https://api.github.com/repos/fabric/fabric/issues/1438/labels{/name}","comments_url":"https://api.github.com/repos/fabric/fabric/issues/1438/comments","events_url":"https://api.github.com/repos/fabric/fabric/issues/1438/events","html_url":"https://github.com/fabric/fabric/issues/1438","id":138553363,"number":1438,"title":"No way to print execute() with failing tasks without warn_only=True","user":{"login":"lewisthompson","id":4053372,"avatar_url":"https://avatars.githubusercontent.com/u/4053372?v=3","gravatar_id":"","url":"https://api.github.com/users/lewisthompson","html_url":"https://github.com/lewisthompson","followers_url":"https://api.github.com/users/lewisthompson/followers","following_url":"https://api.github.com/users/lewisthompson/following{/other_user}","gists_url":"https://api.github.com/users/lewisthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/lewisthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lewisthompson/subscriptions","organizations_url":"https://api.github.com/users/lewisthompson/orgs","repos_url":"https://api.github.com/users/lewisthompson/repos","events_url":"https://api.github.com/users/lewisthompson/events{/privacy}","received_events_url":"https://api.github.com/users/lewisthompson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-04T18:47:53Z","updated_at":"2016-03-04T18:47:53Z","closed_at":null,"body":"`execute()` returns a summary of results when all tasks complete successfully (or if failures are due to network errors).\r\n\r\nI need to be able to specify `warn_only=True` for tasks where this is legitimately the case but not have an exception thrown when unspecified.  Looking at the HEAD code for `execute()`:\r\n\r\n```python\r\n        # If running in parallel, block until job queue is emptied\r\n        if jobs:\r\n            err = \"One or more hosts failed while executing task '%s'\" % (\r\n                my_env['command']\r\n            )\r\n            jobs.close()\r\n            # Abort if any children did not exit cleanly (fail-fast).\r\n            # This prevents Fabric from continuing on to any other tasks.\r\n            # Otherwise, pull in results from the child run.\r\n            ran_jobs = jobs.run()\r\n            for name, d in ran_jobs.iteritems():\r\n                if d['exit_code'] != 0:\r\n                    if isinstance(d['results'], NetworkError) and \\\r\n                            _is_network_error_ignored():\r\n                        error(d['results'].message, func=warn, exception=d['results'].wrapped)\r\n                    elif isinstance(d['results'], BaseException):\r\n                        error(err, exception=d['results'])\r\n                    else:\r\n                        error(err)\r\n                results[name] = d['results']\r\n```\r\n\r\nHere the call to `error()` may raise an exception which can in no way be handled by the caller of `execute()` to allow the summary to be obtained."}}