)]}'
{".mailmap":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":3,"context_line":"# \u003cpreferred e-mail\u003e \u003cother e-mail 2\u003e"},{"line_number":4,"context_line":"\u003cmr.alex.meade@gmail.com\u003e \u003chatboy112@yahoo.com\u003e"},{"line_number":5,"context_line":"\u003cmr.alex.meade@gmail.com\u003e \u003calex.meade@rackspace.com\u003e"},{"line_number":6,"context_line":"David Koo \u003cdavid.koo@huawei.com\u003e \u003ckpublicmail@gmail.com\u003e"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"1ae5cdf2_798b9068","line":6,"updated":"2014-06-16 14:00:15.000000000","message":"This format is wrong, see above line #2.","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"a1a80e4b23e1d33abad4065d9a71bcadccdccc58","unresolved":false,"context_lines":[{"line_number":3,"context_line":"# \u003cpreferred e-mail\u003e \u003cother e-mail 2\u003e"},{"line_number":4,"context_line":"\u003cmr.alex.meade@gmail.com\u003e \u003chatboy112@yahoo.com\u003e"},{"line_number":5,"context_line":"\u003cmr.alex.meade@gmail.com\u003e \u003calex.meade@rackspace.com\u003e"},{"line_number":6,"context_line":"David Koo \u003cdavid.koo@huawei.com\u003e \u003ckpublicmail@gmail.com\u003e"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"1ae5cdf2_cf33f660","line":6,"in_reply_to":"1ae5cdf2_798b9068","updated":"2014-06-16 14:05:21.000000000","message":"I actually don\u0027t think it\u0027s wrong. There are various ways to write it, AFAIK.","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"587e479b9911f58ff37a3adec09aab9d1c3079da","unresolved":false,"context_lines":[{"line_number":3,"context_line":"# \u003cpreferred e-mail\u003e \u003cother e-mail 2\u003e"},{"line_number":4,"context_line":"\u003cmr.alex.meade@gmail.com\u003e \u003chatboy112@yahoo.com\u003e"},{"line_number":5,"context_line":"\u003cmr.alex.meade@gmail.com\u003e \u003calex.meade@rackspace.com\u003e"},{"line_number":6,"context_line":"David Koo \u003cdavid.koo@huawei.com\u003e \u003ckpublicmail@gmail.com\u003e"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"1ae5cdf2_aaecd82a","line":6,"in_reply_to":"1ae5cdf2_cf33f660","updated":"2014-06-16 14:17:50.000000000","message":"if so what about change/remove above two line, #1\u00262 ?","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"}],"/COMMIT_MSG":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"be4e5037932226ba97547a98e960ad72c0f10e14","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This commit adds the following location related commands to"},{"line_number":23,"context_line":"glanceclient:"},{"line_number":24,"context_line":"    --image-location-add: Add a new location to the list of image"},{"line_number":25,"context_line":"                          locations"},{"line_number":26,"context_line":"    --image-location-delete: Remove an existing location from the list"},{"line_number":27,"context_line":"                          of image locations"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAAWH%2F%2BBho%3D","line":24,"updated":"2014-03-31 13:41:09.000000000","message":"Should this just be `-  location-add: ...` ? (same for the other cases below)","commit_id":"7568c1fa963e3659f154a10ccd00fb5cc5008c0a"}],"glanceclient/common/utils.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    ignore \u003d [\u0027self\u0027, \u0027access\u0027, \u0027file\u0027, \u0027schema\u0027]"},{"line_number":332,"context_line":"    image \u003d dict([item for item in six.iteritems(image_obj)"},{"line_number":333,"context_line":"                  if item[0] not in ignore])"},{"line_number":334,"context_line":"    if max_col_width is not None:"},{"line_number":335,"context_line":"        print_dict(image, max_column_width\u003dmax_col_width)"},{"line_number":336,"context_line":"    else:"},{"line_number":337,"context_line":"        print_dict(image)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_39f4a8ce","line":334,"updated":"2014-06-16 14:00:15.000000000","message":"nit: I think this is safer:\n\n    if str(max_col_width).isdigit():","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"}],"glanceclient/v2/images.py":[{"author":{"_account_id":9520,"name":"David Koo (koofoss)","email":"david.koo@huawei.com","username":"koofoss"},"change_message_id":"f385bc7cd98bab3e2008180ea1960bc5ba03573c","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        # we need to fetch the image again to get a clean history. This is"},{"line_number":172,"context_line":"        # an obvious optimization for warlock"},{"line_number":173,"context_line":"        return self.get(image_id)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _get_image_with_locations_or_fail(self, image_id):"},{"line_number":176,"context_line":"        image \u003d self.get(image_id)"},{"line_number":177,"context_line":"        if getattr(image, \u0027locations\u0027, None) is None:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUX%2F%2Fvwk%3D","line":174,"updated":"2014-02-11 03:30:59.000000000","message":"Reviewers please note: There is another alternative (but similar) fix for this bug in https://review.openstack.org/#/c/71824/\n\nThe difference is that this patchset defines new location related CLI commands to work on locations and also adds corresponding handlers in the Controller class. In https://review.openstack.org/#/c/71824/ location related commands piggy-back the existing image-update CLI command and handler.\n\nThe intention is that one of the two implementations be chosen and the other discarded. So please take a look at that patchset too.\n\nI personally prefer this patchset - it\u0027s cleaner.","commit_id":"71143ed42a2c2f81d877b4b93321498074504287"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        :param image_id: ID of image to which the location is to be added."},{"line_number":197,"context_line":"        :param url: URL of the location to add."},{"line_number":198,"context_line":"        :param metadata: Metadata associated with the location."},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        image \u003d self._get_image_with_locations_or_fail(image_id)"},{"line_number":201,"context_line":"        url_list \u003d [l[\u0027url\u0027] for l in image.locations]"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_6c6750b8","line":198,"updated":"2014-06-16 14:00:15.000000000","message":"what about adding a \"returns\" line.","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        image \u003d self._get_image_with_locations_or_fail(image_id)"},{"line_number":201,"context_line":"        url_list \u003d [l[\u0027url\u0027] for l in image.locations]"},{"line_number":202,"context_line":"        if url in url_list:"},{"line_number":203,"context_line":"            err_str \u003d \u0027A location entry at %s already exists\u0027 % url"},{"line_number":204,"context_line":"            raise exc.HTTPConflict(err_str)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        add_patch \u003d [{\u0027op\u0027: \u0027add\u0027, \u0027path\u0027: \u0027/locations/-\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_3907481f","line":203,"updated":"2014-06-16 14:00:15.000000000","message":"nit: to be consistent (line #180), I like to add a period at the last of message.","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        \"\"\"Remove one or more location entries of an image."},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        :param image_id: ID of image from which locations are to be removed."},{"line_number":215,"context_line":"        :param url_set: set of URLs of location entries to remove."},{"line_number":216,"context_line":"        \"\"\""},{"line_number":217,"context_line":"        image \u003d self._get_image_with_locations_or_fail(image_id)"},{"line_number":218,"context_line":"        current_urls \u003d [l[\u0027url\u0027] for l in image.locations]"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_8c03bcbd","line":215,"updated":"2014-06-16 14:00:15.000000000","message":"\"returns\" line","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        missing_locs \u003d url_set.difference(set(current_urls))"},{"line_number":221,"context_line":"        if missing_locs:"},{"line_number":222,"context_line":"            raise exc.HTTPNotFound(\u0027Unknown URL(s): %s\u0027 % list(missing_locs))"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        # NOTE: warlock doesn\u0027t generate the most efficient patch for remove"},{"line_number":225,"context_line":"        # operations (it shifts everything up and deletes the tail elements) so"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_6c183076","line":222,"updated":"2014-06-16 14:00:15.000000000","message":"period","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        # we do it ourselves."},{"line_number":227,"context_line":"        url_indices \u003d [current_urls.index(url) for url in url_set]"},{"line_number":228,"context_line":"        url_indices.sort(reverse\u003dTrue)"},{"line_number":229,"context_line":"        patches \u003d [{\u0027op\u0027: \u0027remove\u0027, \u0027path\u0027: \u0027/locations/%s\u0027 % url_idx}"},{"line_number":230,"context_line":"                   for url_idx in url_indices]"},{"line_number":231,"context_line":"        self._send_image_update_request(image_id, patches)"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_2c6388de","line":229,"updated":"2014-06-16 14:00:15.000000000","message":"It has potential race condition issue. But I\u0027m OK currently.","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        :param image_id: ID of image whose location is to be updated."},{"line_number":240,"context_line":"        :param url: URL of the location to update."},{"line_number":241,"context_line":"        :param metadata: Metadata associated with the location."},{"line_number":242,"context_line":"        \"\"\""},{"line_number":243,"context_line":"        image \u003d self._get_image_with_locations_or_fail(image_id)"},{"line_number":244,"context_line":"        url_map \u003d dict([(l[\u0027url\u0027], l) for l in image.locations])"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_8cd1fc31","line":241,"updated":"2014-06-16 14:00:15.000000000","message":"\"returns\" line","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":243,"context_line":"        image \u003d self._get_image_with_locations_or_fail(image_id)"},{"line_number":244,"context_line":"        url_map \u003d dict([(l[\u0027url\u0027], l) for l in image.locations])"},{"line_number":245,"context_line":"        if url not in url_map:"},{"line_number":246,"context_line":"            raise exc.HTTPNotFound(\u0027Unknown URL: %s\u0027 % url)"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        if url_map[url][\u0027metadata\u0027] \u003d\u003d metadata:"},{"line_number":249,"context_line":"            return image"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_8cb81cea","line":246,"updated":"2014-06-16 14:00:15.000000000","message":"period","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5b0495cd4beab332925650413c33d8682ac3d90c","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        #   2. Send another request to set \u0027locations\u0027 to the new list"},{"line_number":255,"context_line":"        #      of locations."},{"line_number":256,"context_line":"        url_map[url][\u0027metadata\u0027] \u003d metadata"},{"line_number":257,"context_line":"        for p in ([], list(url_map.values())):"},{"line_number":258,"context_line":"            patch \u003d [{\u0027op\u0027: \u0027replace\u0027, \u0027path\u0027: \u0027/locations\u0027, \u0027value\u0027: p}]"},{"line_number":259,"context_line":"            self._send_image_update_request(image_id, patch)"},{"line_number":260,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_ac98781c","line":257,"updated":"2014-06-16 14:00:15.000000000","message":"To improve performance and to prevent race condition issue as much as possible, we can do a minor tuning, IMO:\n\n    patches \u003d [{\u0027op\u0027: \u0027replace\u0027, \u0027path\u0027: \u0027/locations\u0027, \u0027value\u0027: p} for p in ([], list(url_map.values()))]\n\nAnd calling \"self._send_image_update_request(image_id, patches)\" one time only.","commit_id":"774a1be7ea9f9daa2b742eaf947714ee9b599aaf"}],"glanceclient/v2/shell.py":[{"author":{"_account_id":9520,"name":"David Koo (koofoss)","email":"david.koo@huawei.com","username":"koofoss"},"change_message_id":"f385bc7cd98bab3e2008180ea1960bc5ba03573c","unresolved":false,"context_lines":[{"line_number":147,"context_line":"@utils.arg(\u0027member_id\u0027, metavar\u003d\u0027\u003cMEMBER_ID\u003e\u0027,"},{"line_number":148,"context_line":"           help\u003d\u0027Tenant to remove as member\u0027)"},{"line_number":149,"context_line":"def do_member_delete(gc, args):"},{"line_number":150,"context_line":"    \"\"\"Delete image member\"\"\""},{"line_number":151,"context_line":"    if not (args.image_id and args.member_id):"},{"line_number":152,"context_line":"        utils.exit(\u0027Unable to delete member. Specify image_id and member_id\u0027)"},{"line_number":153,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUX%2F%2Fvvc%3D","line":150,"updated":"2014-02-11 03:30:59.000000000","message":"Note to reviewers: I think this check (and similarly in some other places below) is redundant because argparse will do that checking. But I didn\u0027t remove this code because it isn\u0027t directly related to this bugfix. If it\u0027s OK with the reviewers I can update the patchset to remove this code (and related tests).","commit_id":"71143ed42a2c2f81d877b4b93321498074504287"},{"author":{"_account_id":9520,"name":"David Koo (koofoss)","email":"david.koo@huawei.com","username":"koofoss"},"change_message_id":"f385bc7cd98bab3e2008180ea1960bc5ba03573c","unresolved":false,"context_lines":[{"line_number":243,"context_line":"           help\u003d\u0027Image to be updated with the given tag\u0027)"},{"line_number":244,"context_line":"@utils.arg(\u0027tag_value\u0027, metavar\u003d\u0027\u003cTAG_VALUE\u003e\u0027,"},{"line_number":245,"context_line":"           help\u003d\u0027Value of the tag\u0027)"},{"line_number":246,"context_line":"def do_image_tag_update(gc, args):"},{"line_number":247,"context_line":"        \"\"\"Update an image with the given tag.\"\"\""},{"line_number":248,"context_line":"        if not (args.image_id and args.tag_value):"},{"line_number":249,"context_line":"            utils.exit(\u0027Unable to update tag. Specify image_id and tag_value\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUX%2F%2FvvQ%3D","line":246,"updated":"2014-02-11 03:30:59.000000000","message":"... till on the theme of \"cleaning up\" - this can be re-indented too (too much indent here).","commit_id":"71143ed42a2c2f81d877b4b93321498074504287"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"e5391ddc95ac03bd2cb4cd26407cab7eaec5aae2","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    return IMAGE_SCHEMA"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def _print_image(image_obj, max_col_width\u003dNone):"},{"line_number":39,"context_line":"    ignore \u003d [\u0027self\u0027, \u0027access\u0027, \u0027file\u0027, \u0027schema\u0027]"},{"line_number":40,"context_line":"    image \u003d dict([item for item in six.iteritems(image_obj)"},{"line_number":41,"context_line":"                  if item[0] not in ignore])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_2143b6af","line":38,"updated":"2014-05-20 07:43:13.000000000","message":"I think this could be moved into `utils.py`, you\u0027d do something like:\n\n    utils.print_image(image, ...)","commit_id":"9fb47deec87e610e7302c65c7d56fffec691dcda"}],"tests/v2/test_images.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"e5391ddc95ac03bd2cb4cd26407cab7eaec5aae2","unresolved":false,"context_lines":[{"line_number":709,"context_line":"        err \u003d self.assertRaises(exc.HTTPConflict,"},{"line_number":710,"context_line":"                                self.controller.add_location,"},{"line_number":711,"context_line":"                                image_id, **new_loc)"},{"line_number":712,"context_line":"        self.assertTrue(err_str in str(err))"},{"line_number":713,"context_line":""},{"line_number":714,"context_line":"    def test_remove_location(self):"},{"line_number":715,"context_line":"        image_id \u003d \u0027a2b83adc-888e-11e3-8872-78acc0b951d8\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_014ddac3","line":712,"updated":"2014-05-20 07:43:13.000000000","message":"You can also do:\n\n    self.assertIn(err_str, str(err))","commit_id":"9fb47deec87e610e7302c65c7d56fffec691dcda"}]}
