{"action":"created","comment":{"url":"https://api.github.com/repos/brantlk/keystone_performance/pulls/comments/72672542","id":72672542,"diff_hunk":"@@ -304,6 +314,73 @@ def notify_done(self):\n         self._done = True\n \n \n+class UserInfo(object):\n+    def __init__(self, args):\n+        auth_url = '%s/v3/auth/tokens' % args.url\n+\n+        if args.user_domain_id:\n+            user_domain_info = {'id': args.user_domain_id}\n+        else:\n+            user_domain_info = {'name': args.user_domain_name}\n+        if args.project_id:\n+            project_info = {'id': args.project_id}\n+        else:\n+            project_info = {'name': args.project_name}\n+        if args.project_domain_id:\n+            project_info['domain'] = {'id': args.project_domain_id}\n+        else:\n+            project_info['domain'] = {'name': args.project_domain_name}\n+        auth_req_body = {\n+            'auth': {\n+                'identity': {\n+                    'methods': ['password'],\n+                    'password': {\n+                        'user': {\n+                            'name': args.username,\n+                            'domain': user_domain_info,\n+                            'password': args.password\n+                        }\n+                    }\n+                },\n+                'scope': {\n+                    'project': project_info\n+                }\n+            }\n+        }\n+\n+        headers = {'content-type': 'application/json'}\n+        r = requests.post(auth_url, json=auth_req_body, headers=headers)\n+        if r.status_code != 201:\n+            raise Exception('Error: Failed to get keystone token for getting user info. Status code: ' + str(r.status_code))\n+        token = r.headers['x-subject-token']\n+\n+        domains_url = '%s/v3/domains?name=default' % args.url\n+        headers = {'X-Auth-Token': token}\n+        r = requests.get(domains_url, headers=headers)\n+        if r.status_code != 200:\n+            raise Exception('Error: Failed to get user list. Status code: ' + str(r.status_code))\n+        domain_id = json.loads(r.content)['domains']['id']","path":"keystone_performance/load_test.py","position":149,"original_position":149,"commit_id":"752f08037a73926e9d65238236b33726b965da8e","original_commit_id":"752f08037a73926e9d65238236b33726b965da8e","user":{"login":"brantlk","id":11064524,"avatar_url":"https://avatars.githubusercontent.com/u/11064524?v=3","gravatar_id":"","url":"https://api.github.com/users/brantlk","html_url":"https://github.com/brantlk","followers_url":"https://api.github.com/users/brantlk/followers","following_url":"https://api.github.com/users/brantlk/following{/other_user}","gists_url":"https://api.github.com/users/brantlk/gists{/gist_id}","starred_url":"https://api.github.com/users/brantlk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantlk/subscriptions","organizations_url":"https://api.github.com/users/brantlk/orgs","repos_url":"https://api.github.com/users/brantlk/repos","events_url":"https://api.github.com/users/brantlk/events{/privacy}","received_events_url":"https://api.github.com/users/brantlk/received_events","type":"User","site_admin":false},"body":"use r.json() -- see http://docs.python-requests.org/en/master/user/quickstart/#json-response-content","created_at":"2016-07-28T18:10:50Z","updated_at":"2016-07-28T18:10:50Z","html_url":"https://github.com/brantlk/keystone_performance/pull/2#discussion_r72672542","pull_request_url":"https://api.github.com/repos/brantlk/keystone_performance/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/brantlk/keystone_performance/pulls/comments/72672542"},"html":{"href":"https://github.com/brantlk/keystone_performance/pull/2#discussion_r72672542"},"pull_request":{"href":"https://api.github.com/repos/brantlk/keystone_performance/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/brantlk/keystone_performance/pulls/2","id":79216168,"html_url":"https://github.com/brantlk/keystone_performance/pull/2","diff_url":"https://github.com/brantlk/keystone_performance/pull/2.diff","patch_url":"https://github.com/brantlk/keystone_performance/pull/2.patch","issue_url":"https://api.github.com/repos/brantlk/keystone_performance/issues/2","number":2,"state":"open","locked":false,"title":"Issue-201: Made changes to have a random user for the token authentic…","user":{"login":"Serras101","id":5199015,"avatar_url":"https://avatars.githubusercontent.com/u/5199015?v=3","gravatar_id":"","url":"https://api.github.com/users/Serras101","html_url":"https://github.com/Serras101","followers_url":"https://api.github.com/users/Serras101/followers","following_url":"https://api.github.com/users/Serras101/following{/other_user}","gists_url":"https://api.github.com/users/Serras101/gists{/gist_id}","starred_url":"https://api.github.com/users/Serras101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Serras101/subscriptions","organizations_url":"https://api.github.com/users/Serras101/orgs","repos_url":"https://api.github.com/users/Serras101/repos","events_url":"https://api.github.com/users/Serras101/events{/privacy}","received_events_url":"https://api.github.com/users/Serras101/received_events","type":"User","site_admin":false},"body":"…ation.","created_at":"2016-07-28T15:24:16Z","updated_at":"2016-07-28T18:10:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4baca092de7b429c0bfe70cbd067de0e13e18fcc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/brantlk/keystone_performance/pulls/2/commits","review_comments_url":"https://api.github.com/repos/brantlk/keystone_performance/pulls/2/comments","review_comment_url":"https://api.github.com/repos/brantlk/keystone_performance/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brantlk/keystone_performance/issues/2/comments","statuses_url":"https://api.github.com/repos/brantlk/keystone_performance/statuses/752f08037a73926e9d65238236b33726b965da8e","head":{"label":"Serras101:Issue-201","ref":"Issue-201","sha":"752f08037a73926e9d65238236b33726b965da8e","user":{"login":"Serras101","id":5199015,"avatar_url":"https://avatars.githubusercontent.com/u/5199015?v=3","gravatar_id":"","url":"https://api.github.com/users/Serras101","html_url":"https://github.com/Serras101","followers_url":"https://api.github.com/users/Serras101/followers","following_url":"https://api.github.com/users/Serras101/following{/other_user}","gists_url":"https://api.github.com/users/Serras101/gists{/gist_id}","starred_url":"https://api.github.com/users/Serras101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Serras101/subscriptions","organizations_url":"https://api.github.com/users/Serras101/orgs","repos_url":"https://api.github.com/users/Serras101/repos","events_url":"https://api.github.com/users/Serras101/events{/privacy}","received_events_url":"https://api.github.com/users/Serras101/received_events","type":"User","site_admin":false},"repo":{"id":63719408,"name":"keystone_performance","full_name":"Serras101/keystone_performance","owner":{"login":"Serras101","id":5199015,"avatar_url":"https://avatars.githubusercontent.com/u/5199015?v=3","gravatar_id":"","url":"https://api.github.com/users/Serras101","html_url":"https://github.com/Serras101","followers_url":"https://api.github.com/users/Serras101/followers","following_url":"https://api.github.com/users/Serras101/following{/other_user}","gists_url":"https://api.github.com/users/Serras101/gists{/gist_id}","starred_url":"https://api.github.com/users/Serras101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Serras101/subscriptions","organizations_url":"https://api.github.com/users/Serras101/orgs","repos_url":"https://api.github.com/users/Serras101/repos","events_url":"https://api.github.com/users/Serras101/events{/privacy}","received_events_url":"https://api.github.com/users/Serras101/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Serras101/keystone_performance","description":null,"fork":true,"url":"https://api.github.com/repos/Serras101/keystone_performance","forks_url":"https://api.github.com/repos/Serras101/keystone_performance/forks","keys_url":"https://api.github.com/repos/Serras101/keystone_performance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Serras101/keystone_performance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Serras101/keystone_performance/teams","hooks_url":"https://api.github.com/repos/Serras101/keystone_performance/hooks","issue_events_url":"https://api.github.com/repos/Serras101/keystone_performance/issues/events{/number}","events_url":"https://api.github.com/repos/Serras101/keystone_performance/events","assignees_url":"https://api.github.com/repos/Serras101/keystone_performance/assignees{/user}","branches_url":"https://api.github.com/repos/Serras101/keystone_performance/branches{/branch}","tags_url":"https://api.github.com/repos/Serras101/keystone_performance/tags","blobs_url":"https://api.github.com/repos/Serras101/keystone_performance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Serras101/keystone_performance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Serras101/keystone_performance/git/refs{/sha}","trees_url":"https://api.github.com/repos/Serras101/keystone_performance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Serras101/keystone_performance/statuses/{sha}","languages_url":"https://api.github.com/repos/Serras101/keystone_performance/languages","stargazers_url":"https://api.github.com/repos/Serras101/keystone_performance/stargazers","contributors_url":"https://api.github.com/repos/Serras101/keystone_performance/contributors","subscribers_url":"https://api.github.com/repos/Serras101/keystone_performance/subscribers","subscription_url":"https://api.github.com/repos/Serras101/keystone_performance/subscription","commits_url":"https://api.github.com/repos/Serras101/keystone_performance/commits{/sha}","git_commits_url":"https://api.github.com/repos/Serras101/keystone_performance/git/commits{/sha}","comments_url":"https://api.github.com/repos/Serras101/keystone_performance/comments{/number}","issue_comment_url":"https://api.github.com/repos/Serras101/keystone_performance/issues/comments{/number}","contents_url":"https://api.github.com/repos/Serras101/keystone_performance/contents/{+path}","compare_url":"https://api.github.com/repos/Serras101/keystone_performance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Serras101/keystone_performance/merges","archive_url":"https://api.github.com/repos/Serras101/keystone_performance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Serras101/keystone_performance/downloads","issues_url":"https://api.github.com/repos/Serras101/keystone_performance/issues{/number}","pulls_url":"https://api.github.com/repos/Serras101/keystone_performance/pulls{/number}","milestones_url":"https://api.github.com/repos/Serras101/keystone_performance/milestones{/number}","notifications_url":"https://api.github.com/repos/Serras101/keystone_performance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Serras101/keystone_performance/labels{/name}","releases_url":"https://api.github.com/repos/Serras101/keystone_performance/releases{/id}","deployments_url":"https://api.github.com/repos/Serras101/keystone_performance/deployments","created_at":"2016-07-19T18:46:01Z","updated_at":"2016-07-19T18:46:01Z","pushed_at":"2016-07-28T16:53:08Z","git_url":"git://github.com/Serras101/keystone_performance.git","ssh_url":"git@github.com:Serras101/keystone_performance.git","clone_url":"https://github.com/Serras101/keystone_performance.git","svn_url":"https://github.com/Serras101/keystone_performance","homepage":null,"size":33,"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":"brantlk:master","ref":"master","sha":"8170e0f2e193976ab12f96fbd1d52108156886a5","user":{"login":"brantlk","id":11064524,"avatar_url":"https://avatars.githubusercontent.com/u/11064524?v=3","gravatar_id":"","url":"https://api.github.com/users/brantlk","html_url":"https://github.com/brantlk","followers_url":"https://api.github.com/users/brantlk/followers","following_url":"https://api.github.com/users/brantlk/following{/other_user}","gists_url":"https://api.github.com/users/brantlk/gists{/gist_id}","starred_url":"https://api.github.com/users/brantlk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantlk/subscriptions","organizations_url":"https://api.github.com/users/brantlk/orgs","repos_url":"https://api.github.com/users/brantlk/repos","events_url":"https://api.github.com/users/brantlk/events{/privacy}","received_events_url":"https://api.github.com/users/brantlk/received_events","type":"User","site_admin":false},"repo":{"id":60295411,"name":"keystone_performance","full_name":"brantlk/keystone_performance","owner":{"login":"brantlk","id":11064524,"avatar_url":"https://avatars.githubusercontent.com/u/11064524?v=3","gravatar_id":"","url":"https://api.github.com/users/brantlk","html_url":"https://github.com/brantlk","followers_url":"https://api.github.com/users/brantlk/followers","following_url":"https://api.github.com/users/brantlk/following{/other_user}","gists_url":"https://api.github.com/users/brantlk/gists{/gist_id}","starred_url":"https://api.github.com/users/brantlk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brantlk/subscriptions","organizations_url":"https://api.github.com/users/brantlk/orgs","repos_url":"https://api.github.com/users/brantlk/repos","events_url":"https://api.github.com/users/brantlk/events{/privacy}","received_events_url":"https://api.github.com/users/brantlk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brantlk/keystone_performance","description":"","fork":false,"url":"https://api.github.com/repos/brantlk/keystone_performance","forks_url":"https://api.github.com/repos/brantlk/keystone_performance/forks","keys_url":"https://api.github.com/repos/brantlk/keystone_performance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brantlk/keystone_performance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brantlk/keystone_performance/teams","hooks_url":"https://api.github.com/repos/brantlk/keystone_performance/hooks","issue_events_url":"https://api.github.com/repos/brantlk/keystone_performance/issues/events{/number}","events_url":"https://api.github.com/repos/brantlk/keystone_performance/events","assignees_url":"https://api.github.com/repos/brantlk/keystone_performance/assignees{/user}","branches_url":"https://api.github.com/repos/brantlk/keystone_performance/branches{/branch}","tags_url":"https://api.github.com/repos/brantlk/keystone_performance/tags","blobs_url":"https://api.github.com/repos/brantlk/keystone_performance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brantlk/keystone_performance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brantlk/keystone_performance/git/refs{/sha}","trees_url":"https://api.github.com/repos/brantlk/keystone_performance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brantlk/keystone_performance/statuses/{sha}","languages_url":"https://api.github.com/repos/brantlk/keystone_performance/languages","stargazers_url":"https://api.github.com/repos/brantlk/keystone_performance/stargazers","contributors_url":"https://api.github.com/repos/brantlk/keystone_performance/contributors","subscribers_url":"https://api.github.com/repos/brantlk/keystone_performance/subscribers","subscription_url":"https://api.github.com/repos/brantlk/keystone_performance/subscription","commits_url":"https://api.github.com/repos/brantlk/keystone_performance/commits{/sha}","git_commits_url":"https://api.github.com/repos/brantlk/keystone_performance/git/commits{/sha}","comments_url":"https://api.github.com/repos/brantlk/keystone_performance/comments{/number}","issue_comment_url":"https://api.github.com/repos/brantlk/keystone_performance/issues/comments{/number}","contents_url":"https://api.github.com/repos/brantlk/keystone_performance/contents/{+path}","compare_url":"https://api.github.com/repos/brantlk/keystone_performance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brantlk/keystone_performance/merges","archive_url":"https://api.github.com/repos/brantlk/keystone_performance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brantlk/keystone_performance/downloads","issues_url":"https://api.github.com/repos/brantlk/keystone_performance/issues{/number}","pulls_url":"https://api.github.com/repos/brantlk/keystone_performance/pulls{/number}","milestones_url":"https://api.github.com/repos/brantlk/keystone_performance/milestones{/number}","notifications_url":"https://api.github.com/repos/brantlk/keystone_performance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brantlk/keystone_performance/labels{/name}","releases_url":"https://api.github.com/repos/brantlk/keystone_performance/releases{/id}","deployments_url":"https://api.github.com/repos/brantlk/keystone_performance/deployments","created_at":"2016-06-02T20:33:50Z","updated_at":"2016-06-02T20:50:13Z","pushed_at":"2016-07-28T16:53:08Z","git_url":"git://github.com/brantlk/keystone_performance.git","ssh_url":"git@github.com:brantlk/keystone_performance.git","clone_url":"https://github.com/brantlk/keystone_performance.git","svn_url":"https://github.com/brantlk/keystone_performance","homepage":null,"size":41,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brantlk/keystone_performance/pulls/2"},"html":{"href":"https://github.com/brantlk/keystone_performance/pull/2"},"issue":{"href":"https://api.github.com/repos/brantlk/keystone_performance/issues/2"},"comments":{"href":"https://api.github.com/repos/brantlk/keystone_performance/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/brantlk/keystone_performance/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/brantlk/keystone_performance/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brantlk/keystone_performance/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/brantlk/keystone_performance/statuses/752f08037a73926e9d65238236b33726b965da8e"}}}}
{"actor":{"display_login":"brantlk"}}