)]}'
{"glance/api/v2/images.py":[{"author":{"_account_id":27882,"name":"Piotr Bielak","email":"piotrbielak2@gmail.com","username":"pbielak"},"change_message_id":"4ab7952c95c85f3ae3959e6aad03fbc5ada770a4","unresolved":false,"context_lines":[{"line_number":377,"context_line":""},{"line_number":378,"context_line":"        _conflict \u003d None"},{"line_number":379,"context_line":""},{"line_number":380,"context_line":"        if hash_data.get(\u0027checksum\u0027,"},{"line_number":381,"context_line":"                         image.checksum) !\u003d image.checksum:"},{"line_number":382,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":383,"context_line":"                _conflict \u003d _(\"New checksum may only be provided if image\""},{"line_number":384,"context_line":"                              \" status is \u0027queued\u0027.\")"},{"line_number":385,"context_line":"            elif image.checksum:"},{"line_number":386,"context_line":"                _conflict \u003d _(\"Checksum is already set and is immutable.\")"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"        if hash_data.get(\u0027os_hash_algo\u0027,"},{"line_number":389,"context_line":"                         image.os_hash_algo) !\u003d image.os_hash_algo:"},{"line_number":390,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":391,"context_line":"                _conflict \u003d _(\"New os_hash_algo may only be provided if image\""},{"line_number":392,"context_line":"                              \" status is \u0027queued\u0027.\")"},{"line_number":393,"context_line":"            elif image.os_hash_algo:"},{"line_number":394,"context_line":"                _conflict \u003d _(\"os_hash_algo is already set and is immutable.\")"},{"line_number":395,"context_line":""},{"line_number":396,"context_line":"        if hash_data.get(\u0027os_hash_value\u0027,"},{"line_number":397,"context_line":"                         image.os_hash_value) !\u003d image.os_hash_value:"},{"line_number":398,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":399,"context_line":"                _conflict \u003d _(\"New os_hash_value may only be provided if image\""},{"line_number":400,"context_line":"                              \" status is \u0027queued\u0027.\")"},{"line_number":401,"context_line":"            elif image.os_hash_value:"},{"line_number":402,"context_line":"                _conflict \u003d _(\"os_hash_value is already set and is immutable.\")"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        if _conflict:"},{"line_number":405,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003d_conflict)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_0605387a","line":402,"range":{"start_line":380,"start_character":8,"end_line":402,"end_character":79},"updated":"2018-09-03 07:35:23.000000000","message":"You could rewrite this block as a simple for loop:\n\nfor hash_item in [\u0027checksum\u0027, \u0027os_hash_algo\u0027, \u0027os_hash_value\u0027]:\n  image_item \u003d getattr(image, hash_item)\n  if hash_data.get(hash_item, image_item) !\u003d image_item:\n    if image.status !\u003d \u0027queued\u0027:\n      _conflict \u003d _(...)\n    elif image_item:\n      _conflict \u003d _(hash_item + \"...\")","commit_id":"08047a6040df643f72533886b1adeb189c093b32"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"d7d71fe3800d52f27ff2b7dedcb621d877f00c15","unresolved":false,"context_lines":[{"line_number":377,"context_line":""},{"line_number":378,"context_line":"        _conflict \u003d None"},{"line_number":379,"context_line":""},{"line_number":380,"context_line":"        if hash_data.get(\u0027checksum\u0027,"},{"line_number":381,"context_line":"                         image.checksum) !\u003d image.checksum:"},{"line_number":382,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":383,"context_line":"                _conflict \u003d _(\"New checksum may only be provided if image\""},{"line_number":384,"context_line":"                              \" status is \u0027queued\u0027.\")"},{"line_number":385,"context_line":"            elif image.checksum:"},{"line_number":386,"context_line":"                _conflict \u003d _(\"Checksum is already set and is immutable.\")"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"        if hash_data.get(\u0027os_hash_algo\u0027,"},{"line_number":389,"context_line":"                         image.os_hash_algo) !\u003d image.os_hash_algo:"},{"line_number":390,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":391,"context_line":"                _conflict \u003d _(\"New os_hash_algo may only be provided if image\""},{"line_number":392,"context_line":"                              \" status is \u0027queued\u0027.\")"},{"line_number":393,"context_line":"            elif image.os_hash_algo:"},{"line_number":394,"context_line":"                _conflict \u003d _(\"os_hash_algo is already set and is immutable.\")"},{"line_number":395,"context_line":""},{"line_number":396,"context_line":"        if hash_data.get(\u0027os_hash_value\u0027,"},{"line_number":397,"context_line":"                         image.os_hash_value) !\u003d image.os_hash_value:"},{"line_number":398,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":399,"context_line":"                _conflict \u003d _(\"New os_hash_value may only be provided if image\""},{"line_number":400,"context_line":"                              \" status is \u0027queued\u0027.\")"},{"line_number":401,"context_line":"            elif image.os_hash_value:"},{"line_number":402,"context_line":"                _conflict \u003d _(\"os_hash_value is already set and is immutable.\")"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        if _conflict:"},{"line_number":405,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003d_conflict)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_93a5e1a1","line":402,"range":{"start_line":380,"start_character":8,"end_line":402,"end_character":79},"in_reply_to":"3f79a3b5_0605387a","updated":"2018-09-04 21:30:53.000000000","message":"Thanks. I was a bit lazy with that code - I\u0027d intended to go back and convert this to a loop when I figured out the right way to get the attributes from the existing image object by name.","commit_id":"08047a6040df643f72533886b1adeb189c093b32"},{"author":{"_account_id":27882,"name":"Piotr Bielak","email":"piotrbielak2@gmail.com","username":"pbielak"},"change_message_id":"4ab7952c95c85f3ae3959e6aad03fbc5ada770a4","unresolved":false,"context_lines":[{"line_number":401,"context_line":"            elif image.os_hash_value:"},{"line_number":402,"context_line":"                _conflict \u003d _(\"os_hash_value is already set and is immutable.\")"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        if _conflict:"},{"line_number":405,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003d_conflict)"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"        return (locations, hash_data)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_46f2509c","line":404,"updated":"2018-09-03 07:35:23.000000000","message":"Another thing that I\u0027m concerned about is when multiple conflicts are present, you will only see the last checked one. Maybe create a \"_conflicts\" list and then join it back to a string before passing it to the exception below.","commit_id":"08047a6040df643f72533886b1adeb189c093b32"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"d7d71fe3800d52f27ff2b7dedcb621d877f00c15","unresolved":false,"context_lines":[{"line_number":401,"context_line":"            elif image.os_hash_value:"},{"line_number":402,"context_line":"                _conflict \u003d _(\"os_hash_value is already set and is immutable.\")"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        if _conflict:"},{"line_number":405,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003d_conflict)"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"        return (locations, hash_data)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_33dded13","line":404,"in_reply_to":"3f79a3b5_46f2509c","updated":"2018-09-04 21:30:53.000000000","message":"The importants thing here, IMO, are that it rejects the request, and that it provides a sufficient clue as to the reason.\n\nThat said; for the next PS, I\u0027ve refactored this code a bit, and made the explanation message a bit more broad.","commit_id":"08047a6040df643f72533886b1adeb189c093b32"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"98c53bb8bc010589bdcf29b984b14d6c5d27cf12","unresolved":false,"context_lines":[{"line_number":381,"context_line":""},{"line_number":382,"context_line":"        hash_algo \u003d val_data.get(\u0027os_hash_algo\u0027)"},{"line_number":383,"context_line":"        if hash_algo and hash_algo not in hashlib.algorithms:"},{"line_number":384,"context_line":"            msg \u003d _(\"os_hash_algo must be one of %s\") % str(hashlib.algorithms)"},{"line_number":385,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        if image.status !\u003d \u0027queued\u0027:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_cca573b6","line":384,"range":{"start_line":384,"start_character":60,"end_line":384,"end_character":78},"updated":"2018-10-06 00:32:55.000000000","message":"Argh! hashlib changed this to algorithms_guaranteed or algorithms_available, but that requires a minimum version of 2.7.9 (or 3.2). Will have to figure out how to handle this with requirements, or find another way.","commit_id":"ecb4345950da0c3ed68238f4ca2756b40c0b4c26"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ad07f39f70be0cebfe66c90bce9cca61f57c40e9","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            raise webob.exc.HTTPUnauthorized(explanation\u003de.msg)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _validate_validation_data(self, image, locations):"},{"line_number":370,"context_line":"        val_items \u003d [\u0027checksum\u0027, \u0027os_hash_algo\u0027, \u0027os_hash_value\u0027]"},{"line_number":371,"context_line":"        val_data \u003d {}"},{"line_number":372,"context_line":"        for loc in locations:"},{"line_number":373,"context_line":"            if \u0027validation_data\u0027 not in loc:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_21cfacb3","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":65},"updated":"2018-10-26 06:58:10.000000000","message":"is it feasible that we should add \u0027additionalProperties\u0027: False before line #1243 to avoid this validation check? If so we can eliminate line #376 to #378","commit_id":"b5474c09f9b58d2073686464f3196f74691c04be"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"b2379e5880752d54367bdd08af991767d2b2a3a6","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            raise webob.exc.HTTPUnauthorized(explanation\u003de.msg)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _validate_validation_data(self, image, locations):"},{"line_number":370,"context_line":"        val_items \u003d [\u0027checksum\u0027, \u0027os_hash_algo\u0027, \u0027os_hash_value\u0027]"},{"line_number":371,"context_line":"        val_data \u003d {}"},{"line_number":372,"context_line":"        for loc in locations:"},{"line_number":373,"context_line":"            if \u0027validation_data\u0027 not in loc:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_044dd46f","line":370,"range":{"start_line":370,"start_character":8,"end_line":370,"end_character":65},"in_reply_to":"3f79a3b5_21cfacb3","updated":"2018-10-26 15:57:23.000000000","message":"I\u0027ll test this. Thanks!","commit_id":"b5474c09f9b58d2073686464f3196f74691c04be"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ad07f39f70be0cebfe66c90bce9cca61f57c40e9","unresolved":false,"context_lines":[{"line_number":399,"context_line":"        if not new_val_data:"},{"line_number":400,"context_line":"            return {}"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":403,"context_line":"            msg \u003d _(\"New value(s) for %s may only be provided when image \""},{"line_number":404,"context_line":"                    \"status is \u0027queued\u0027\") % \u0027, \u0027.join(new_val_data.keys())"},{"line_number":405,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"        if \u0027checksum\u0027 in new_val_data:"},{"line_number":408,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_417668a5","line":405,"range":{"start_line":402,"start_character":8,"end_line":405,"end_character":57},"updated":"2018-10-26 06:58:10.000000000","message":"Should we move this to top of the function to avoid above processing if image is in queued state?","commit_id":"b5474c09f9b58d2073686464f3196f74691c04be"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"b2379e5880752d54367bdd08af991767d2b2a3a6","unresolved":false,"context_lines":[{"line_number":399,"context_line":"        if not new_val_data:"},{"line_number":400,"context_line":"            return {}"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":403,"context_line":"            msg \u003d _(\"New value(s) for %s may only be provided when image \""},{"line_number":404,"context_line":"                    \"status is \u0027queued\u0027\") % \u0027, \u0027.join(new_val_data.keys())"},{"line_number":405,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"        if \u0027checksum\u0027 in new_val_data:"},{"line_number":408,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_e449b865","line":405,"range":{"start_line":402,"start_character":8,"end_line":405,"end_character":57},"in_reply_to":"3f79a3b5_417668a5","updated":"2018-10-26 15:57:23.000000000","message":"It\u0027s here because the rejection should only happen if values were supplied and they are different from those already stored in the image properties. We don\u0027t know that until this point.","commit_id":"b5474c09f9b58d2073686464f3196f74691c04be"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ad07f39f70be0cebfe66c90bce9cca61f57c40e9","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            try:"},{"line_number":409,"context_line":"                checksum_bytes \u003d bytearray.fromhex(new_val_data[\u0027checksum\u0027])"},{"line_number":410,"context_line":"            except ValueError:"},{"line_number":411,"context_line":"                msg \u003d _(\"checksum is not a valid hexadecimal value\")"},{"line_number":412,"context_line":"                raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":413,"context_line":"            if len(checksum_bytes) !\u003d 16:"},{"line_number":414,"context_line":"                msg \u003d _(\"checksum is not the correct size\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_21980cca","line":411,"range":{"start_line":411,"start_character":25,"end_line":411,"end_character":66},"updated":"2018-10-26 06:58:10.000000000","message":"IMO it\u0027s better to print user provided checksum in the log.","commit_id":"b5474c09f9b58d2073686464f3196f74691c04be"},{"author":{"_account_id":23561,"name":"iain MacDonnell","email":"iain.macdonnell@oracle.com","username":"imacdonn"},"change_message_id":"b2379e5880752d54367bdd08af991767d2b2a3a6","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            try:"},{"line_number":409,"context_line":"                checksum_bytes \u003d bytearray.fromhex(new_val_data[\u0027checksum\u0027])"},{"line_number":410,"context_line":"            except ValueError:"},{"line_number":411,"context_line":"                msg \u003d _(\"checksum is not a valid hexadecimal value\")"},{"line_number":412,"context_line":"                raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":413,"context_line":"            if len(checksum_bytes) !\u003d 16:"},{"line_number":414,"context_line":"                msg \u003d _(\"checksum is not the correct size\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_c4527c11","line":411,"range":{"start_line":411,"start_character":25,"end_line":411,"end_character":66},"in_reply_to":"3f79a3b5_21980cca","updated":"2018-10-26 15:57:23.000000000","message":"It\u0027ll be a rather long message for a sha512 hash value, but OK...","commit_id":"b5474c09f9b58d2073686464f3196f74691c04be"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ad07f39f70be0cebfe66c90bce9cca61f57c40e9","unresolved":false,"context_lines":[{"line_number":411,"context_line":"                msg \u003d _(\"checksum is not a valid hexadecimal value\")"},{"line_number":412,"context_line":"                raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":413,"context_line":"            if len(checksum_bytes) !\u003d 16:"},{"line_number":414,"context_line":"                msg \u003d _(\"checksum is not the correct size\")"},{"line_number":415,"context_line":"                raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"        hash_algo \u003d new_val_data.get(\u0027os_hash_algo\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_a1abbcd4","line":414,"range":{"start_line":414,"start_character":25,"end_line":414,"end_character":56},"updated":"2018-10-26 06:58:10.000000000","message":"ditto? also we can add like expected size 16 something?","commit_id":"b5474c09f9b58d2073686464f3196f74691c04be"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ad07f39f70be0cebfe66c90bce9cca61f57c40e9","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        try:"},{"line_number":423,"context_line":"            hash_bytes \u003d bytearray.fromhex(new_val_data.get(\u0027os_hash_value\u0027))"},{"line_number":424,"context_line":"        except ValueError:"},{"line_number":425,"context_line":"            msg \u003d _(\"os_hash_value is not a valid hexadecimal value\")"},{"line_number":426,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":427,"context_line":"        if len(hash_bytes) !\u003d hashlib.new(hash_algo).digest_size:"},{"line_number":428,"context_line":"            msg \u003d (_(\"os_hash_value is not the correct size for %s\") %"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_c1a6f80d","line":425,"range":{"start_line":425,"start_character":21,"end_line":425,"end_character":67},"updated":"2018-10-26 06:58:10.000000000","message":"ditto","commit_id":"b5474c09f9b58d2073686464f3196f74691c04be"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ad07f39f70be0cebfe66c90bce9cca61f57c40e9","unresolved":false,"context_lines":[{"line_number":425,"context_line":"            msg \u003d _(\"os_hash_value is not a valid hexadecimal value\")"},{"line_number":426,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":427,"context_line":"        if len(hash_bytes) !\u003d hashlib.new(hash_algo).digest_size:"},{"line_number":428,"context_line":"            msg \u003d (_(\"os_hash_value is not the correct size for %s\") %"},{"line_number":429,"context_line":"                   hash_algo)"},{"line_number":430,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":431,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_2181ec4d","line":428,"range":{"start_line":428,"start_character":22,"end_line":428,"end_character":67},"updated":"2018-10-26 06:58:10.000000000","message":"ditto","commit_id":"b5474c09f9b58d2073686464f3196f74691c04be"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"f779e38635e0e56367a5a84cdf10ce55b26d860a","unresolved":false,"context_lines":[{"line_number":1248,"context_line":"                        \u0027description\u0027: _("},{"line_number":1249,"context_line":"                            \u0027Values to be used to populate the corresponding \u0027"},{"line_number":1250,"context_line":"                            \u0027image properties. If the image status is not \u0027"},{"line_number":1251,"context_line":"                            \u0027\"queued\", values must exactly match those \u0027"},{"line_number":1252,"context_line":"                            \u0027already contained in the image properties.\u0027"},{"line_number":1253,"context_line":"                        ),"},{"line_number":1254,"context_line":"                        \u0027type\u0027: \u0027object\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_760b0c2c","line":1251,"range":{"start_line":1251,"start_character":29,"end_line":1251,"end_character":37},"updated":"2018-11-09 19:42:19.000000000","message":"OK, this is super-picky, but the python string you are creating here will be turned into a JSON string, which must appear enclosed in double-quotes.  So GET v2/schemas/image is returning\n\n    \"... status is not \\\"queued\\\", values ...\"\n\nwhich doesn\u0027t look nice.  If you change the double quotes here to backslashed single quotes (\\\u0027queued\\\u0027), you get this:\n\n    \"... status is not \u0027queued\u0027, values ...\"\n\nwhich is more readable.","commit_id":"48c244fafa46e1f4eb1ea8098fa7f9bed00e25bc"}]}
