{"action":"created","comment":{"url":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/comments/183227257","pull_request_review_id":114191398,"id":183227257,"diff_hunk":"@@ -22,20 +22,35 @@ def __init__(self, config_file=None):\n         if self.file is not None:\n             self.load()\n \n+    @property\n+    def has_defaults(self) -> bool:\n+        \"\"\"True if the default section is non-empty\"\"\"\n+        return len(self.items(self.default_section)) > 0\n+\n     @property\n     def is_initialised(self) -> bool:\n         \"\"\"True if there is at least one section\"\"\"\n-        return (len(self.sections()) > 0)\n+        return (len(self.sections()) > 0) or self.has_defaults\n \n     def load(self):\n         self.read_file(self.file)\n+        # For backwards compatibility, we check if they have a default\n+        # section instead of a defaults section and do a little switcheroo as\n+        # needed.\n+        if self.has_section('default') and not self.has_defaults:\n+            print(\"It looks like you're using a the deprecated 'default' \"\n+                  \"section.\\nConsider renaming the section to 'defaults'.\")\n+            self.default_section = 'default'","path":"onelogin_aws_cli/configuration.py","position":23,"original_position":23,"commit_id":"10826cd2208a39ca42fd0659cc50f10ba25c31ff","original_commit_id":"39db094a881ae67078d88e4897ae838b817da755","user":{"login":"slycoder","id":524989,"avatar_url":"https://avatars0.githubusercontent.com/u/524989?v=4","gravatar_id":"","url":"https://api.github.com/users/slycoder","html_url":"https://github.com/slycoder","followers_url":"https://api.github.com/users/slycoder/followers","following_url":"https://api.github.com/users/slycoder/following{/other_user}","gists_url":"https://api.github.com/users/slycoder/gists{/gist_id}","starred_url":"https://api.github.com/users/slycoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slycoder/subscriptions","organizations_url":"https://api.github.com/users/slycoder/orgs","repos_url":"https://api.github.com/users/slycoder/repos","events_url":"https://api.github.com/users/slycoder/events{/privacy}","received_events_url":"https://api.github.com/users/slycoder/received_events","type":"User","site_admin":false},"body":"Sounds good, thanks. I'll pull the default swizzling into a separate PR and we can discuss there.","created_at":"2018-04-22T06:50:41Z","updated_at":"2018-04-22T06:50:41Z","html_url":"https://github.com/physera/onelogin-aws-cli/pull/88#discussion_r183227257","pull_request_url":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/88","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/comments/183227257"},"html":{"href":"https://github.com/physera/onelogin-aws-cli/pull/88#discussion_r183227257"},"pull_request":{"href":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/88"}},"in_reply_to_id":183226980},"pull_request":{"url":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/88","id":182679794,"html_url":"https://github.com/physera/onelogin-aws-cli/pull/88","diff_url":"https://github.com/physera/onelogin-aws-cli/pull/88.diff","patch_url":"https://github.com/physera/onelogin-aws-cli/pull/88.patch","issue_url":"https://api.github.com/repos/physera/onelogin-aws-cli/issues/88","number":88,"state":"open","locked":false,"title":"Support default in addition to defaults","user":{"login":"slycoder","id":524989,"avatar_url":"https://avatars0.githubusercontent.com/u/524989?v=4","gravatar_id":"","url":"https://api.github.com/users/slycoder","html_url":"https://github.com/slycoder","followers_url":"https://api.github.com/users/slycoder/followers","following_url":"https://api.github.com/users/slycoder/following{/other_user}","gists_url":"https://api.github.com/users/slycoder/gists{/gist_id}","starred_url":"https://api.github.com/users/slycoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slycoder/subscriptions","organizations_url":"https://api.github.com/users/slycoder/orgs","repos_url":"https://api.github.com/users/slycoder/repos","events_url":"https://api.github.com/users/slycoder/events{/privacy}","received_events_url":"https://api.github.com/users/slycoder/received_events","type":"User","site_admin":false},"body":"* initialize should write to the default_section.\r\n* handle the case where initialize is called without a section.\r\n* handle legacy config files with default instead of defaults.\r\n* handle config files without a profile section aside from the defaults.","created_at":"2018-04-19T06:42:34Z","updated_at":"2018-04-22T06:50:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8eb702930ef3c681d28df4870fc745da0ddfc06","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/88/commits","review_comments_url":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/88/comments","review_comment_url":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/physera/onelogin-aws-cli/issues/88/comments","statuses_url":"https://api.github.com/repos/physera/onelogin-aws-cli/statuses/10826cd2208a39ca42fd0659cc50f10ba25c31ff","head":{"label":"physera:better-handling-of-defaults","ref":"better-handling-of-defaults","sha":"10826cd2208a39ca42fd0659cc50f10ba25c31ff","user":{"login":"physera","id":20317028,"avatar_url":"https://avatars0.githubusercontent.com/u/20317028?v=4","gravatar_id":"","url":"https://api.github.com/users/physera","html_url":"https://github.com/physera","followers_url":"https://api.github.com/users/physera/followers","following_url":"https://api.github.com/users/physera/following{/other_user}","gists_url":"https://api.github.com/users/physera/gists{/gist_id}","starred_url":"https://api.github.com/users/physera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/physera/subscriptions","organizations_url":"https://api.github.com/users/physera/orgs","repos_url":"https://api.github.com/users/physera/repos","events_url":"https://api.github.com/users/physera/events{/privacy}","received_events_url":"https://api.github.com/users/physera/received_events","type":"Organization","site_admin":false},"repo":{"id":85412987,"name":"onelogin-aws-cli","full_name":"physera/onelogin-aws-cli","owner":{"login":"physera","id":20317028,"avatar_url":"https://avatars0.githubusercontent.com/u/20317028?v=4","gravatar_id":"","url":"https://api.github.com/users/physera","html_url":"https://github.com/physera","followers_url":"https://api.github.com/users/physera/followers","following_url":"https://api.github.com/users/physera/following{/other_user}","gists_url":"https://api.github.com/users/physera/gists{/gist_id}","starred_url":"https://api.github.com/users/physera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/physera/subscriptions","organizations_url":"https://api.github.com/users/physera/orgs","repos_url":"https://api.github.com/users/physera/repos","events_url":"https://api.github.com/users/physera/events{/privacy}","received_events_url":"https://api.github.com/users/physera/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/physera/onelogin-aws-cli","description":"Assume an AWS Role and cache credentials using Onelogin","fork":false,"url":"https://api.github.com/repos/physera/onelogin-aws-cli","forks_url":"https://api.github.com/repos/physera/onelogin-aws-cli/forks","keys_url":"https://api.github.com/repos/physera/onelogin-aws-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/physera/onelogin-aws-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/physera/onelogin-aws-cli/teams","hooks_url":"https://api.github.com/repos/physera/onelogin-aws-cli/hooks","issue_events_url":"https://api.github.com/repos/physera/onelogin-aws-cli/issues/events{/number}","events_url":"https://api.github.com/repos/physera/onelogin-aws-cli/events","assignees_url":"https://api.github.com/repos/physera/onelogin-aws-cli/assignees{/user}","branches_url":"https://api.github.com/repos/physera/onelogin-aws-cli/branches{/branch}","tags_url":"https://api.github.com/repos/physera/onelogin-aws-cli/tags","blobs_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/physera/onelogin-aws-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/physera/onelogin-aws-cli/languages","stargazers_url":"https://api.github.com/repos/physera/onelogin-aws-cli/stargazers","contributors_url":"https://api.github.com/repos/physera/onelogin-aws-cli/contributors","subscribers_url":"https://api.github.com/repos/physera/onelogin-aws-cli/subscribers","subscription_url":"https://api.github.com/repos/physera/onelogin-aws-cli/subscription","commits_url":"https://api.github.com/repos/physera/onelogin-aws-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/physera/onelogin-aws-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/physera/onelogin-aws-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/physera/onelogin-aws-cli/contents/{+path}","compare_url":"https://api.github.com/repos/physera/onelogin-aws-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/physera/onelogin-aws-cli/merges","archive_url":"https://api.github.com/repos/physera/onelogin-aws-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/physera/onelogin-aws-cli/downloads","issues_url":"https://api.github.com/repos/physera/onelogin-aws-cli/issues{/number}","pulls_url":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/physera/onelogin-aws-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/physera/onelogin-aws-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/physera/onelogin-aws-cli/labels{/name}","releases_url":"https://api.github.com/repos/physera/onelogin-aws-cli/releases{/id}","deployments_url":"https://api.github.com/repos/physera/onelogin-aws-cli/deployments","created_at":"2017-03-18T15:48:33Z","updated_at":"2018-04-21T21:42:48Z","pushed_at":"2018-04-22T06:45:41Z","git_url":"git://github.com/physera/onelogin-aws-cli.git","ssh_url":"git@github.com:physera/onelogin-aws-cli.git","clone_url":"https://github.com/physera/onelogin-aws-cli.git","svn_url":"https://github.com/physera/onelogin-aws-cli","homepage":null,"size":95,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":10,"open_issues":9,"watchers":14,"default_branch":"master"}},"base":{"label":"physera:master","ref":"master","sha":"8ac94df3e0991b8bef828f76a96451cb218ff410","user":{"login":"physera","id":20317028,"avatar_url":"https://avatars0.githubusercontent.com/u/20317028?v=4","gravatar_id":"","url":"https://api.github.com/users/physera","html_url":"https://github.com/physera","followers_url":"https://api.github.com/users/physera/followers","following_url":"https://api.github.com/users/physera/following{/other_user}","gists_url":"https://api.github.com/users/physera/gists{/gist_id}","starred_url":"https://api.github.com/users/physera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/physera/subscriptions","organizations_url":"https://api.github.com/users/physera/orgs","repos_url":"https://api.github.com/users/physera/repos","events_url":"https://api.github.com/users/physera/events{/privacy}","received_events_url":"https://api.github.com/users/physera/received_events","type":"Organization","site_admin":false},"repo":{"id":85412987,"name":"onelogin-aws-cli","full_name":"physera/onelogin-aws-cli","owner":{"login":"physera","id":20317028,"avatar_url":"https://avatars0.githubusercontent.com/u/20317028?v=4","gravatar_id":"","url":"https://api.github.com/users/physera","html_url":"https://github.com/physera","followers_url":"https://api.github.com/users/physera/followers","following_url":"https://api.github.com/users/physera/following{/other_user}","gists_url":"https://api.github.com/users/physera/gists{/gist_id}","starred_url":"https://api.github.com/users/physera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/physera/subscriptions","organizations_url":"https://api.github.com/users/physera/orgs","repos_url":"https://api.github.com/users/physera/repos","events_url":"https://api.github.com/users/physera/events{/privacy}","received_events_url":"https://api.github.com/users/physera/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/physera/onelogin-aws-cli","description":"Assume an AWS Role and cache credentials using Onelogin","fork":false,"url":"https://api.github.com/repos/physera/onelogin-aws-cli","forks_url":"https://api.github.com/repos/physera/onelogin-aws-cli/forks","keys_url":"https://api.github.com/repos/physera/onelogin-aws-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/physera/onelogin-aws-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/physera/onelogin-aws-cli/teams","hooks_url":"https://api.github.com/repos/physera/onelogin-aws-cli/hooks","issue_events_url":"https://api.github.com/repos/physera/onelogin-aws-cli/issues/events{/number}","events_url":"https://api.github.com/repos/physera/onelogin-aws-cli/events","assignees_url":"https://api.github.com/repos/physera/onelogin-aws-cli/assignees{/user}","branches_url":"https://api.github.com/repos/physera/onelogin-aws-cli/branches{/branch}","tags_url":"https://api.github.com/repos/physera/onelogin-aws-cli/tags","blobs_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/physera/onelogin-aws-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/physera/onelogin-aws-cli/languages","stargazers_url":"https://api.github.com/repos/physera/onelogin-aws-cli/stargazers","contributors_url":"https://api.github.com/repos/physera/onelogin-aws-cli/contributors","subscribers_url":"https://api.github.com/repos/physera/onelogin-aws-cli/subscribers","subscription_url":"https://api.github.com/repos/physera/onelogin-aws-cli/subscription","commits_url":"https://api.github.com/repos/physera/onelogin-aws-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/physera/onelogin-aws-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/physera/onelogin-aws-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/physera/onelogin-aws-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/physera/onelogin-aws-cli/contents/{+path}","compare_url":"https://api.github.com/repos/physera/onelogin-aws-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/physera/onelogin-aws-cli/merges","archive_url":"https://api.github.com/repos/physera/onelogin-aws-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/physera/onelogin-aws-cli/downloads","issues_url":"https://api.github.com/repos/physera/onelogin-aws-cli/issues{/number}","pulls_url":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/physera/onelogin-aws-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/physera/onelogin-aws-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/physera/onelogin-aws-cli/labels{/name}","releases_url":"https://api.github.com/repos/physera/onelogin-aws-cli/releases{/id}","deployments_url":"https://api.github.com/repos/physera/onelogin-aws-cli/deployments","created_at":"2017-03-18T15:48:33Z","updated_at":"2018-04-21T21:42:48Z","pushed_at":"2018-04-22T06:45:41Z","git_url":"git://github.com/physera/onelogin-aws-cli.git","ssh_url":"git@github.com:physera/onelogin-aws-cli.git","clone_url":"https://github.com/physera/onelogin-aws-cli.git","svn_url":"https://github.com/physera/onelogin-aws-cli","homepage":null,"size":95,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":10,"open_issues":9,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/88"},"html":{"href":"https://github.com/physera/onelogin-aws-cli/pull/88"},"issue":{"href":"https://api.github.com/repos/physera/onelogin-aws-cli/issues/88"},"comments":{"href":"https://api.github.com/repos/physera/onelogin-aws-cli/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/physera/onelogin-aws-cli/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/physera/onelogin-aws-cli/statuses/10826cd2208a39ca42fd0659cc50f10ba25c31ff"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"slycoder"}}