)]}'
{"glance/api/v2/images.py":[{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"6f30adb7d8c6ecf4438279a9b39cb1e74817c760","unresolved":false,"context_lines":[{"line_number":579,"context_line":""},{"line_number":580,"context_line":"            if CONF.show_multiple_locations:"},{"line_number":581,"context_line":"                if image.locations:"},{"line_number":582,"context_line":"                    image_view[\u0027locations\u0027] \u003d list(image.locations)"},{"line_number":583,"context_line":"                else:"},{"line_number":584,"context_line":"                    # NOTE (flwang): We will still show \"locations\": [] if"},{"line_number":585,"context_line":"                    # image.locations is None to indicate it\u0027s allowed to show"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F95qk%3D","line":582,"updated":"2014-02-02 03:58:19.000000000","message":"Should we leverage the location strategy as well?","commit_id":"f8fe7d51d16b5b08c63771dba7b7f167d775262c"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8802c0ea4d8b8ab93d2fcd6b29cdb942b4149fb6","unresolved":false,"context_lines":[{"line_number":579,"context_line":""},{"line_number":580,"context_line":"            if CONF.show_multiple_locations:"},{"line_number":581,"context_line":"                if image.locations:"},{"line_number":582,"context_line":"                    image_view[\u0027locations\u0027] \u003d list(image.locations)"},{"line_number":583,"context_line":"                else:"},{"line_number":584,"context_line":"                    # NOTE (flwang): We will still show \"locations\": [] if"},{"line_number":585,"context_line":"                    # image.locations is None to indicate it\u0027s allowed to show"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F9nuM%3D","line":582,"in_reply_to":"AAAAUH%2F95qk%3D","updated":"2014-02-05 16:10:55.000000000","message":"I believe it already been handled at https://review.openstack.org/#/c/58482/6/glance/db/__init__.py (and so test case say ok)","commit_id":"f8fe7d51d16b5b08c63771dba7b7f167d775262c"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"6f30adb7d8c6ecf4438279a9b39cb1e74817c760","unresolved":false,"context_lines":[{"line_number":590,"context_line":"                # Choose best location configured strategy"},{"line_number":591,"context_line":"                best_location \u003d ("},{"line_number":592,"context_line":"                    location_strategy.choose_best_location(image.locations))"},{"line_number":593,"context_line":"                image_view[\u0027direct_url\u0027] \u003d best_location[\u0027url\u0027]"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"            image_view[\u0027tags\u0027] \u003d list(image.tags)"},{"line_number":596,"context_line":"            image_view[\u0027self\u0027] \u003d self._get_image_href(image)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F95qU%3D","line":593,"updated":"2014-02-02 03:58:19.000000000","message":"Should we check if the best_location is None and then use the default first location?","commit_id":"f8fe7d51d16b5b08c63771dba7b7f167d775262c"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8802c0ea4d8b8ab93d2fcd6b29cdb942b4149fb6","unresolved":false,"context_lines":[{"line_number":590,"context_line":"                # Choose best location configured strategy"},{"line_number":591,"context_line":"                best_location \u003d ("},{"line_number":592,"context_line":"                    location_strategy.choose_best_location(image.locations))"},{"line_number":593,"context_line":"                image_view[\u0027direct_url\u0027] \u003d best_location[\u0027url\u0027]"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"            image_view[\u0027tags\u0027] \u003d list(image.tags)"},{"line_number":596,"context_line":"            image_view[\u0027self\u0027] \u003d self._get_image_href(image)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F9nrc%3D","line":593,"in_reply_to":"AAAAUH%2F95qU%3D","updated":"2014-02-05 16:10:55.000000000","message":"IMO/under my design, if image.locations has any available entry, the choose_best_location() will never return None, otherwise if choose_best_location() return None then that means image.locations has no available entry. Do you think there is any thing I missed?","commit_id":"f8fe7d51d16b5b08c63771dba7b7f167d775262c"}],"glance/tests/functional/v2/test_images.py":[{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"6f30adb7d8c6ecf4438279a9b39cb1e74817c760","unresolved":false,"context_lines":[{"line_number":2010,"context_line":"        base_headers.update(custom_headers or {})"},{"line_number":2011,"context_line":"        return base_headers"},{"line_number":2012,"context_line":""},{"line_number":2013,"context_line":"    def test_image_locationw_with_order_strategy(self):"},{"line_number":2014,"context_line":"        self.api_server.show_image_direct_url \u003d True"},{"line_number":2015,"context_line":"        self.api_server.show_multiple_locations \u003d True"},{"line_number":2016,"context_line":"        self.image_location_quota \u003d 10"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F95rY%3D","line":2013,"updated":"2014-02-02 03:58:19.000000000","message":"(nit): Given the strategy \u0027location_order\u0027 has the same behaviour with current design(w/o location select strategy), so what\u0027s the benefit of this case?","commit_id":"f8fe7d51d16b5b08c63771dba7b7f167d775262c"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8802c0ea4d8b8ab93d2fcd6b29cdb942b4149fb6","unresolved":false,"context_lines":[{"line_number":2010,"context_line":"        base_headers.update(custom_headers or {})"},{"line_number":2011,"context_line":"        return base_headers"},{"line_number":2012,"context_line":""},{"line_number":2013,"context_line":"    def test_image_locationw_with_order_strategy(self):"},{"line_number":2014,"context_line":"        self.api_server.show_image_direct_url \u003d True"},{"line_number":2015,"context_line":"        self.api_server.show_multiple_locations \u003d True"},{"line_number":2016,"context_line":"        self.image_location_quota \u003d 10"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F9nps%3D","line":2013,"in_reply_to":"AAAAUH%2F95rY%3D","updated":"2014-02-05 16:10:55.000000000","message":"This stuff can make me sure \u0027location_order\u0027 plug-in work as I designed, for now and in future if/when we change \u0027location_order\u0027 strategy and/or add other plug-in. Anyway IMO more testing could make us more confidence, right.","commit_id":"f8fe7d51d16b5b08c63771dba7b7f167d775262c"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"6f30adb7d8c6ecf4438279a9b39cb1e74817c760","unresolved":false,"context_lines":[{"line_number":2115,"context_line":"        response \u003d requests.patch(path, headers\u003dheaders, data\u003ddata)"},{"line_number":2116,"context_line":"        self.assertEqual(200, response.status_code)"},{"line_number":2117,"context_line":""},{"line_number":2118,"context_line":"        values.sort(key\u003dlambda loc: int(loc[\u0027metadata\u0027][\u0027idx\u0027]))"},{"line_number":2119,"context_line":""},{"line_number":2120,"context_line":"        # Image locations should be visible"},{"line_number":2121,"context_line":"        path \u003d self._url(\u0027/v2/images/%s\u0027 % image_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F95qs%3D","line":2118,"updated":"2014-02-02 03:58:19.000000000","message":"(nit): I understand this is an easy way to mock the ordered locations list, but would you mind add a comment to note it\u0027s a fake/mock to avoid confusion?","commit_id":"f8fe7d51d16b5b08c63771dba7b7f167d775262c"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8802c0ea4d8b8ab93d2fcd6b29cdb942b4149fb6","unresolved":false,"context_lines":[{"line_number":2115,"context_line":"        response \u003d requests.patch(path, headers\u003dheaders, data\u003ddata)"},{"line_number":2116,"context_line":"        self.assertEqual(200, response.status_code)"},{"line_number":2117,"context_line":""},{"line_number":2118,"context_line":"        values.sort(key\u003dlambda loc: int(loc[\u0027metadata\u0027][\u0027idx\u0027]))"},{"line_number":2119,"context_line":""},{"line_number":2120,"context_line":"        # Image locations should be visible"},{"line_number":2121,"context_line":"        path \u003d self._url(\u0027/v2/images/%s\u0027 % image_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F9no4%3D","line":2118,"in_reply_to":"AAAAUH%2F95qs%3D","updated":"2014-02-05 16:10:55.000000000","message":"humm..maybe I\u0027m confused actually I don\u0027t think this is a stuff for mock.. I just sort the list for doing follow assertions.  I don\u0027t mock anything this line.","commit_id":"f8fe7d51d16b5b08c63771dba7b7f167d775262c"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"aa1bca9ba4743712b0aaa0d709aa4645c773fa04","unresolved":false,"context_lines":[{"line_number":2115,"context_line":"        response \u003d requests.patch(path, headers\u003dheaders, data\u003ddata)"},{"line_number":2116,"context_line":"        self.assertEqual(200, response.status_code)"},{"line_number":2117,"context_line":""},{"line_number":2118,"context_line":"        values.sort(key\u003dlambda loc: int(loc[\u0027metadata\u0027][\u0027idx\u0027]))"},{"line_number":2119,"context_line":""},{"line_number":2120,"context_line":"        # Image locations should be visible"},{"line_number":2121,"context_line":"        path \u003d self._url(\u0027/v2/images/%s\u0027 % image_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F9kC8%3D","line":2118,"in_reply_to":"AAAAUH%2F9no4%3D","updated":"2014-02-06 01:30:53.000000000","message":"I mean it would be nice if there is a comment to say the sort is just a facilitator instead of indicating we\u0027re using this kind of way for the location ordering. Sorry for the confusion.","commit_id":"f8fe7d51d16b5b08c63771dba7b7f167d775262c"}]}
