{"action":"created","comment":{"url":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/comments/198914591","pull_request_review_id":132933863,"id":198914591,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODkxNDU5MQ==","diff_hunk":"@@ -105,7 +103,68 @@ def get_ami(session, image_id, source_region):\n         Image: A boto3 EC2 Image object.\n \n     \"\"\"\n-    return session.resource('ec2', region_name=source_region).Image(image_id)\n+    image = session.resource('ec2', region_name=source_region).Image(image_id)\n+    check_image_state(image)\n+    return image\n+\n+\n+def check_image_state(image):\n+    \"\"\"Raise an exception if image state is not available.\"\"\"\n+    if image.state == 'available':\n+        return\n+    message = _('Image {id} has state {state} (reason: {reason})').format(\n+        id=image.id,\n+        state=image.state,\n+        reason=image.state_reason\n+    )\n+    if image.state == 'failed':\n+        raise AwsImageError(message)","path":"cloudigrade/util/aws/ec2.py","position":37,"original_position":37,"commit_id":"3b416a6f5279a8e8dbcafba00938480e0a3ae87a","original_commit_id":"3b416a6f5279a8e8dbcafba00938480e0a3ae87a","user":{"login":"infinitewarp","id":1472326,"node_id":"MDQ6VXNlcjE0NzIzMjY=","avatar_url":"https://avatars3.githubusercontent.com/u/1472326?v=4","gravatar_id":"","url":"https://api.github.com/users/infinitewarp","html_url":"https://github.com/infinitewarp","followers_url":"https://api.github.com/users/infinitewarp/followers","following_url":"https://api.github.com/users/infinitewarp/following{/other_user}","gists_url":"https://api.github.com/users/infinitewarp/gists{/gist_id}","starred_url":"https://api.github.com/users/infinitewarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinitewarp/subscriptions","organizations_url":"https://api.github.com/users/infinitewarp/orgs","repos_url":"https://api.github.com/users/infinitewarp/repos","events_url":"https://api.github.com/users/infinitewarp/events{/privacy}","received_events_url":"https://api.github.com/users/infinitewarp/received_events","type":"User","site_admin":false},"body":"`AwsImageError` does not extend `NotReadyException`, and that means that it should _not_ trigger the retry condition in the task decorator a few levels up. So, the task will report this exception and stop processing without retry.\r\n\r\nThe only case in which the task will retry (with backoff) is when the image state is _neither_ `'available'` _nor_ `'failed'`, which AFAICT are only the two terminal states.","created_at":"2018-06-28T17:00:24Z","updated_at":"2018-06-28T17:00:24Z","html_url":"https://github.com/cloudigrade/cloudigrade/pull/372#discussion_r198914591","pull_request_url":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/372","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/comments/198914591"},"html":{"href":"https://github.com/cloudigrade/cloudigrade/pull/372#discussion_r198914591"},"pull_request":{"href":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/372"}},"in_reply_to_id":198815763},"pull_request":{"url":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/372","id":196769599,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2NzY5NTk5","html_url":"https://github.com/cloudigrade/cloudigrade/pull/372","diff_url":"https://github.com/cloudigrade/cloudigrade/pull/372.diff","patch_url":"https://github.com/cloudigrade/cloudigrade/pull/372.patch","issue_url":"https://api.github.com/repos/cloudigrade/cloudigrade/issues/372","number":372,"state":"open","locked":false,"title":"handle shared private images","user":{"login":"infinitewarp","id":1472326,"node_id":"MDQ6VXNlcjE0NzIzMjY=","avatar_url":"https://avatars3.githubusercontent.com/u/1472326?v=4","gravatar_id":"","url":"https://api.github.com/users/infinitewarp","html_url":"https://github.com/infinitewarp","followers_url":"https://api.github.com/users/infinitewarp/followers","following_url":"https://api.github.com/users/infinitewarp/following{/other_user}","gists_url":"https://api.github.com/users/infinitewarp/gists{/gist_id}","starred_url":"https://api.github.com/users/infinitewarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinitewarp/subscriptions","organizations_url":"https://api.github.com/users/infinitewarp/orgs","repos_url":"https://api.github.com/users/infinitewarp/repos","events_url":"https://api.github.com/users/infinitewarp/events{/privacy}","received_events_url":"https://api.github.com/users/infinitewarp/received_events","type":"User","site_admin":false},"body":"https://github.com/cloudigrade/cloudigrade/issues/357\r\n\r\nDemo coming soon.\r\n\r\nAlso this will require a shiftigrade update for Celery to handle the new async task.","created_at":"2018-06-22T15:21:55Z","updated_at":"2018-06-28T17:00:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28ce8b63806892cdba389edafb93832cfe2338d8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"Quality Engineering","id":2664371,"node_id":"MDQ6VGVhbTI2NjQzNzE=","slug":"quality-engineering","description":"","privacy":"closed","url":"https://api.github.com/teams/2664371","members_url":"https://api.github.com/teams/2664371/members{/member}","repositories_url":"https://api.github.com/teams/2664371/repos","permission":"pull"}],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/372/commits","review_comments_url":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/372/comments","review_comment_url":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudigrade/cloudigrade/issues/372/comments","statuses_url":"https://api.github.com/repos/cloudigrade/cloudigrade/statuses/3b416a6f5279a8e8dbcafba00938480e0a3ae87a","head":{"label":"cloudigrade:357-handle-shared-private-images","ref":"357-handle-shared-private-images","sha":"3b416a6f5279a8e8dbcafba00938480e0a3ae87a","user":{"login":"cloudigrade","id":35604841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjA0ODQx","avatar_url":"https://avatars2.githubusercontent.com/u/35604841?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudigrade","html_url":"https://github.com/cloudigrade","followers_url":"https://api.github.com/users/cloudigrade/followers","following_url":"https://api.github.com/users/cloudigrade/following{/other_user}","gists_url":"https://api.github.com/users/cloudigrade/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudigrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudigrade/subscriptions","organizations_url":"https://api.github.com/users/cloudigrade/orgs","repos_url":"https://api.github.com/users/cloudigrade/repos","events_url":"https://api.github.com/users/cloudigrade/events{/privacy}","received_events_url":"https://api.github.com/users/cloudigrade/received_events","type":"Organization","site_admin":false},"repo":{"id":118967787,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg5Njc3ODc=","name":"cloudigrade","full_name":"cloudigrade/cloudigrade","owner":{"login":"cloudigrade","id":35604841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjA0ODQx","avatar_url":"https://avatars2.githubusercontent.com/u/35604841?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudigrade","html_url":"https://github.com/cloudigrade","followers_url":"https://api.github.com/users/cloudigrade/followers","following_url":"https://api.github.com/users/cloudigrade/following{/other_user}","gists_url":"https://api.github.com/users/cloudigrade/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudigrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudigrade/subscriptions","organizations_url":"https://api.github.com/users/cloudigrade/orgs","repos_url":"https://api.github.com/users/cloudigrade/repos","events_url":"https://api.github.com/users/cloudigrade/events{/privacy}","received_events_url":"https://api.github.com/users/cloudigrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudigrade/cloudigrade","description":"A tool for tracking and reporting RHEL usage in public clouds","fork":false,"url":"https://api.github.com/repos/cloudigrade/cloudigrade","forks_url":"https://api.github.com/repos/cloudigrade/cloudigrade/forks","keys_url":"https://api.github.com/repos/cloudigrade/cloudigrade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudigrade/cloudigrade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudigrade/cloudigrade/teams","hooks_url":"https://api.github.com/repos/cloudigrade/cloudigrade/hooks","issue_events_url":"https://api.github.com/repos/cloudigrade/cloudigrade/issues/events{/number}","events_url":"https://api.github.com/repos/cloudigrade/cloudigrade/events","assignees_url":"https://api.github.com/repos/cloudigrade/cloudigrade/assignees{/user}","branches_url":"https://api.github.com/repos/cloudigrade/cloudigrade/branches{/branch}","tags_url":"https://api.github.com/repos/cloudigrade/cloudigrade/tags","blobs_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudigrade/cloudigrade/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudigrade/cloudigrade/languages","stargazers_url":"https://api.github.com/repos/cloudigrade/cloudigrade/stargazers","contributors_url":"https://api.github.com/repos/cloudigrade/cloudigrade/contributors","subscribers_url":"https://api.github.com/repos/cloudigrade/cloudigrade/subscribers","subscription_url":"https://api.github.com/repos/cloudigrade/cloudigrade/subscription","commits_url":"https://api.github.com/repos/cloudigrade/cloudigrade/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudigrade/cloudigrade/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudigrade/cloudigrade/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudigrade/cloudigrade/contents/{+path}","compare_url":"https://api.github.com/repos/cloudigrade/cloudigrade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudigrade/cloudigrade/merges","archive_url":"https://api.github.com/repos/cloudigrade/cloudigrade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudigrade/cloudigrade/downloads","issues_url":"https://api.github.com/repos/cloudigrade/cloudigrade/issues{/number}","pulls_url":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudigrade/cloudigrade/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudigrade/cloudigrade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudigrade/cloudigrade/labels{/name}","releases_url":"https://api.github.com/repos/cloudigrade/cloudigrade/releases{/id}","deployments_url":"https://api.github.com/repos/cloudigrade/cloudigrade/deployments","created_at":"2018-01-25T21:06:58Z","updated_at":"2018-06-28T14:39:28Z","pushed_at":"2018-06-28T14:39:30Z","git_url":"git://github.com/cloudigrade/cloudigrade.git","ssh_url":"git@github.com:cloudigrade/cloudigrade.git","clone_url":"https://github.com/cloudigrade/cloudigrade.git","svn_url":"https://github.com/cloudigrade/cloudigrade","homepage":"","size":545,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":2,"open_issues":36,"watchers":6,"default_branch":"master"}},"base":{"label":"cloudigrade:master","ref":"master","sha":"a668395b2e9a51a965bb534b5041e4ebe602dbfa","user":{"login":"cloudigrade","id":35604841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjA0ODQx","avatar_url":"https://avatars2.githubusercontent.com/u/35604841?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudigrade","html_url":"https://github.com/cloudigrade","followers_url":"https://api.github.com/users/cloudigrade/followers","following_url":"https://api.github.com/users/cloudigrade/following{/other_user}","gists_url":"https://api.github.com/users/cloudigrade/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudigrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudigrade/subscriptions","organizations_url":"https://api.github.com/users/cloudigrade/orgs","repos_url":"https://api.github.com/users/cloudigrade/repos","events_url":"https://api.github.com/users/cloudigrade/events{/privacy}","received_events_url":"https://api.github.com/users/cloudigrade/received_events","type":"Organization","site_admin":false},"repo":{"id":118967787,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg5Njc3ODc=","name":"cloudigrade","full_name":"cloudigrade/cloudigrade","owner":{"login":"cloudigrade","id":35604841,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjA0ODQx","avatar_url":"https://avatars2.githubusercontent.com/u/35604841?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudigrade","html_url":"https://github.com/cloudigrade","followers_url":"https://api.github.com/users/cloudigrade/followers","following_url":"https://api.github.com/users/cloudigrade/following{/other_user}","gists_url":"https://api.github.com/users/cloudigrade/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudigrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudigrade/subscriptions","organizations_url":"https://api.github.com/users/cloudigrade/orgs","repos_url":"https://api.github.com/users/cloudigrade/repos","events_url":"https://api.github.com/users/cloudigrade/events{/privacy}","received_events_url":"https://api.github.com/users/cloudigrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudigrade/cloudigrade","description":"A tool for tracking and reporting RHEL usage in public clouds","fork":false,"url":"https://api.github.com/repos/cloudigrade/cloudigrade","forks_url":"https://api.github.com/repos/cloudigrade/cloudigrade/forks","keys_url":"https://api.github.com/repos/cloudigrade/cloudigrade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudigrade/cloudigrade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudigrade/cloudigrade/teams","hooks_url":"https://api.github.com/repos/cloudigrade/cloudigrade/hooks","issue_events_url":"https://api.github.com/repos/cloudigrade/cloudigrade/issues/events{/number}","events_url":"https://api.github.com/repos/cloudigrade/cloudigrade/events","assignees_url":"https://api.github.com/repos/cloudigrade/cloudigrade/assignees{/user}","branches_url":"https://api.github.com/repos/cloudigrade/cloudigrade/branches{/branch}","tags_url":"https://api.github.com/repos/cloudigrade/cloudigrade/tags","blobs_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudigrade/cloudigrade/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudigrade/cloudigrade/languages","stargazers_url":"https://api.github.com/repos/cloudigrade/cloudigrade/stargazers","contributors_url":"https://api.github.com/repos/cloudigrade/cloudigrade/contributors","subscribers_url":"https://api.github.com/repos/cloudigrade/cloudigrade/subscribers","subscription_url":"https://api.github.com/repos/cloudigrade/cloudigrade/subscription","commits_url":"https://api.github.com/repos/cloudigrade/cloudigrade/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudigrade/cloudigrade/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudigrade/cloudigrade/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudigrade/cloudigrade/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudigrade/cloudigrade/contents/{+path}","compare_url":"https://api.github.com/repos/cloudigrade/cloudigrade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudigrade/cloudigrade/merges","archive_url":"https://api.github.com/repos/cloudigrade/cloudigrade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudigrade/cloudigrade/downloads","issues_url":"https://api.github.com/repos/cloudigrade/cloudigrade/issues{/number}","pulls_url":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudigrade/cloudigrade/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudigrade/cloudigrade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudigrade/cloudigrade/labels{/name}","releases_url":"https://api.github.com/repos/cloudigrade/cloudigrade/releases{/id}","deployments_url":"https://api.github.com/repos/cloudigrade/cloudigrade/deployments","created_at":"2018-01-25T21:06:58Z","updated_at":"2018-06-28T14:39:28Z","pushed_at":"2018-06-28T14:39:30Z","git_url":"git://github.com/cloudigrade/cloudigrade.git","ssh_url":"git@github.com:cloudigrade/cloudigrade.git","clone_url":"https://github.com/cloudigrade/cloudigrade.git","svn_url":"https://github.com/cloudigrade/cloudigrade","homepage":"","size":545,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":2,"open_issues":36,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/372"},"html":{"href":"https://github.com/cloudigrade/cloudigrade/pull/372"},"issue":{"href":"https://api.github.com/repos/cloudigrade/cloudigrade/issues/372"},"comments":{"href":"https://api.github.com/repos/cloudigrade/cloudigrade/issues/372/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/372/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudigrade/cloudigrade/pulls/372/commits"},"statuses":{"href":"https://api.github.com/repos/cloudigrade/cloudigrade/statuses/3b416a6f5279a8e8dbcafba00938480e0a3ae87a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"infinitewarp"}}