{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/13713","labels_url":"https://api.github.com/repos/ansible/ansible/issues/13713/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/13713/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/13713/events","html_url":"https://github.com/ansible/ansible/issues/13713","id":124613852,"number":13713,"title":"Can't get python traceback from exception thrown in callback plugin","user":{"login":"agaffney","id":825875,"avatar_url":"https://avatars.githubusercontent.com/u/825875?v=3","gravatar_id":"","url":"https://api.github.com/users/agaffney","html_url":"https://github.com/agaffney","followers_url":"https://api.github.com/users/agaffney/followers","following_url":"https://api.github.com/users/agaffney/following{/other_user}","gists_url":"https://api.github.com/users/agaffney/gists{/gist_id}","starred_url":"https://api.github.com/users/agaffney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agaffney/subscriptions","organizations_url":"https://api.github.com/users/agaffney/orgs","repos_url":"https://api.github.com/users/agaffney/repos","events_url":"https://api.github.com/users/agaffney/events{/privacy}","received_events_url":"https://api.github.com/users/agaffney/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ansible/ansible/milestones/5","html_url":"https://github.com/ansible/ansible/milestones/v2","labels_url":"https://api.github.com/repos/ansible/ansible/milestones/5/labels","id":975800,"number":5,"title":"v2","description":null,"creator":{"login":"bcoca","id":836171,"avatar_url":"https://avatars.githubusercontent.com/u/836171?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoca","html_url":"https://github.com/bcoca","followers_url":"https://api.github.com/users/bcoca/followers","following_url":"https://api.github.com/users/bcoca/following{/other_user}","gists_url":"https://api.github.com/users/bcoca/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoca/subscriptions","organizations_url":"https://api.github.com/users/bcoca/orgs","repos_url":"https://api.github.com/users/bcoca/repos","events_url":"https://api.github.com/users/bcoca/events{/privacy}","received_events_url":"https://api.github.com/users/bcoca/received_events","type":"User","site_admin":false},"open_issues":43,"closed_issues":644,"state":"open","created_at":"2015-02-11T19:43:06Z","updated_at":"2016-01-06T16:21:42Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-01-02T22:04:25Z","updated_at":"2016-01-06T16:25:39Z","closed_at":null,"body":"As part of #13712 , I was trying to track down the source of a python exception in the `default.py` stdout callback plugin. Unfortunately, this effort was hindered by the apparent inability to get more than the exception and the file that it came from (no line number or traceback). Even when running with `-vvv`, this is the most I could get (which is exactly what I get without any `-v` option):\r\n\r\n```\r\n [WARNING]: Error when using <bound method CallbackModule.v2_on_file_diff of </home/agaffney/dev/ansible/lib/ansible/plugins/callback/default.CallbackModule object at\r\n0x760c34f0>>: 'TaskResult' object has no attribute 'get'\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/169378543","html_url":"https://github.com/ansible/ansible/issues/13713#issuecomment-169378543","issue_url":"https://api.github.com/repos/ansible/ansible/issues/13713","id":169378543,"user":{"login":"agaffney","id":825875,"avatar_url":"https://avatars.githubusercontent.com/u/825875?v=3","gravatar_id":"","url":"https://api.github.com/users/agaffney","html_url":"https://github.com/agaffney","followers_url":"https://api.github.com/users/agaffney/followers","following_url":"https://api.github.com/users/agaffney/following{/other_user}","gists_url":"https://api.github.com/users/agaffney/gists{/gist_id}","starred_url":"https://api.github.com/users/agaffney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agaffney/subscriptions","organizations_url":"https://api.github.com/users/agaffney/orgs","repos_url":"https://api.github.com/users/agaffney/repos","events_url":"https://api.github.com/users/agaffney/events{/privacy}","received_events_url":"https://api.github.com/users/agaffney/received_events","type":"User","site_admin":false},"created_at":"2016-01-06T16:25:39Z","updated_at":"2016-01-06T16:25:39Z","body":"The current version of the PR outputs the following:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/agaffney/dev/ansible/lib/ansible/executor/task_queue_manager.py\", line 292, in send_callback\r\n    method(*args, **kwargs)\r\n  File \"/home/agaffney/dev/ansible/lib/ansible/plugins/callback/default.py\", line 140, in v2_on_file_diff\r\n    if 'diff' in res2 and res['diff']:\r\nNameError: global name 'res2' is not defined\r\n```\r\n\r\nThis is much more readable, but it dropped the `[WARNING]` bit."}}