{"action":"created","comment":{"url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/comments/39736456","id":39736456,"diff_hunk":"@@ -24,19 +24,36 @@\n #\n author = 'chema'\n \n-import logging\n from os import environ as env\n \n from expired_users import ExpiredUsers\n from settings import settings\n from osclients import OpenStackClients\n+import utils\n \n-logging.debug('Getting expired users')\n-expired_users = ExpiredUsers(\n+logger = utils.log.init_logs('phase0')\n+\n+def is_user_protected(user):\n+    \"\"\"\n+    Return true if the user must not be deleted, because their address has a\n+    domain in setting.DONT_DELETE_DOMAINS, and print a warning.\n+    :param user: user to check\n+    :return: true if the user must not be deleted\n+    \"\"\"\n+    domain = user.name.partition('@')[2]\n+    if domain != '' and domain in settings.DONT_DELETE_DOMAINS:\n+        logging.warning(\n+            'User with name %(name)s should not be deleted because the domain',","path":"phase0_generateuserlist.py","position":26,"original_position":26,"commit_id":"5813959ab644df1f59fa7aa86a56bb96e86b5ec2","original_commit_id":"5813959ab644df1f59fa7aa86a56bb96e86b5ec2","user":{"login":"flopezag","id":1379796,"avatar_url":"https://avatars.githubusercontent.com/u/1379796?v=3","gravatar_id":"","url":"https://api.github.com/users/flopezag","html_url":"https://github.com/flopezag","followers_url":"https://api.github.com/users/flopezag/followers","following_url":"https://api.github.com/users/flopezag/following{/other_user}","gists_url":"https://api.github.com/users/flopezag/gists{/gist_id}","starred_url":"https://api.github.com/users/flopezag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flopezag/subscriptions","organizations_url":"https://api.github.com/users/flopezag/orgs","repos_url":"https://api.github.com/users/flopezag/repos","events_url":"https://api.github.com/users/flopezag/events{/privacy}","received_events_url":"https://api.github.com/users/flopezag/received_events","type":"User","site_admin":false},"body":"because the domain -> du to its domain","created_at":"2015-09-17T11:47:21Z","updated_at":"2015-09-17T11:47:21Z","html_url":"https://github.com/chemaper/delete_os_tenant_resources/pull/13#discussion_r39736456","pull_request_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/comments/39736456"},"html":{"href":"https://github.com/chemaper/delete_os_tenant_resources/pull/13#discussion_r39736456"},"pull_request":{"href":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/13","id":45276560,"html_url":"https://github.com/chemaper/delete_os_tenant_resources/pull/13","diff_url":"https://github.com/chemaper/delete_os_tenant_resources/pull/13.diff","patch_url":"https://github.com/chemaper/delete_os_tenant_resources/pull/13.patch","issue_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues/13","number":13,"state":"open","locked":false,"title":"Feature/claudia 5455","user":{"login":"chemaper","id":8962900,"avatar_url":"https://avatars.githubusercontent.com/u/8962900?v=3","gravatar_id":"","url":"https://api.github.com/users/chemaper","html_url":"https://github.com/chemaper","followers_url":"https://api.github.com/users/chemaper/followers","following_url":"https://api.github.com/users/chemaper/following{/other_user}","gists_url":"https://api.github.com/users/chemaper/gists{/gist_id}","starred_url":"https://api.github.com/users/chemaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemaper/subscriptions","organizations_url":"https://api.github.com/users/chemaper/orgs","repos_url":"https://api.github.com/users/chemaper/repos","events_url":"https://api.github.com/users/chemaper/events{/privacy}","received_events_url":"https://api.github.com/users/chemaper/received_events","type":"User","site_admin":false},"body":"#### Reviewers\r\n @flopezag\r\n #### Description\r\n \r\nThis pull request includes the functionality of claudia 5455 (about getting a list of next to expire to automatic notification) and also other changes that I've needed during the execution of the script to purging resources.\r\n\r\nSome changes:\r\n*fix script to be aware of trial_time\r\n*fix logging\r\n*fix capture exception\r\n*fix report saving\r\n*change phase4 execution orger\r\n*improve deleting: don't continue algorithm with users if detected that they don't have resources\r\n*preliminary code to change region in user_resources and all the other auxiliary classes. It allows changing the region without authenticating again.\r\n\r\n #### Testing\r\n Locally\r\n","created_at":"2015-09-17T10:53:08Z","updated_at":"2015-09-17T11:47:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66351576a89c9fe25fa736aaa5f0fc98d1c105ae","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/13/commits","review_comments_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/13/comments","review_comment_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues/13/comments","statuses_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/statuses/5813959ab644df1f59fa7aa86a56bb96e86b5ec2","head":{"label":"chemaper:feature/claudia-5455","ref":"feature/claudia-5455","sha":"5813959ab644df1f59fa7aa86a56bb96e86b5ec2","user":{"login":"chemaper","id":8962900,"avatar_url":"https://avatars.githubusercontent.com/u/8962900?v=3","gravatar_id":"","url":"https://api.github.com/users/chemaper","html_url":"https://github.com/chemaper","followers_url":"https://api.github.com/users/chemaper/followers","following_url":"https://api.github.com/users/chemaper/following{/other_user}","gists_url":"https://api.github.com/users/chemaper/gists{/gist_id}","starred_url":"https://api.github.com/users/chemaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemaper/subscriptions","organizations_url":"https://api.github.com/users/chemaper/orgs","repos_url":"https://api.github.com/users/chemaper/repos","events_url":"https://api.github.com/users/chemaper/events{/privacy}","received_events_url":"https://api.github.com/users/chemaper/received_events","type":"User","site_admin":false},"repo":{"id":35614972,"name":"delete_os_tenant_resources","full_name":"chemaper/delete_os_tenant_resources","owner":{"login":"chemaper","id":8962900,"avatar_url":"https://avatars.githubusercontent.com/u/8962900?v=3","gravatar_id":"","url":"https://api.github.com/users/chemaper","html_url":"https://github.com/chemaper","followers_url":"https://api.github.com/users/chemaper/followers","following_url":"https://api.github.com/users/chemaper/following{/other_user}","gists_url":"https://api.github.com/users/chemaper/gists{/gist_id}","starred_url":"https://api.github.com/users/chemaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemaper/subscriptions","organizations_url":"https://api.github.com/users/chemaper/orgs","repos_url":"https://api.github.com/users/chemaper/repos","events_url":"https://api.github.com/users/chemaper/events{/privacy}","received_events_url":"https://api.github.com/users/chemaper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chemaper/delete_os_tenant_resources","description":"python code to delete the resources of the tenant","fork":false,"url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources","forks_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/forks","keys_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/teams","hooks_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/hooks","issue_events_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues/events{/number}","events_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/events","assignees_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/assignees{/user}","branches_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/branches{/branch}","tags_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/tags","blobs_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/refs{/sha}","trees_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/statuses/{sha}","languages_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/languages","stargazers_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/stargazers","contributors_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/contributors","subscribers_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/subscribers","subscription_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/subscription","commits_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/commits{/sha}","git_commits_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/commits{/sha}","comments_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/comments{/number}","issue_comment_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues/comments{/number}","contents_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/contents/{+path}","compare_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/merges","archive_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/downloads","issues_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues{/number}","pulls_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls{/number}","milestones_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/milestones{/number}","notifications_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/labels{/name}","releases_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/releases{/id}","created_at":"2015-05-14T14:13:24Z","updated_at":"2015-05-14T14:23:02Z","pushed_at":"2015-09-17T10:53:08Z","git_url":"git://github.com/chemaper/delete_os_tenant_resources.git","ssh_url":"git@github.com:chemaper/delete_os_tenant_resources.git","clone_url":"https://github.com/chemaper/delete_os_tenant_resources.git","svn_url":"https://github.com/chemaper/delete_os_tenant_resources","homepage":null,"size":445,"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":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"chemaper:develop","ref":"develop","sha":"7d842938628d3acf5964450c0903c43919e1feda","user":{"login":"chemaper","id":8962900,"avatar_url":"https://avatars.githubusercontent.com/u/8962900?v=3","gravatar_id":"","url":"https://api.github.com/users/chemaper","html_url":"https://github.com/chemaper","followers_url":"https://api.github.com/users/chemaper/followers","following_url":"https://api.github.com/users/chemaper/following{/other_user}","gists_url":"https://api.github.com/users/chemaper/gists{/gist_id}","starred_url":"https://api.github.com/users/chemaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemaper/subscriptions","organizations_url":"https://api.github.com/users/chemaper/orgs","repos_url":"https://api.github.com/users/chemaper/repos","events_url":"https://api.github.com/users/chemaper/events{/privacy}","received_events_url":"https://api.github.com/users/chemaper/received_events","type":"User","site_admin":false},"repo":{"id":35614972,"name":"delete_os_tenant_resources","full_name":"chemaper/delete_os_tenant_resources","owner":{"login":"chemaper","id":8962900,"avatar_url":"https://avatars.githubusercontent.com/u/8962900?v=3","gravatar_id":"","url":"https://api.github.com/users/chemaper","html_url":"https://github.com/chemaper","followers_url":"https://api.github.com/users/chemaper/followers","following_url":"https://api.github.com/users/chemaper/following{/other_user}","gists_url":"https://api.github.com/users/chemaper/gists{/gist_id}","starred_url":"https://api.github.com/users/chemaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chemaper/subscriptions","organizations_url":"https://api.github.com/users/chemaper/orgs","repos_url":"https://api.github.com/users/chemaper/repos","events_url":"https://api.github.com/users/chemaper/events{/privacy}","received_events_url":"https://api.github.com/users/chemaper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chemaper/delete_os_tenant_resources","description":"python code to delete the resources of the tenant","fork":false,"url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources","forks_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/forks","keys_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/teams","hooks_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/hooks","issue_events_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues/events{/number}","events_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/events","assignees_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/assignees{/user}","branches_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/branches{/branch}","tags_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/tags","blobs_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/refs{/sha}","trees_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/statuses/{sha}","languages_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/languages","stargazers_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/stargazers","contributors_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/contributors","subscribers_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/subscribers","subscription_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/subscription","commits_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/commits{/sha}","git_commits_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/git/commits{/sha}","comments_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/comments{/number}","issue_comment_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues/comments{/number}","contents_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/contents/{+path}","compare_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/merges","archive_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/downloads","issues_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues{/number}","pulls_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls{/number}","milestones_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/milestones{/number}","notifications_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/labels{/name}","releases_url":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/releases{/id}","created_at":"2015-05-14T14:13:24Z","updated_at":"2015-05-14T14:23:02Z","pushed_at":"2015-09-17T10:53:08Z","git_url":"git://github.com/chemaper/delete_os_tenant_resources.git","ssh_url":"git@github.com:chemaper/delete_os_tenant_resources.git","clone_url":"https://github.com/chemaper/delete_os_tenant_resources.git","svn_url":"https://github.com/chemaper/delete_os_tenant_resources","homepage":null,"size":445,"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":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/13"},"html":{"href":"https://github.com/chemaper/delete_os_tenant_resources/pull/13"},"issue":{"href":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues/13"},"comments":{"href":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/chemaper/delete_os_tenant_resources/statuses/5813959ab644df1f59fa7aa86a56bb96e86b5ec2"}}}}