)]}'
{"openstackclient/compute/v2/server.py":[{"author":{"_account_id":23644,"name":"Ryan Bridges","email":"rybridges16@gmail.com","username":"Patchett"},"change_message_id":"5c90ea80c2c423ee0c0bba7a7c41f2b190412d38","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"        images \u003d {}"},{"line_number":1180,"context_line":"        for s in data:"},{"line_number":1181,"context_line":"            if \u0027id\u0027 in s.image:"},{"line_number":1182,"context_line":"                if s.image[\u0027id\u0027] not in images and \\"},{"line_number":1183,"context_line":"                   not parsed_args.no_name_lookup:"},{"line_number":1184,"context_line":"                    # The image ID isn\u0027t critical, and there\u0027s a chance that"},{"line_number":1185,"context_line":"                    # the operator may have cleaned up soft-deleted images"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_587b82f3","line":1182,"range":{"start_line":1182,"start_character":19,"end_line":1182,"end_character":46},"updated":"2018-03-16 16:33:52.000000000","message":"Change to:\n\nif s.image[\u0027id\u0027] not in images.keys()\n\nOR\n\nif images.get(s.image[\u0027id\u0027]) is None","commit_id":"f60360bf902c1c24a59cda07a00d89f0ebfdd0f0"},{"author":{"_account_id":9452,"name":"James Penick","email":"penick@verizonmedia.com","username":"epim"},"change_message_id":"52a9e2cfe8378344b393f61a3b128967bb6331e6","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"        images \u003d {}"},{"line_number":1180,"context_line":"        for s in data:"},{"line_number":1181,"context_line":"            if \u0027id\u0027 in s.image:"},{"line_number":1182,"context_line":"                if s.image[\u0027id\u0027] not in images and \\"},{"line_number":1183,"context_line":"                   not parsed_args.no_name_lookup:"},{"line_number":1184,"context_line":"                    # The image ID isn\u0027t critical, and there\u0027s a chance that"},{"line_number":1185,"context_line":"                    # the operator may have cleaned up soft-deleted images"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_339a7161","line":1182,"range":{"start_line":1182,"start_character":19,"end_line":1182,"end_character":46},"in_reply_to":"df7087c5_587b82f3","updated":"2018-03-16 17:03:40.000000000","message":"Good point, i\u0027ll fix that. Ignore patch set 2. I\u0027ll put 3 up in a sec.","commit_id":"f60360bf902c1c24a59cda07a00d89f0ebfdd0f0"},{"author":{"_account_id":23644,"name":"Ryan Bridges","email":"rybridges16@gmail.com","username":"Patchett"},"change_message_id":"0e4b9eec5cf97409c6f75678578a41ee611ba865","unresolved":false,"context_lines":[{"line_number":1185,"context_line":"                    # the operator may have cleaned up soft-deleted images"},{"line_number":1186,"context_line":"                    # drop any exceptions."},{"line_number":1187,"context_line":"                    try:"},{"line_number":1188,"context_line":"                        imageObj \u003d self.app.client_manager.image.images"},{"line_number":1189,"context_line":"                        images[s.image[\u0027id\u0027]] \u003d imageObj.get(s.image[\u0027id\u0027])"},{"line_number":1190,"context_line":"                    except Exception:"},{"line_number":1191,"context_line":"                        pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_fdf5a8cb","line":1188,"updated":"2018-03-16 16:24:31.000000000","message":"Can this line can be moved outside of the for loop so that we dont get a new instance of this client_manager on each iteration?","commit_id":"f60360bf902c1c24a59cda07a00d89f0ebfdd0f0"},{"author":{"_account_id":9452,"name":"James Penick","email":"penick@verizonmedia.com","username":"epim"},"change_message_id":"289071015bcf7a881b7064547937eaf6d459c0ee","unresolved":false,"context_lines":[{"line_number":1185,"context_line":"                    # the operator may have cleaned up soft-deleted images"},{"line_number":1186,"context_line":"                    # drop any exceptions."},{"line_number":1187,"context_line":"                    try:"},{"line_number":1188,"context_line":"                        imageObj \u003d self.app.client_manager.image.images"},{"line_number":1189,"context_line":"                        images[s.image[\u0027id\u0027]] \u003d imageObj.get(s.image[\u0027id\u0027])"},{"line_number":1190,"context_line":"                    except Exception:"},{"line_number":1191,"context_line":"                        pass"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_f8913653","line":1188,"in_reply_to":"df7087c5_fdf5a8cb","updated":"2018-03-16 16:28:44.000000000","message":"Ah, yes we can. Good catch. Thanks!","commit_id":"f60360bf902c1c24a59cda07a00d89f0ebfdd0f0"},{"author":{"_account_id":23644,"name":"Ryan Bridges","email":"rybridges16@gmail.com","username":"Patchett"},"change_message_id":"0e4b9eec5cf97409c6f75678578a41ee611ba865","unresolved":false,"context_lines":[{"line_number":1186,"context_line":"                    # drop any exceptions."},{"line_number":1187,"context_line":"                    try:"},{"line_number":1188,"context_line":"                        imageObj \u003d self.app.client_manager.image.images"},{"line_number":1189,"context_line":"                        images[s.image[\u0027id\u0027]] \u003d imageObj.get(s.image[\u0027id\u0027])"},{"line_number":1190,"context_line":"                    except Exception:"},{"line_number":1191,"context_line":"                        pass"},{"line_number":1192,"context_line":"                image \u003d images.get(s.image[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_5d085490","line":1189,"updated":"2018-03-16 16:24:31.000000000","message":"Rather than doing imageObj.get() on every iteration, could we instead first check if the images dict already contains an entry for the image id in question, and only then do the lookup? I am thinking something like this:\n\n\nif images.get(s.image[\u0027id\u0027]) is None:\n    images[s.image[\u0027id\u0027]] \u003d imageObj.get(s.image[\u0027id\u0027])","commit_id":"f60360bf902c1c24a59cda07a00d89f0ebfdd0f0"},{"author":{"_account_id":23644,"name":"Ryan Bridges","email":"rybridges16@gmail.com","username":"Patchett"},"change_message_id":"813ba89a6f00c0d10bd0af68edd65df35972f288","unresolved":false,"context_lines":[{"line_number":1186,"context_line":"                    # drop any exceptions."},{"line_number":1187,"context_line":"                    try:"},{"line_number":1188,"context_line":"                        imageObj \u003d self.app.client_manager.image.images"},{"line_number":1189,"context_line":"                        images[s.image[\u0027id\u0027]] \u003d imageObj.get(s.image[\u0027id\u0027])"},{"line_number":1190,"context_line":"                    except Exception:"},{"line_number":1191,"context_line":"                        pass"},{"line_number":1192,"context_line":"                image \u003d images.get(s.image[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_5864e249","line":1189,"in_reply_to":"df7087c5_380fae88","updated":"2018-03-16 18:09:51.000000000","message":"Done","commit_id":"f60360bf902c1c24a59cda07a00d89f0ebfdd0f0"},{"author":{"_account_id":9452,"name":"James Penick","email":"penick@verizonmedia.com","username":"epim"},"change_message_id":"289071015bcf7a881b7064547937eaf6d459c0ee","unresolved":false,"context_lines":[{"line_number":1186,"context_line":"                    # drop any exceptions."},{"line_number":1187,"context_line":"                    try:"},{"line_number":1188,"context_line":"                        imageObj \u003d self.app.client_manager.image.images"},{"line_number":1189,"context_line":"                        images[s.image[\u0027id\u0027]] \u003d imageObj.get(s.image[\u0027id\u0027])"},{"line_number":1190,"context_line":"                    except Exception:"},{"line_number":1191,"context_line":"                        pass"},{"line_number":1192,"context_line":"                image \u003d images.get(s.image[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_b8d3be00","line":1189,"in_reply_to":"df7087c5_5d085490","updated":"2018-03-16 16:28:44.000000000","message":"That\u0027s what I did above on line 1182 and 1183, which is to only fetch the image if the following conditions are true: not parsed_args.no_name_lookup and the image is not already in the images dict","commit_id":"f60360bf902c1c24a59cda07a00d89f0ebfdd0f0"},{"author":{"_account_id":23644,"name":"Ryan Bridges","email":"rybridges16@gmail.com","username":"Patchett"},"change_message_id":"5c90ea80c2c423ee0c0bba7a7c41f2b190412d38","unresolved":false,"context_lines":[{"line_number":1186,"context_line":"                    # drop any exceptions."},{"line_number":1187,"context_line":"                    try:"},{"line_number":1188,"context_line":"                        imageObj \u003d self.app.client_manager.image.images"},{"line_number":1189,"context_line":"                        images[s.image[\u0027id\u0027]] \u003d imageObj.get(s.image[\u0027id\u0027])"},{"line_number":1190,"context_line":"                    except Exception:"},{"line_number":1191,"context_line":"                        pass"},{"line_number":1192,"context_line":"                image \u003d images.get(s.image[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_380fae88","line":1189,"in_reply_to":"df7087c5_b8d3be00","updated":"2018-03-16 16:33:52.000000000","message":"Oh right I see that. Okay one small change we can make to that if statement then. See my above comment","commit_id":"f60360bf902c1c24a59cda07a00d89f0ebfdd0f0"}]}
