{"action":"created","comment":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/comments/25802228","id":25802228,"diff_hunk":"@@ -0,0 +1,71 @@\n+\"\"\" This script creates a new user. Fails if the user already exists. \"\"\"\n+\n+import M2Crypto\n+import os\n+import string\n+import sys\n+import SOAPpy\n+\n+sys.path.append(os.path.join(os.path.dirname(__file__), \"../lib\"))\n+import appscale_info\n+import constants\n+\n+def get_soap_accessor():\n+  \"\"\" Returns the SOAP server accessor to deal with application and users.\n+\n+  Returns:\n+    A soap server accessor.\n+  \"\"\"\n+  db_ip = appscale_info.get_db_master_ip()\n+  bindport = constants.UA_SERVER_PORT\n+  return SOAPpy.SOAPProxy(\"https://{0}:{1}\".format(db_ip, bindport))\n+\n+def delete_user(server, email):\n+  \"\"\" Deletes a user.\n+\n+  Args:\n+    server: A SOAP server accessor.\n+    email: A str, the user email.\n+  Returns:\n+    True on success, False otherwise.\n+  \"\"\"\n+  secret = appscale_info.get_secret()\n+  return server.delete_user(email, secret) == \"true\"\n+\n+def does_user_exist(email, server):\n+  \"\"\" Checks to see if a user already exists. \n+\n+  Args:\n+    email: A str, an email address to check.\n+    server: A SOAP server accessor.\n+  Returns:\n+    True if the user exists, False otherwise.\n+  \"\"\"\n+  secret = appscale_info.get_secret()\n+  return server.does_user_exist(email, secret) == \"true\"\n+\n+def usage():\n+  print \"\"\n+  print \"Deletes a user in AppScale.\"\n+  print \"Args:  email adress\"","path":"scripts/delete_user.py","position":50,"original_position":50,"commit_id":"7c02103ca87a9c5cbb5c21b0493b54e38c40b07f","original_commit_id":"7c02103ca87a9c5cbb5c21b0493b54e38c40b07f","user":{"login":"menivaitsi","id":6760257,"avatar_url":"https://avatars.githubusercontent.com/u/6760257?v=3","gravatar_id":"","url":"https://api.github.com/users/menivaitsi","html_url":"https://github.com/menivaitsi","followers_url":"https://api.github.com/users/menivaitsi/followers","following_url":"https://api.github.com/users/menivaitsi/following{/other_user}","gists_url":"https://api.github.com/users/menivaitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/menivaitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/menivaitsi/subscriptions","organizations_url":"https://api.github.com/users/menivaitsi/orgs","repos_url":"https://api.github.com/users/menivaitsi/repos","events_url":"https://api.github.com/users/menivaitsi/events{/privacy}","received_events_url":"https://api.github.com/users/menivaitsi/received_events","type":"User","site_admin":false},"body":"Same as create_user script.","created_at":"2015-03-04T18:59:58Z","updated_at":"2015-03-04T18:59:58Z","html_url":"https://github.com/AppScale/appscale/pull/1689#discussion_r25802228","pull_request_url":"https://api.github.com/repos/AppScale/appscale/pulls/1689","_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments/25802228"},"html":{"href":"https://github.com/AppScale/appscale/pull/1689#discussion_r25802228"},"pull_request":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/1689"}}},"pull_request":{"url":"https://api.github.com/repos/AppScale/appscale/pulls/1689","id":30492439,"html_url":"https://github.com/AppScale/appscale/pull/1689","diff_url":"https://github.com/AppScale/appscale/pull/1689.diff","patch_url":"https://github.com/AppScale/appscale/pull/1689.patch","issue_url":"https://api.github.com/repos/AppScale/appscale/issues/1689","number":1689,"state":"open","locked":false,"title":"User management scripts","user":{"login":"nlake44","id":469387,"avatar_url":"https://avatars.githubusercontent.com/u/469387?v=3","gravatar_id":"","url":"https://api.github.com/users/nlake44","html_url":"https://github.com/nlake44","followers_url":"https://api.github.com/users/nlake44/followers","following_url":"https://api.github.com/users/nlake44/following{/other_user}","gists_url":"https://api.github.com/users/nlake44/gists{/gist_id}","starred_url":"https://api.github.com/users/nlake44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlake44/subscriptions","organizations_url":"https://api.github.com/users/nlake44/orgs","repos_url":"https://api.github.com/users/nlake44/repos","events_url":"https://api.github.com/users/nlake44/events{/privacy}","received_events_url":"https://api.github.com/users/nlake44/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-04T18:46:59Z","updated_at":"2015-03-04T18:59:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0fdac9efa6bf91ab71f9f20876bbdb7f2fa14d6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AppScale/appscale/pulls/1689/commits","review_comments_url":"https://api.github.com/repos/AppScale/appscale/pulls/1689/comments","review_comment_url":"https://api.github.com/repos/AppScale/appscale/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AppScale/appscale/issues/1689/comments","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/7c02103ca87a9c5cbb5c21b0493b54e38c40b07f","head":{"label":"AppScale:user-management-scripts","ref":"user-management-scripts","sha":"7c02103ca87a9c5cbb5c21b0493b54e38c40b07f","user":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"repo":{"id":3803067,"name":"appscale","full_name":"AppScale/appscale","owner":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AppScale/appscale","description":"The Open Source Implementation of Google App Engine -- Take your apps everywhere.","fork":false,"url":"https://api.github.com/repos/AppScale/appscale","forks_url":"https://api.github.com/repos/AppScale/appscale/forks","keys_url":"https://api.github.com/repos/AppScale/appscale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppScale/appscale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppScale/appscale/teams","hooks_url":"https://api.github.com/repos/AppScale/appscale/hooks","issue_events_url":"https://api.github.com/repos/AppScale/appscale/issues/events{/number}","events_url":"https://api.github.com/repos/AppScale/appscale/events","assignees_url":"https://api.github.com/repos/AppScale/appscale/assignees{/user}","branches_url":"https://api.github.com/repos/AppScale/appscale/branches{/branch}","tags_url":"https://api.github.com/repos/AppScale/appscale/tags","blobs_url":"https://api.github.com/repos/AppScale/appscale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppScale/appscale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppScale/appscale/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppScale/appscale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/{sha}","languages_url":"https://api.github.com/repos/AppScale/appscale/languages","stargazers_url":"https://api.github.com/repos/AppScale/appscale/stargazers","contributors_url":"https://api.github.com/repos/AppScale/appscale/contributors","subscribers_url":"https://api.github.com/repos/AppScale/appscale/subscribers","subscription_url":"https://api.github.com/repos/AppScale/appscale/subscription","commits_url":"https://api.github.com/repos/AppScale/appscale/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppScale/appscale/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppScale/appscale/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppScale/appscale/issues/comments{/number}","contents_url":"https://api.github.com/repos/AppScale/appscale/contents/{+path}","compare_url":"https://api.github.com/repos/AppScale/appscale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppScale/appscale/merges","archive_url":"https://api.github.com/repos/AppScale/appscale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppScale/appscale/downloads","issues_url":"https://api.github.com/repos/AppScale/appscale/issues{/number}","pulls_url":"https://api.github.com/repos/AppScale/appscale/pulls{/number}","milestones_url":"https://api.github.com/repos/AppScale/appscale/milestones{/number}","notifications_url":"https://api.github.com/repos/AppScale/appscale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppScale/appscale/labels{/name}","releases_url":"https://api.github.com/repos/AppScale/appscale/releases{/id}","created_at":"2012-03-22T22:35:50Z","updated_at":"2015-03-04T13:58:49Z","pushed_at":"2015-03-04T18:46:18Z","git_url":"git://github.com/AppScale/appscale.git","ssh_url":"git@github.com:AppScale/appscale.git","clone_url":"https://github.com/AppScale/appscale.git","svn_url":"https://github.com/AppScale/appscale","homepage":"http://www.appscale.com","size":186238,"stargazers_count":1935,"watchers_count":1935,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":192,"mirror_url":null,"open_issues_count":56,"forks":192,"open_issues":56,"watchers":1935,"default_branch":"master"}},"base":{"label":"AppScale:master","ref":"master","sha":"bf51564d0d10126e693534950c539e00758a4aea","user":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"repo":{"id":3803067,"name":"appscale","full_name":"AppScale/appscale","owner":{"login":"AppScale","id":1486044,"avatar_url":"https://avatars.githubusercontent.com/u/1486044?v=3","gravatar_id":"","url":"https://api.github.com/users/AppScale","html_url":"https://github.com/AppScale","followers_url":"https://api.github.com/users/AppScale/followers","following_url":"https://api.github.com/users/AppScale/following{/other_user}","gists_url":"https://api.github.com/users/AppScale/gists{/gist_id}","starred_url":"https://api.github.com/users/AppScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppScale/subscriptions","organizations_url":"https://api.github.com/users/AppScale/orgs","repos_url":"https://api.github.com/users/AppScale/repos","events_url":"https://api.github.com/users/AppScale/events{/privacy}","received_events_url":"https://api.github.com/users/AppScale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AppScale/appscale","description":"The Open Source Implementation of Google App Engine -- Take your apps everywhere.","fork":false,"url":"https://api.github.com/repos/AppScale/appscale","forks_url":"https://api.github.com/repos/AppScale/appscale/forks","keys_url":"https://api.github.com/repos/AppScale/appscale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppScale/appscale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppScale/appscale/teams","hooks_url":"https://api.github.com/repos/AppScale/appscale/hooks","issue_events_url":"https://api.github.com/repos/AppScale/appscale/issues/events{/number}","events_url":"https://api.github.com/repos/AppScale/appscale/events","assignees_url":"https://api.github.com/repos/AppScale/appscale/assignees{/user}","branches_url":"https://api.github.com/repos/AppScale/appscale/branches{/branch}","tags_url":"https://api.github.com/repos/AppScale/appscale/tags","blobs_url":"https://api.github.com/repos/AppScale/appscale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppScale/appscale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppScale/appscale/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppScale/appscale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppScale/appscale/statuses/{sha}","languages_url":"https://api.github.com/repos/AppScale/appscale/languages","stargazers_url":"https://api.github.com/repos/AppScale/appscale/stargazers","contributors_url":"https://api.github.com/repos/AppScale/appscale/contributors","subscribers_url":"https://api.github.com/repos/AppScale/appscale/subscribers","subscription_url":"https://api.github.com/repos/AppScale/appscale/subscription","commits_url":"https://api.github.com/repos/AppScale/appscale/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppScale/appscale/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppScale/appscale/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppScale/appscale/issues/comments{/number}","contents_url":"https://api.github.com/repos/AppScale/appscale/contents/{+path}","compare_url":"https://api.github.com/repos/AppScale/appscale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppScale/appscale/merges","archive_url":"https://api.github.com/repos/AppScale/appscale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppScale/appscale/downloads","issues_url":"https://api.github.com/repos/AppScale/appscale/issues{/number}","pulls_url":"https://api.github.com/repos/AppScale/appscale/pulls{/number}","milestones_url":"https://api.github.com/repos/AppScale/appscale/milestones{/number}","notifications_url":"https://api.github.com/repos/AppScale/appscale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppScale/appscale/labels{/name}","releases_url":"https://api.github.com/repos/AppScale/appscale/releases{/id}","created_at":"2012-03-22T22:35:50Z","updated_at":"2015-03-04T13:58:49Z","pushed_at":"2015-03-04T18:46:18Z","git_url":"git://github.com/AppScale/appscale.git","ssh_url":"git@github.com:AppScale/appscale.git","clone_url":"https://github.com/AppScale/appscale.git","svn_url":"https://github.com/AppScale/appscale","homepage":"http://www.appscale.com","size":186238,"stargazers_count":1935,"watchers_count":1935,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":192,"mirror_url":null,"open_issues_count":56,"forks":192,"open_issues":56,"watchers":1935,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/1689"},"html":{"href":"https://github.com/AppScale/appscale/pull/1689"},"issue":{"href":"https://api.github.com/repos/AppScale/appscale/issues/1689"},"comments":{"href":"https://api.github.com/repos/AppScale/appscale/issues/1689/comments"},"review_comments":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/1689/comments"},"review_comment":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AppScale/appscale/pulls/1689/commits"},"statuses":{"href":"https://api.github.com/repos/AppScale/appscale/statuses/7c02103ca87a9c5cbb5c21b0493b54e38c40b07f"}}}}