{"action":"created","comment":{"url":"https://api.github.com/repos/neutralio/pynio/pulls/comments/24948726","id":24948726,"diff_hunk":"@@ -12,14 +17,25 @@ def __init__(self, host='127.0.0.1', port=8181, creds=None):\n         self._creds = creds or ('User', 'User')\n         self._url = 'http://{}:{}/{}'.format(host, port, '{}')\n \n-    def _get(self, endpoint, timeout=None, data=None):\n+    def _get(self, endpoint, timeout=None, data=None, retry=0):\n+        '''Performs a get with some amounts of retrys'''\n         if data is not None:\n             data = json.dumps(data)\n-        r = requests.get(self._url.format(endpoint),\n-                         auth=self._creds,\n-                         timeout=timeout,\n-                         data=data)\n-        r.raise_for_status()\n+        for i in range(retry + 1):\n+            try:\n+                r = requests.get(self._url.format(endpoint),\n+                                 auth=self._creds,\n+                                 timeout=timeout,\n+                                 data=data)\n+                r.raise_for_status()\n+                break\n+            except requests.exceptions.ConnectionError as e:\n+                log.warning(\"Failure connecting in _get\")\n+                E = e\n+                if i < retry:\n+                    time.sleep(1)\n+        else:","path":"pynio/rest.py","position":39,"original_position":39,"commit_id":"84c170cc500386ace188b7f5b745dbdd58ca2a52","original_commit_id":"84c170cc500386ace188b7f5b745dbdd58ca2a52","user":{"login":"hansmosh","id":5524215,"avatar_url":"https://avatars.githubusercontent.com/u/5524215?v=3","gravatar_id":"","url":"https://api.github.com/users/hansmosh","html_url":"https://github.com/hansmosh","followers_url":"https://api.github.com/users/hansmosh/followers","following_url":"https://api.github.com/users/hansmosh/following{/other_user}","gists_url":"https://api.github.com/users/hansmosh/gists{/gist_id}","starred_url":"https://api.github.com/users/hansmosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansmosh/subscriptions","organizations_url":"https://api.github.com/users/hansmosh/orgs","repos_url":"https://api.github.com/users/hansmosh/repos","events_url":"https://api.github.com/users/hansmosh/events{/privacy}","received_events_url":"https://api.github.com/users/hansmosh/received_events","type":"User","site_admin":false},"body":"I'm surprised this 'else' even works. It seems like it's just floating around here, not paired with any 'if'.","created_at":"2015-02-18T22:42:49Z","updated_at":"2015-02-18T22:42:49Z","html_url":"https://github.com/neutralio/pynio/pull/15#discussion_r24948726","pull_request_url":"https://api.github.com/repos/neutralio/pynio/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/comments/24948726"},"html":{"href":"https://github.com/neutralio/pynio/pull/15#discussion_r24948726"},"pull_request":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/neutralio/pynio/pulls/15","id":29561113,"html_url":"https://github.com/neutralio/pynio/pull/15","diff_url":"https://github.com/neutralio/pynio/pull/15.diff","patch_url":"https://github.com/neutralio/pynio/pull/15.patch","issue_url":"https://api.github.com/repos/neutralio/pynio/issues/15","number":15,"state":"open","locked":false,"title":"retry for _get","user":{"login":"cloudformdesign","id":5587659,"avatar_url":"https://avatars.githubusercontent.com/u/5587659?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudformdesign","html_url":"https://github.com/cloudformdesign","followers_url":"https://api.github.com/users/cloudformdesign/followers","following_url":"https://api.github.com/users/cloudformdesign/following{/other_user}","gists_url":"https://api.github.com/users/cloudformdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudformdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudformdesign/subscriptions","organizations_url":"https://api.github.com/users/cloudformdesign/orgs","repos_url":"https://api.github.com/users/cloudformdesign/repos","events_url":"https://api.github.com/users/cloudformdesign/events{/privacy}","received_events_url":"https://api.github.com/users/cloudformdesign/received_events","type":"User","site_admin":false},"body":"In case you are curious, [vim-futigive](https://github.com/tpope/vim-fugitive) makes the process of selecting specific lines from commits very easy. You just open a file and do `:Gdiff BRANCH` and it opens a vim diff with the two branches. You then use `do` and `dp` to move data between the two branches.","created_at":"2015-02-18T20:42:12Z","updated_at":"2015-02-18T22:42:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63845832e9f5b9d80b6b20266b5a8ff9d8f7cb00","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neutralio/pynio/pulls/15/commits","review_comments_url":"https://api.github.com/repos/neutralio/pynio/pulls/15/comments","review_comment_url":"https://api.github.com/repos/neutralio/pynio/pulls/comments/{number}","comments_url":"https://api.github.com/repos/neutralio/pynio/issues/15/comments","statuses_url":"https://api.github.com/repos/neutralio/pynio/statuses/84c170cc500386ace188b7f5b745dbdd58ca2a52","head":{"label":"neutralio:f/retry","ref":"f/retry","sha":"84c170cc500386ace188b7f5b745dbdd58ca2a52","user":{"login":"neutralio","id":4392245,"avatar_url":"https://avatars.githubusercontent.com/u/4392245?v=3","gravatar_id":"","url":"https://api.github.com/users/neutralio","html_url":"https://github.com/neutralio","followers_url":"https://api.github.com/users/neutralio/followers","following_url":"https://api.github.com/users/neutralio/following{/other_user}","gists_url":"https://api.github.com/users/neutralio/gists{/gist_id}","starred_url":"https://api.github.com/users/neutralio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutralio/subscriptions","organizations_url":"https://api.github.com/users/neutralio/orgs","repos_url":"https://api.github.com/users/neutralio/repos","events_url":"https://api.github.com/users/neutralio/events{/privacy}","received_events_url":"https://api.github.com/users/neutralio/received_events","type":"Organization","site_admin":false},"repo":{"id":30577837,"name":"pynio","full_name":"neutralio/pynio","owner":{"login":"neutralio","id":4392245,"avatar_url":"https://avatars.githubusercontent.com/u/4392245?v=3","gravatar_id":"","url":"https://api.github.com/users/neutralio","html_url":"https://github.com/neutralio","followers_url":"https://api.github.com/users/neutralio/followers","following_url":"https://api.github.com/users/neutralio/following{/other_user}","gists_url":"https://api.github.com/users/neutralio/gists{/gist_id}","starred_url":"https://api.github.com/users/neutralio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutralio/subscriptions","organizations_url":"https://api.github.com/users/neutralio/orgs","repos_url":"https://api.github.com/users/neutralio/repos","events_url":"https://api.github.com/users/neutralio/events{/privacy}","received_events_url":"https://api.github.com/users/neutralio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neutralio/pynio","description":"A Python module for communicating with the nio REST API.","fork":false,"url":"https://api.github.com/repos/neutralio/pynio","forks_url":"https://api.github.com/repos/neutralio/pynio/forks","keys_url":"https://api.github.com/repos/neutralio/pynio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neutralio/pynio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neutralio/pynio/teams","hooks_url":"https://api.github.com/repos/neutralio/pynio/hooks","issue_events_url":"https://api.github.com/repos/neutralio/pynio/issues/events{/number}","events_url":"https://api.github.com/repos/neutralio/pynio/events","assignees_url":"https://api.github.com/repos/neutralio/pynio/assignees{/user}","branches_url":"https://api.github.com/repos/neutralio/pynio/branches{/branch}","tags_url":"https://api.github.com/repos/neutralio/pynio/tags","blobs_url":"https://api.github.com/repos/neutralio/pynio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neutralio/pynio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neutralio/pynio/git/refs{/sha}","trees_url":"https://api.github.com/repos/neutralio/pynio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neutralio/pynio/statuses/{sha}","languages_url":"https://api.github.com/repos/neutralio/pynio/languages","stargazers_url":"https://api.github.com/repos/neutralio/pynio/stargazers","contributors_url":"https://api.github.com/repos/neutralio/pynio/contributors","subscribers_url":"https://api.github.com/repos/neutralio/pynio/subscribers","subscription_url":"https://api.github.com/repos/neutralio/pynio/subscription","commits_url":"https://api.github.com/repos/neutralio/pynio/commits{/sha}","git_commits_url":"https://api.github.com/repos/neutralio/pynio/git/commits{/sha}","comments_url":"https://api.github.com/repos/neutralio/pynio/comments{/number}","issue_comment_url":"https://api.github.com/repos/neutralio/pynio/issues/comments/{number}","contents_url":"https://api.github.com/repos/neutralio/pynio/contents/{+path}","compare_url":"https://api.github.com/repos/neutralio/pynio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neutralio/pynio/merges","archive_url":"https://api.github.com/repos/neutralio/pynio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neutralio/pynio/downloads","issues_url":"https://api.github.com/repos/neutralio/pynio/issues{/number}","pulls_url":"https://api.github.com/repos/neutralio/pynio/pulls{/number}","milestones_url":"https://api.github.com/repos/neutralio/pynio/milestones{/number}","notifications_url":"https://api.github.com/repos/neutralio/pynio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neutralio/pynio/labels{/name}","releases_url":"https://api.github.com/repos/neutralio/pynio/releases{/id}","created_at":"2015-02-10T06:09:08Z","updated_at":"2015-02-18T20:30:46Z","pushed_at":"2015-02-18T22:18:30Z","git_url":"git://github.com/neutralio/pynio.git","ssh_url":"git@github.com:neutralio/pynio.git","clone_url":"https://github.com/neutralio/pynio.git","svn_url":"https://github.com/neutralio/pynio","homepage":null,"size":918,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"neutralio:master","ref":"master","sha":"128e6e336dcb34d64c7fea91119ac73fd7fc2d55","user":{"login":"neutralio","id":4392245,"avatar_url":"https://avatars.githubusercontent.com/u/4392245?v=3","gravatar_id":"","url":"https://api.github.com/users/neutralio","html_url":"https://github.com/neutralio","followers_url":"https://api.github.com/users/neutralio/followers","following_url":"https://api.github.com/users/neutralio/following{/other_user}","gists_url":"https://api.github.com/users/neutralio/gists{/gist_id}","starred_url":"https://api.github.com/users/neutralio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutralio/subscriptions","organizations_url":"https://api.github.com/users/neutralio/orgs","repos_url":"https://api.github.com/users/neutralio/repos","events_url":"https://api.github.com/users/neutralio/events{/privacy}","received_events_url":"https://api.github.com/users/neutralio/received_events","type":"Organization","site_admin":false},"repo":{"id":30577837,"name":"pynio","full_name":"neutralio/pynio","owner":{"login":"neutralio","id":4392245,"avatar_url":"https://avatars.githubusercontent.com/u/4392245?v=3","gravatar_id":"","url":"https://api.github.com/users/neutralio","html_url":"https://github.com/neutralio","followers_url":"https://api.github.com/users/neutralio/followers","following_url":"https://api.github.com/users/neutralio/following{/other_user}","gists_url":"https://api.github.com/users/neutralio/gists{/gist_id}","starred_url":"https://api.github.com/users/neutralio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutralio/subscriptions","organizations_url":"https://api.github.com/users/neutralio/orgs","repos_url":"https://api.github.com/users/neutralio/repos","events_url":"https://api.github.com/users/neutralio/events{/privacy}","received_events_url":"https://api.github.com/users/neutralio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neutralio/pynio","description":"A Python module for communicating with the nio REST API.","fork":false,"url":"https://api.github.com/repos/neutralio/pynio","forks_url":"https://api.github.com/repos/neutralio/pynio/forks","keys_url":"https://api.github.com/repos/neutralio/pynio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neutralio/pynio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neutralio/pynio/teams","hooks_url":"https://api.github.com/repos/neutralio/pynio/hooks","issue_events_url":"https://api.github.com/repos/neutralio/pynio/issues/events{/number}","events_url":"https://api.github.com/repos/neutralio/pynio/events","assignees_url":"https://api.github.com/repos/neutralio/pynio/assignees{/user}","branches_url":"https://api.github.com/repos/neutralio/pynio/branches{/branch}","tags_url":"https://api.github.com/repos/neutralio/pynio/tags","blobs_url":"https://api.github.com/repos/neutralio/pynio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neutralio/pynio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neutralio/pynio/git/refs{/sha}","trees_url":"https://api.github.com/repos/neutralio/pynio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neutralio/pynio/statuses/{sha}","languages_url":"https://api.github.com/repos/neutralio/pynio/languages","stargazers_url":"https://api.github.com/repos/neutralio/pynio/stargazers","contributors_url":"https://api.github.com/repos/neutralio/pynio/contributors","subscribers_url":"https://api.github.com/repos/neutralio/pynio/subscribers","subscription_url":"https://api.github.com/repos/neutralio/pynio/subscription","commits_url":"https://api.github.com/repos/neutralio/pynio/commits{/sha}","git_commits_url":"https://api.github.com/repos/neutralio/pynio/git/commits{/sha}","comments_url":"https://api.github.com/repos/neutralio/pynio/comments{/number}","issue_comment_url":"https://api.github.com/repos/neutralio/pynio/issues/comments/{number}","contents_url":"https://api.github.com/repos/neutralio/pynio/contents/{+path}","compare_url":"https://api.github.com/repos/neutralio/pynio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neutralio/pynio/merges","archive_url":"https://api.github.com/repos/neutralio/pynio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neutralio/pynio/downloads","issues_url":"https://api.github.com/repos/neutralio/pynio/issues{/number}","pulls_url":"https://api.github.com/repos/neutralio/pynio/pulls{/number}","milestones_url":"https://api.github.com/repos/neutralio/pynio/milestones{/number}","notifications_url":"https://api.github.com/repos/neutralio/pynio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neutralio/pynio/labels{/name}","releases_url":"https://api.github.com/repos/neutralio/pynio/releases{/id}","created_at":"2015-02-10T06:09:08Z","updated_at":"2015-02-18T20:30:46Z","pushed_at":"2015-02-18T22:18:30Z","git_url":"git://github.com/neutralio/pynio.git","ssh_url":"git@github.com:neutralio/pynio.git","clone_url":"https://github.com/neutralio/pynio.git","svn_url":"https://github.com/neutralio/pynio","homepage":null,"size":918,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/15"},"html":{"href":"https://github.com/neutralio/pynio/pull/15"},"issue":{"href":"https://api.github.com/repos/neutralio/pynio/issues/15"},"comments":{"href":"https://api.github.com/repos/neutralio/pynio/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/neutralio/pynio/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/neutralio/pynio/statuses/84c170cc500386ace188b7f5b745dbdd58ca2a52"}}}}