{"action":"created","comment":{"url":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/comments/30457736","id":30457736,"diff_hunk":"@@ -52,7 +52,24 @@ class DOChecks(CheckBase):\n     def __init__(self, DO_TOKEN):\n         if DO_TOKEN is None:\n             raise MissingAuthException\n-        self.c = DigitalOcean(DO_TOKEN)\n+        self.c = digitalocean.Manager(token=DO_TOKEN)\n+\n+    def eval_delta(self, date1, date2, max_uptime):\n+        \"\"\"\n+        Compare the date/time stamps and determine if the instance has violated threshold. Expects like TZ\n+        :param date1: datetime obj. first date/time to compare\n+        :param date2: datetime obj. second date/time to compare\n+        :param max_uptime: int. max uptime in hours\n+        :return: bool. True if it has violated, False if not.\n+        \"\"\"\n+        diff = relativedelta(date1, date2)\n+        age_in_hours = abs((diff.days * 24) + diff.hours)\n+        if not age_in_hours > max_uptime:","path":"src/lib/do.py","position":26,"original_position":26,"commit_id":"9ce184b4a9d8084a7b1bf014fae9da86b351ef3a","original_commit_id":"9ce184b4a9d8084a7b1bf014fae9da86b351ef3a","user":{"login":"dimfeld","id":1369558,"avatar_url":"https://avatars.githubusercontent.com/u/1369558?v=3","gravatar_id":"","url":"https://api.github.com/users/dimfeld","html_url":"https://github.com/dimfeld","followers_url":"https://api.github.com/users/dimfeld/followers","following_url":"https://api.github.com/users/dimfeld/following{/other_user}","gists_url":"https://api.github.com/users/dimfeld/gists{/gist_id}","starred_url":"https://api.github.com/users/dimfeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimfeld/subscriptions","organizations_url":"https://api.github.com/users/dimfeld/orgs","repos_url":"https://api.github.com/users/dimfeld/repos","events_url":"https://api.github.com/users/dimfeld/events{/privacy}","received_events_url":"https://api.github.com/users/dimfeld/received_events","type":"User","site_admin":false},"body":"`if age_in_hours <= max_uptime`","created_at":"2015-05-16T02:52:03Z","updated_at":"2015-05-16T02:52:03Z","html_url":"https://github.com/wjimenez5271/coastguard/pull/6#discussion_r30457736","pull_request_url":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/comments/30457736"},"html":{"href":"https://github.com/wjimenez5271/coastguard/pull/6#discussion_r30457736"},"pull_request":{"href":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/6","id":35536885,"html_url":"https://github.com/wjimenez5271/coastguard/pull/6","diff_url":"https://github.com/wjimenez5271/coastguard/pull/6.diff","patch_url":"https://github.com/wjimenez5271/coastguard/pull/6.patch","issue_url":"https://api.github.com/repos/wjimenez5271/coastguard/issues/6","number":6,"state":"open","locked":false,"title":"some logging improvements and bug fixes","user":{"login":"wjimenez5271","id":322834,"avatar_url":"https://avatars.githubusercontent.com/u/322834?v=3","gravatar_id":"","url":"https://api.github.com/users/wjimenez5271","html_url":"https://github.com/wjimenez5271","followers_url":"https://api.github.com/users/wjimenez5271/followers","following_url":"https://api.github.com/users/wjimenez5271/following{/other_user}","gists_url":"https://api.github.com/users/wjimenez5271/gists{/gist_id}","starred_url":"https://api.github.com/users/wjimenez5271/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjimenez5271/subscriptions","organizations_url":"https://api.github.com/users/wjimenez5271/orgs","repos_url":"https://api.github.com/users/wjimenez5271/repos","events_url":"https://api.github.com/users/wjimenez5271/events{/privacy}","received_events_url":"https://api.github.com/users/wjimenez5271/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-15T18:11:06Z","updated_at":"2015-05-16T02:52:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65ba4ccfffa7757b8c52d14b271e42c024828011","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/6/commits","review_comments_url":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/6/comments","review_comment_url":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wjimenez5271/coastguard/issues/6/comments","statuses_url":"https://api.github.com/repos/wjimenez5271/coastguard/statuses/9ce184b4a9d8084a7b1bf014fae9da86b351ef3a","head":{"label":"wjimenez5271:wjimenez","ref":"wjimenez","sha":"9ce184b4a9d8084a7b1bf014fae9da86b351ef3a","user":{"login":"wjimenez5271","id":322834,"avatar_url":"https://avatars.githubusercontent.com/u/322834?v=3","gravatar_id":"","url":"https://api.github.com/users/wjimenez5271","html_url":"https://github.com/wjimenez5271","followers_url":"https://api.github.com/users/wjimenez5271/followers","following_url":"https://api.github.com/users/wjimenez5271/following{/other_user}","gists_url":"https://api.github.com/users/wjimenez5271/gists{/gist_id}","starred_url":"https://api.github.com/users/wjimenez5271/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjimenez5271/subscriptions","organizations_url":"https://api.github.com/users/wjimenez5271/orgs","repos_url":"https://api.github.com/users/wjimenez5271/repos","events_url":"https://api.github.com/users/wjimenez5271/events{/privacy}","received_events_url":"https://api.github.com/users/wjimenez5271/received_events","type":"User","site_admin":false},"repo":{"id":35299113,"name":"coastguard","full_name":"wjimenez5271/coastguard","owner":{"login":"wjimenez5271","id":322834,"avatar_url":"https://avatars.githubusercontent.com/u/322834?v=3","gravatar_id":"","url":"https://api.github.com/users/wjimenez5271","html_url":"https://github.com/wjimenez5271","followers_url":"https://api.github.com/users/wjimenez5271/followers","following_url":"https://api.github.com/users/wjimenez5271/following{/other_user}","gists_url":"https://api.github.com/users/wjimenez5271/gists{/gist_id}","starred_url":"https://api.github.com/users/wjimenez5271/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjimenez5271/subscriptions","organizations_url":"https://api.github.com/users/wjimenez5271/orgs","repos_url":"https://api.github.com/users/wjimenez5271/repos","events_url":"https://api.github.com/users/wjimenez5271/events{/privacy}","received_events_url":"https://api.github.com/users/wjimenez5271/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wjimenez5271/coastguard","description":"Enforce good behavior in DigitalOcean","fork":false,"url":"https://api.github.com/repos/wjimenez5271/coastguard","forks_url":"https://api.github.com/repos/wjimenez5271/coastguard/forks","keys_url":"https://api.github.com/repos/wjimenez5271/coastguard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wjimenez5271/coastguard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wjimenez5271/coastguard/teams","hooks_url":"https://api.github.com/repos/wjimenez5271/coastguard/hooks","issue_events_url":"https://api.github.com/repos/wjimenez5271/coastguard/issues/events{/number}","events_url":"https://api.github.com/repos/wjimenez5271/coastguard/events","assignees_url":"https://api.github.com/repos/wjimenez5271/coastguard/assignees{/user}","branches_url":"https://api.github.com/repos/wjimenez5271/coastguard/branches{/branch}","tags_url":"https://api.github.com/repos/wjimenez5271/coastguard/tags","blobs_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/refs{/sha}","trees_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wjimenez5271/coastguard/statuses/{sha}","languages_url":"https://api.github.com/repos/wjimenez5271/coastguard/languages","stargazers_url":"https://api.github.com/repos/wjimenez5271/coastguard/stargazers","contributors_url":"https://api.github.com/repos/wjimenez5271/coastguard/contributors","subscribers_url":"https://api.github.com/repos/wjimenez5271/coastguard/subscribers","subscription_url":"https://api.github.com/repos/wjimenez5271/coastguard/subscription","commits_url":"https://api.github.com/repos/wjimenez5271/coastguard/commits{/sha}","git_commits_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/commits{/sha}","comments_url":"https://api.github.com/repos/wjimenez5271/coastguard/comments{/number}","issue_comment_url":"https://api.github.com/repos/wjimenez5271/coastguard/issues/comments{/number}","contents_url":"https://api.github.com/repos/wjimenez5271/coastguard/contents/{+path}","compare_url":"https://api.github.com/repos/wjimenez5271/coastguard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wjimenez5271/coastguard/merges","archive_url":"https://api.github.com/repos/wjimenez5271/coastguard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wjimenez5271/coastguard/downloads","issues_url":"https://api.github.com/repos/wjimenez5271/coastguard/issues{/number}","pulls_url":"https://api.github.com/repos/wjimenez5271/coastguard/pulls{/number}","milestones_url":"https://api.github.com/repos/wjimenez5271/coastguard/milestones{/number}","notifications_url":"https://api.github.com/repos/wjimenez5271/coastguard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wjimenez5271/coastguard/labels{/name}","releases_url":"https://api.github.com/repos/wjimenez5271/coastguard/releases{/id}","created_at":"2015-05-08T19:59:34Z","updated_at":"2015-05-08T22:35:19Z","pushed_at":"2015-05-15T22:03:50Z","git_url":"git://github.com/wjimenez5271/coastguard.git","ssh_url":"git@github.com:wjimenez5271/coastguard.git","clone_url":"https://github.com/wjimenez5271/coastguard.git","svn_url":"https://github.com/wjimenez5271/coastguard","homepage":null,"size":261,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"wjimenez5271:master","ref":"master","sha":"606e3efa4674cce6fab0e7309126e4f719a0db3c","user":{"login":"wjimenez5271","id":322834,"avatar_url":"https://avatars.githubusercontent.com/u/322834?v=3","gravatar_id":"","url":"https://api.github.com/users/wjimenez5271","html_url":"https://github.com/wjimenez5271","followers_url":"https://api.github.com/users/wjimenez5271/followers","following_url":"https://api.github.com/users/wjimenez5271/following{/other_user}","gists_url":"https://api.github.com/users/wjimenez5271/gists{/gist_id}","starred_url":"https://api.github.com/users/wjimenez5271/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjimenez5271/subscriptions","organizations_url":"https://api.github.com/users/wjimenez5271/orgs","repos_url":"https://api.github.com/users/wjimenez5271/repos","events_url":"https://api.github.com/users/wjimenez5271/events{/privacy}","received_events_url":"https://api.github.com/users/wjimenez5271/received_events","type":"User","site_admin":false},"repo":{"id":35299113,"name":"coastguard","full_name":"wjimenez5271/coastguard","owner":{"login":"wjimenez5271","id":322834,"avatar_url":"https://avatars.githubusercontent.com/u/322834?v=3","gravatar_id":"","url":"https://api.github.com/users/wjimenez5271","html_url":"https://github.com/wjimenez5271","followers_url":"https://api.github.com/users/wjimenez5271/followers","following_url":"https://api.github.com/users/wjimenez5271/following{/other_user}","gists_url":"https://api.github.com/users/wjimenez5271/gists{/gist_id}","starred_url":"https://api.github.com/users/wjimenez5271/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjimenez5271/subscriptions","organizations_url":"https://api.github.com/users/wjimenez5271/orgs","repos_url":"https://api.github.com/users/wjimenez5271/repos","events_url":"https://api.github.com/users/wjimenez5271/events{/privacy}","received_events_url":"https://api.github.com/users/wjimenez5271/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wjimenez5271/coastguard","description":"Enforce good behavior in DigitalOcean","fork":false,"url":"https://api.github.com/repos/wjimenez5271/coastguard","forks_url":"https://api.github.com/repos/wjimenez5271/coastguard/forks","keys_url":"https://api.github.com/repos/wjimenez5271/coastguard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wjimenez5271/coastguard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wjimenez5271/coastguard/teams","hooks_url":"https://api.github.com/repos/wjimenez5271/coastguard/hooks","issue_events_url":"https://api.github.com/repos/wjimenez5271/coastguard/issues/events{/number}","events_url":"https://api.github.com/repos/wjimenez5271/coastguard/events","assignees_url":"https://api.github.com/repos/wjimenez5271/coastguard/assignees{/user}","branches_url":"https://api.github.com/repos/wjimenez5271/coastguard/branches{/branch}","tags_url":"https://api.github.com/repos/wjimenez5271/coastguard/tags","blobs_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/refs{/sha}","trees_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wjimenez5271/coastguard/statuses/{sha}","languages_url":"https://api.github.com/repos/wjimenez5271/coastguard/languages","stargazers_url":"https://api.github.com/repos/wjimenez5271/coastguard/stargazers","contributors_url":"https://api.github.com/repos/wjimenez5271/coastguard/contributors","subscribers_url":"https://api.github.com/repos/wjimenez5271/coastguard/subscribers","subscription_url":"https://api.github.com/repos/wjimenez5271/coastguard/subscription","commits_url":"https://api.github.com/repos/wjimenez5271/coastguard/commits{/sha}","git_commits_url":"https://api.github.com/repos/wjimenez5271/coastguard/git/commits{/sha}","comments_url":"https://api.github.com/repos/wjimenez5271/coastguard/comments{/number}","issue_comment_url":"https://api.github.com/repos/wjimenez5271/coastguard/issues/comments{/number}","contents_url":"https://api.github.com/repos/wjimenez5271/coastguard/contents/{+path}","compare_url":"https://api.github.com/repos/wjimenez5271/coastguard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wjimenez5271/coastguard/merges","archive_url":"https://api.github.com/repos/wjimenez5271/coastguard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wjimenez5271/coastguard/downloads","issues_url":"https://api.github.com/repos/wjimenez5271/coastguard/issues{/number}","pulls_url":"https://api.github.com/repos/wjimenez5271/coastguard/pulls{/number}","milestones_url":"https://api.github.com/repos/wjimenez5271/coastguard/milestones{/number}","notifications_url":"https://api.github.com/repos/wjimenez5271/coastguard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wjimenez5271/coastguard/labels{/name}","releases_url":"https://api.github.com/repos/wjimenez5271/coastguard/releases{/id}","created_at":"2015-05-08T19:59:34Z","updated_at":"2015-05-08T22:35:19Z","pushed_at":"2015-05-15T22:03:50Z","git_url":"git://github.com/wjimenez5271/coastguard.git","ssh_url":"git@github.com:wjimenez5271/coastguard.git","clone_url":"https://github.com/wjimenez5271/coastguard.git","svn_url":"https://github.com/wjimenez5271/coastguard","homepage":null,"size":261,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/6"},"html":{"href":"https://github.com/wjimenez5271/coastguard/pull/6"},"issue":{"href":"https://api.github.com/repos/wjimenez5271/coastguard/issues/6"},"comments":{"href":"https://api.github.com/repos/wjimenez5271/coastguard/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wjimenez5271/coastguard/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/wjimenez5271/coastguard/statuses/9ce184b4a9d8084a7b1bf014fae9da86b351ef3a"}}}}