{"action":"created","comment":{"url":"https://api.github.com/repos/chango/inferno/pulls/comments/37349408","id":37349408,"diff_hunk":"@@ -27,3 +30,29 @@ def send_mail(job_id=None, job_fail=None, mail_to=None, mail_from=None, mail_ser\n         return True\n     except:\n         return False\n+\n+\n+def send_pagerduty(job_id=None, job_fail=None,\n+                   api_key=None, retry=None, retry_delay=None):\n+    api_url = \"https://events.pagerduty.com/generic/2010-04-15/create_event.json\"\n+    if not job_id or not job_fail:\n+        raise Exception(\n+            \"Missing job_id or job_fail for Pagerduty notification\")\n+    if not api_key:\n+        raise Exception(\n+            \"Missing pagerduty API key\")\n+    if retry and retry_delay:","path":"inferno/lib/notifications.py","position":24,"original_position":24,"commit_id":"ec9715fa722608d68f207d72efba67b21a037a9c","original_commit_id":"ec9715fa722608d68f207d72efba67b21a037a9c","user":{"login":"mkhaitman","id":7852008,"avatar_url":"https://avatars.githubusercontent.com/u/7852008?v=3","gravatar_id":"","url":"https://api.github.com/users/mkhaitman","html_url":"https://github.com/mkhaitman","followers_url":"https://api.github.com/users/mkhaitman/followers","following_url":"https://api.github.com/users/mkhaitman/following{/other_user}","gists_url":"https://api.github.com/users/mkhaitman/gists{/gist_id}","starred_url":"https://api.github.com/users/mkhaitman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkhaitman/subscriptions","organizations_url":"https://api.github.com/users/mkhaitman/orgs","repos_url":"https://api.github.com/users/mkhaitman/repos","events_url":"https://api.github.com/users/mkhaitman/events{/privacy}","received_events_url":"https://api.github.com/users/mkhaitman/received_events","type":"User","site_admin":false},"body":"This retry stuff is un-used as part of this send_pagerduty method.  Should be removed or appended to the pd_data['details'] perhaps!","created_at":"2015-08-18T20:30:49Z","updated_at":"2015-08-18T20:30:49Z","html_url":"https://github.com/chango/inferno/pull/33#discussion_r37349408","pull_request_url":"https://api.github.com/repos/chango/inferno/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/chango/inferno/pulls/comments/37349408"},"html":{"href":"https://github.com/chango/inferno/pull/33#discussion_r37349408"},"pull_request":{"href":"https://api.github.com/repos/chango/inferno/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/chango/inferno/pulls/33","id":40675314,"html_url":"https://github.com/chango/inferno/pull/33","diff_url":"https://github.com/chango/inferno/pull/33.diff","patch_url":"https://github.com/chango/inferno/pull/33.patch","issue_url":"https://api.github.com/repos/chango/inferno/issues/33","number":33,"state":"open","locked":false,"title":"Add pagerduty notifications, email sends traceback instead of exception","user":{"login":"oldmantaiter","id":2213247,"avatar_url":"https://avatars.githubusercontent.com/u/2213247?v=3","gravatar_id":"","url":"https://api.github.com/users/oldmantaiter","html_url":"https://github.com/oldmantaiter","followers_url":"https://api.github.com/users/oldmantaiter/followers","following_url":"https://api.github.com/users/oldmantaiter/following{/other_user}","gists_url":"https://api.github.com/users/oldmantaiter/gists{/gist_id}","starred_url":"https://api.github.com/users/oldmantaiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oldmantaiter/subscriptions","organizations_url":"https://api.github.com/users/oldmantaiter/orgs","repos_url":"https://api.github.com/users/oldmantaiter/repos","events_url":"https://api.github.com/users/oldmantaiter/events{/privacy}","received_events_url":"https://api.github.com/users/oldmantaiter/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-23T14:05:30Z","updated_at":"2015-08-18T20:30:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1888fbf5cbab1c9f92bc60ca0f50a39911a8ddac","assignee":{"login":"mkhaitman","id":7852008,"avatar_url":"https://avatars.githubusercontent.com/u/7852008?v=3","gravatar_id":"","url":"https://api.github.com/users/mkhaitman","html_url":"https://github.com/mkhaitman","followers_url":"https://api.github.com/users/mkhaitman/followers","following_url":"https://api.github.com/users/mkhaitman/following{/other_user}","gists_url":"https://api.github.com/users/mkhaitman/gists{/gist_id}","starred_url":"https://api.github.com/users/mkhaitman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkhaitman/subscriptions","organizations_url":"https://api.github.com/users/mkhaitman/orgs","repos_url":"https://api.github.com/users/mkhaitman/repos","events_url":"https://api.github.com/users/mkhaitman/events{/privacy}","received_events_url":"https://api.github.com/users/mkhaitman/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/chango/inferno/pulls/33/commits","review_comments_url":"https://api.github.com/repos/chango/inferno/pulls/33/comments","review_comment_url":"https://api.github.com/repos/chango/inferno/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chango/inferno/issues/33/comments","statuses_url":"https://api.github.com/repos/chango/inferno/statuses/ec9715fa722608d68f207d72efba67b21a037a9c","head":{"label":"oldmantaiter:add-pagerduty-notification","ref":"add-pagerduty-notification","sha":"ec9715fa722608d68f207d72efba67b21a037a9c","user":{"login":"oldmantaiter","id":2213247,"avatar_url":"https://avatars.githubusercontent.com/u/2213247?v=3","gravatar_id":"","url":"https://api.github.com/users/oldmantaiter","html_url":"https://github.com/oldmantaiter","followers_url":"https://api.github.com/users/oldmantaiter/followers","following_url":"https://api.github.com/users/oldmantaiter/following{/other_user}","gists_url":"https://api.github.com/users/oldmantaiter/gists{/gist_id}","starred_url":"https://api.github.com/users/oldmantaiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oldmantaiter/subscriptions","organizations_url":"https://api.github.com/users/oldmantaiter/orgs","repos_url":"https://api.github.com/users/oldmantaiter/repos","events_url":"https://api.github.com/users/oldmantaiter/events{/privacy}","received_events_url":"https://api.github.com/users/oldmantaiter/received_events","type":"User","site_admin":false},"repo":{"id":17420065,"name":"inferno","full_name":"oldmantaiter/inferno","owner":{"login":"oldmantaiter","id":2213247,"avatar_url":"https://avatars.githubusercontent.com/u/2213247?v=3","gravatar_id":"","url":"https://api.github.com/users/oldmantaiter","html_url":"https://github.com/oldmantaiter","followers_url":"https://api.github.com/users/oldmantaiter/followers","following_url":"https://api.github.com/users/oldmantaiter/following{/other_user}","gists_url":"https://api.github.com/users/oldmantaiter/gists{/gist_id}","starred_url":"https://api.github.com/users/oldmantaiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oldmantaiter/subscriptions","organizations_url":"https://api.github.com/users/oldmantaiter/orgs","repos_url":"https://api.github.com/users/oldmantaiter/repos","events_url":"https://api.github.com/users/oldmantaiter/events{/privacy}","received_events_url":"https://api.github.com/users/oldmantaiter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oldmantaiter/inferno","description":"Clone of https://bitbucket.org/chango/inferno","fork":true,"url":"https://api.github.com/repos/oldmantaiter/inferno","forks_url":"https://api.github.com/repos/oldmantaiter/inferno/forks","keys_url":"https://api.github.com/repos/oldmantaiter/inferno/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oldmantaiter/inferno/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oldmantaiter/inferno/teams","hooks_url":"https://api.github.com/repos/oldmantaiter/inferno/hooks","issue_events_url":"https://api.github.com/repos/oldmantaiter/inferno/issues/events{/number}","events_url":"https://api.github.com/repos/oldmantaiter/inferno/events","assignees_url":"https://api.github.com/repos/oldmantaiter/inferno/assignees{/user}","branches_url":"https://api.github.com/repos/oldmantaiter/inferno/branches{/branch}","tags_url":"https://api.github.com/repos/oldmantaiter/inferno/tags","blobs_url":"https://api.github.com/repos/oldmantaiter/inferno/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oldmantaiter/inferno/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oldmantaiter/inferno/git/refs{/sha}","trees_url":"https://api.github.com/repos/oldmantaiter/inferno/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oldmantaiter/inferno/statuses/{sha}","languages_url":"https://api.github.com/repos/oldmantaiter/inferno/languages","stargazers_url":"https://api.github.com/repos/oldmantaiter/inferno/stargazers","contributors_url":"https://api.github.com/repos/oldmantaiter/inferno/contributors","subscribers_url":"https://api.github.com/repos/oldmantaiter/inferno/subscribers","subscription_url":"https://api.github.com/repos/oldmantaiter/inferno/subscription","commits_url":"https://api.github.com/repos/oldmantaiter/inferno/commits{/sha}","git_commits_url":"https://api.github.com/repos/oldmantaiter/inferno/git/commits{/sha}","comments_url":"https://api.github.com/repos/oldmantaiter/inferno/comments{/number}","issue_comment_url":"https://api.github.com/repos/oldmantaiter/inferno/issues/comments{/number}","contents_url":"https://api.github.com/repos/oldmantaiter/inferno/contents/{+path}","compare_url":"https://api.github.com/repos/oldmantaiter/inferno/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oldmantaiter/inferno/merges","archive_url":"https://api.github.com/repos/oldmantaiter/inferno/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oldmantaiter/inferno/downloads","issues_url":"https://api.github.com/repos/oldmantaiter/inferno/issues{/number}","pulls_url":"https://api.github.com/repos/oldmantaiter/inferno/pulls{/number}","milestones_url":"https://api.github.com/repos/oldmantaiter/inferno/milestones{/number}","notifications_url":"https://api.github.com/repos/oldmantaiter/inferno/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oldmantaiter/inferno/labels{/name}","releases_url":"https://api.github.com/repos/oldmantaiter/inferno/releases{/id}","created_at":"2014-03-04T22:45:47Z","updated_at":"2015-03-07T02:46:16Z","pushed_at":"2015-07-23T14:16:14Z","git_url":"git://github.com/oldmantaiter/inferno.git","ssh_url":"git@github.com:oldmantaiter/inferno.git","clone_url":"https://github.com/oldmantaiter/inferno.git","svn_url":"https://github.com/oldmantaiter/inferno","homepage":null,"size":1406,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"chango:master","ref":"master","sha":"033872eebd033f6cfa2ce89c97d919611cafc9ee","user":{"login":"chango","id":6200181,"avatar_url":"https://avatars.githubusercontent.com/u/6200181?v=3","gravatar_id":"","url":"https://api.github.com/users/chango","html_url":"https://github.com/chango","followers_url":"https://api.github.com/users/chango/followers","following_url":"https://api.github.com/users/chango/following{/other_user}","gists_url":"https://api.github.com/users/chango/gists{/gist_id}","starred_url":"https://api.github.com/users/chango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chango/subscriptions","organizations_url":"https://api.github.com/users/chango/orgs","repos_url":"https://api.github.com/users/chango/repos","events_url":"https://api.github.com/users/chango/events{/privacy}","received_events_url":"https://api.github.com/users/chango/received_events","type":"Organization","site_admin":false},"repo":{"id":17275872,"name":"inferno","full_name":"chango/inferno","owner":{"login":"chango","id":6200181,"avatar_url":"https://avatars.githubusercontent.com/u/6200181?v=3","gravatar_id":"","url":"https://api.github.com/users/chango","html_url":"https://github.com/chango","followers_url":"https://api.github.com/users/chango/followers","following_url":"https://api.github.com/users/chango/following{/other_user}","gists_url":"https://api.github.com/users/chango/gists{/gist_id}","starred_url":"https://api.github.com/users/chango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chango/subscriptions","organizations_url":"https://api.github.com/users/chango/orgs","repos_url":"https://api.github.com/users/chango/repos","events_url":"https://api.github.com/users/chango/events{/privacy}","received_events_url":"https://api.github.com/users/chango/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chango/inferno","description":"A rule-based map-reduce scheduling framework","fork":false,"url":"https://api.github.com/repos/chango/inferno","forks_url":"https://api.github.com/repos/chango/inferno/forks","keys_url":"https://api.github.com/repos/chango/inferno/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chango/inferno/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chango/inferno/teams","hooks_url":"https://api.github.com/repos/chango/inferno/hooks","issue_events_url":"https://api.github.com/repos/chango/inferno/issues/events{/number}","events_url":"https://api.github.com/repos/chango/inferno/events","assignees_url":"https://api.github.com/repos/chango/inferno/assignees{/user}","branches_url":"https://api.github.com/repos/chango/inferno/branches{/branch}","tags_url":"https://api.github.com/repos/chango/inferno/tags","blobs_url":"https://api.github.com/repos/chango/inferno/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chango/inferno/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chango/inferno/git/refs{/sha}","trees_url":"https://api.github.com/repos/chango/inferno/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chango/inferno/statuses/{sha}","languages_url":"https://api.github.com/repos/chango/inferno/languages","stargazers_url":"https://api.github.com/repos/chango/inferno/stargazers","contributors_url":"https://api.github.com/repos/chango/inferno/contributors","subscribers_url":"https://api.github.com/repos/chango/inferno/subscribers","subscription_url":"https://api.github.com/repos/chango/inferno/subscription","commits_url":"https://api.github.com/repos/chango/inferno/commits{/sha}","git_commits_url":"https://api.github.com/repos/chango/inferno/git/commits{/sha}","comments_url":"https://api.github.com/repos/chango/inferno/comments{/number}","issue_comment_url":"https://api.github.com/repos/chango/inferno/issues/comments{/number}","contents_url":"https://api.github.com/repos/chango/inferno/contents/{+path}","compare_url":"https://api.github.com/repos/chango/inferno/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chango/inferno/merges","archive_url":"https://api.github.com/repos/chango/inferno/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chango/inferno/downloads","issues_url":"https://api.github.com/repos/chango/inferno/issues{/number}","pulls_url":"https://api.github.com/repos/chango/inferno/pulls{/number}","milestones_url":"https://api.github.com/repos/chango/inferno/milestones{/number}","notifications_url":"https://api.github.com/repos/chango/inferno/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chango/inferno/labels{/name}","releases_url":"https://api.github.com/repos/chango/inferno/releases{/id}","created_at":"2014-02-28T05:09:09Z","updated_at":"2015-05-05T17:08:15Z","pushed_at":"2015-07-23T14:20:37Z","git_url":"git://github.com/chango/inferno.git","ssh_url":"git@github.com:chango/inferno.git","clone_url":"https://github.com/chango/inferno.git","svn_url":"https://github.com/chango/inferno","homepage":"","size":1751,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":3,"forks":9,"open_issues":3,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chango/inferno/pulls/33"},"html":{"href":"https://github.com/chango/inferno/pull/33"},"issue":{"href":"https://api.github.com/repos/chango/inferno/issues/33"},"comments":{"href":"https://api.github.com/repos/chango/inferno/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/chango/inferno/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/chango/inferno/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chango/inferno/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/chango/inferno/statuses/ec9715fa722608d68f207d72efba67b21a037a9c"}}}}