)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4378a3e67443d4045dae276849464261cfbe9b1d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"33044c2a_cd4576c7","updated":"2024-10-08 17:35:10.000000000","message":"Actually, I think it\u0027s best if nova just handles this itself instead of increasing the ambiguity from \"tell me what format this is in\". Glance already handles that level itself since it\u0027s streaming the content. So I think we should go ahead with this as it is. I\u0027ll have a patch up for nova shortly.","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e61be8fb49b3eb67edab77108c846ae5550f0d7e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"8af38558_cb057db7","updated":"2024-10-17 13:50:10.000000000","message":"Herve and Daniel, can you please review this and the patch below? We have fixes in both glance and nova waiting on these. Thanks!","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"814d3d314e9438ba196573744965f5d6833503ed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"a6c68478_58fe1593","updated":"2024-10-08 16:15:31.000000000","message":"I forgot that nova uses this exclusively through the detect function unlike glance which is processing the stream. So I probably need to multi-enlighten it as well.","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0d3610a38bc9b8755fc84cfb8a69e5382798ac59","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"13ba988d_29525d88","updated":"2024-10-07 20:38:05.000000000","message":"recheck I suspect unrelated volume error","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"}],"oslo_utils/imageutils/format_inspector.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"843b9c2254fc156d041a999dcbcba20c26db1f34","unresolved":true,"context_lines":[{"line_number":1296,"context_line":"                            hole if used improperly, but may be used to limit"},{"line_number":1297,"context_line":"                            the detected formats to some smaller scope."},{"line_number":1298,"context_line":"    \"\"\""},{"line_number":1299,"context_line":"    def __init__(self, source, expected_format\u003dNone, allowed_formats\u003dNone):"},{"line_number":1300,"context_line":"        self._source \u003d source"},{"line_number":1301,"context_line":"        self._expected_format \u003d expected_format"},{"line_number":1302,"context_line":"        self._errored_inspectors \u003d set()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ca78d78d_0334e00f","line":1299,"updated":"2024-10-08 11:32:10.000000000","message":"the alternative approach i guess would be for Nova to exclude the GPT inspector by passing all the inspectors except it\n\nbut I think I agree that adding format and explicitly using that in the iso case and then verifying the resultant formats with all inspectors enabled is safer.\n\n\nthis does provide a cleaner interface for the client application to express this policy.","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"76ecc5b362452298361fdc2ac5326f40fb1ac224","unresolved":true,"context_lines":[{"line_number":1296,"context_line":"                            hole if used improperly, but may be used to limit"},{"line_number":1297,"context_line":"                            the detected formats to some smaller scope."},{"line_number":1298,"context_line":"    \"\"\""},{"line_number":1299,"context_line":"    def __init__(self, source, expected_format\u003dNone, allowed_formats\u003dNone):"},{"line_number":1300,"context_line":"        self._source \u003d source"},{"line_number":1301,"context_line":"        self._expected_format \u003d expected_format"},{"line_number":1302,"context_line":"        self._errored_inspectors \u003d set()"}],"source_content_type":"text/x-python","patch_set":1,"id":"d87762ab_88821c1c","line":1299,"in_reply_to":"ca78d78d_0334e00f","updated":"2024-10-08 14:41:05.000000000","message":"Yeah, but I don\u0027t want us to not notice that something is X because we\u0027re expecting only Y. I\u0027d rather it see the dual-match and decide that it\u0027s okay in a given scenario and for only a given combination. Like, you wouldn\u0027t want to open another attack vector where you can slip in something like qcow-and-iso because we\u0027re only looking for qcow or similar.","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"95eb96059c93a4168141fdf36390b15f50663157","unresolved":false,"context_lines":[{"line_number":1296,"context_line":"                            hole if used improperly, but may be used to limit"},{"line_number":1297,"context_line":"                            the detected formats to some smaller scope."},{"line_number":1298,"context_line":"    \"\"\""},{"line_number":1299,"context_line":"    def __init__(self, source, expected_format\u003dNone, allowed_formats\u003dNone):"},{"line_number":1300,"context_line":"        self._source \u003d source"},{"line_number":1301,"context_line":"        self._expected_format \u003d expected_format"},{"line_number":1302,"context_line":"        self._errored_inspectors \u003d set()"}],"source_content_type":"text/x-python","patch_set":1,"id":"574ba92b_9af26cd0","line":1299,"in_reply_to":"d87762ab_88821c1c","updated":"2024-10-08 15:36:54.000000000","message":"right i was thinking more \"all_inspecotrs - gpt\"\n\nbut i prefer this approch of propviding a api to ask for multipel matches if there reasonably can be.","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"843b9c2254fc156d041a999dcbcba20c26db1f34","unresolved":true,"context_lines":[{"line_number":1391,"context_line":"                # If nothing *specific* matched, we return the raw format to"},{"line_number":1392,"context_line":"                # indicate that we do not recognize this content at all."},{"line_number":1393,"context_line":"                return [x for x in self._inspectors if str(x) \u003d\u003d \u0027raw\u0027]"},{"line_number":1394,"context_line":"            except IndexError:"},{"line_number":1395,"context_line":"                raise ImageFormatError("},{"line_number":1396,"context_line":"                    \u0027Content does not match any allowed format\u0027)"},{"line_number":1397,"context_line":"        return matches"}],"source_content_type":"text/x-python","patch_set":1,"id":"6197bb9d_b7fa1fce","line":1394,"range":{"start_line":1394,"start_character":12,"end_line":1394,"end_character":30},"updated":"2024-10-08 11:32:10.000000000","message":"this branch is taken when allowed_formats is specifed and raw is not one of them correct.\n\nnit: we could also do isInstance(x, RawFileInspector) instead of str(x) \u003d\u003d \u0027raw\u0027\nagain im not sure that is nessiarly better but its a little less opaque then relying on the string names of the inspectors.\n\nthis is just a general observation not a request for change.","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"95eb96059c93a4168141fdf36390b15f50663157","unresolved":false,"context_lines":[{"line_number":1391,"context_line":"                # If nothing *specific* matched, we return the raw format to"},{"line_number":1392,"context_line":"                # indicate that we do not recognize this content at all."},{"line_number":1393,"context_line":"                return [x for x in self._inspectors if str(x) \u003d\u003d \u0027raw\u0027]"},{"line_number":1394,"context_line":"            except IndexError:"},{"line_number":1395,"context_line":"                raise ImageFormatError("},{"line_number":1396,"context_line":"                    \u0027Content does not match any allowed format\u0027)"},{"line_number":1397,"context_line":"        return matches"}],"source_content_type":"text/x-python","patch_set":1,"id":"1de38095_363510a7","line":1394,"range":{"start_line":1394,"start_character":12,"end_line":1394,"end_character":30},"in_reply_to":"5dd6868b_59b44178","updated":"2024-10-08 15:36:54.000000000","message":"ah yes that makes sense (subclassing), i expected you had a reason i was mainly tyring to decide if i care that we had a free standing string rather then using a shared constant\n\nlike  str(x) \u003d\u003d str(RawFileInspector()) or soemthing but i think what you have is fine.\n\nthanks for confirming","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"76ecc5b362452298361fdc2ac5326f40fb1ac224","unresolved":true,"context_lines":[{"line_number":1391,"context_line":"                # If nothing *specific* matched, we return the raw format to"},{"line_number":1392,"context_line":"                # indicate that we do not recognize this content at all."},{"line_number":1393,"context_line":"                return [x for x in self._inspectors if str(x) \u003d\u003d \u0027raw\u0027]"},{"line_number":1394,"context_line":"            except IndexError:"},{"line_number":1395,"context_line":"                raise ImageFormatError("},{"line_number":1396,"context_line":"                    \u0027Content does not match any allowed format\u0027)"},{"line_number":1397,"context_line":"        return matches"}],"source_content_type":"text/x-python","patch_set":1,"id":"5dd6868b_59b44178","line":1394,"range":{"start_line":1394,"start_character":12,"end_line":1394,"end_character":30},"in_reply_to":"6197bb9d_b7fa1fce","updated":"2024-10-08 14:41:05.000000000","message":"\u003e this branch is taken when allowed_formats is specifed and raw is not one of them correct.\n\nYep.\n \n\u003e nit: we could also do isInstance(x, RawFileInspector) instead of str(x) \u003d\u003d \u0027raw\u0027\n\u003e again im not sure that is nessiarly better but its a little less opaque then relying on the string names of the inspectors.\n\u003e \n\u003e this is just a general observation not a request for change.\n\nThe reason I\u0027m doing the string format comparison everywhere is that I don\u0027t want to introduce a situation where we subclass the GPTInspector for MBRInspector, or Qcow2Inspector for Qcow3Inspector and then pass one of these checks because they\u0027re a subclass. There\u0027s a test in oslo here that ensures they all claim a unique \"format name\" and so I think the safest thing is to rely on that and never let python inheritance fool us into thinking something is safe/allowed/whatever if it\u0027s not.","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"843b9c2254fc156d041a999dcbcba20c26db1f34","unresolved":true,"context_lines":[{"line_number":1417,"context_line":"            # nefarious going on (i.e. hiding one header in another)."},{"line_number":1418,"context_line":"            raise ImageFormatError(\u0027Multiple formats detected: %s\u0027 % \u0027,\u0027.join("},{"line_number":1419,"context_line":"                str(i) for i in matches))"},{"line_number":1420,"context_line":"        else:"},{"line_number":1421,"context_line":"            try:"},{"line_number":1422,"context_line":"                # The expected outcome of this is a single match of something"},{"line_number":1423,"context_line":"                # specific"},{"line_number":1424,"context_line":"                return matches[0]"},{"line_number":1425,"context_line":"            except IndexError:"},{"line_number":1426,"context_line":"                raise ImageFormatError("},{"line_number":1427,"context_line":"                    \u0027Content does not match any allowed format\u0027)"},{"line_number":1428,"context_line":""},{"line_number":1429,"context_line":""},{"line_number":1430,"context_line":"ALL_FORMATS \u003d {"}],"source_content_type":"text/x-python","patch_set":1,"id":"d7a41684_4cc9edf9","line":1427,"range":{"start_line":1420,"start_character":4,"end_line":1427,"end_character":64},"updated":"2024-10-08 11:32:10.000000000","message":"we could remove the try except like this\n\n```suggestion\n        elif matches:\n            # The expected outcome of this is a single match of something\n            # specific\n            return matches[0]\n        else\n            raise ImageFormatError(\n                \u0027Content does not match any allowed format\u0027)\n```\n\nor \n\n```\n        elif matches:\n            # The expected outcome of this is a single match of something\n            # specific\n            return matches[0]\n        raise ImageFormatError(\u0027Content does not match any allowed format\u0027)\n```\nif you do not want the final else\n\nim not sure if that is better but just something to consider.","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"}],"oslo_utils/tests/imageutils/test_format_inspector.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"843b9c2254fc156d041a999dcbcba20c26db1f34","unresolved":true,"context_lines":[{"line_number":350,"context_line":""},{"line_number":351,"context_line":"        # Make sure the multiple detected formats are exposed"},{"line_number":352,"context_line":"        self.assertEqual([\u0027iso\u0027, \u0027qcow2\u0027],"},{"line_number":353,"context_line":"                         sorted(x.NAME for x in wrapper.formats))"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    def test_from_file_reads_minimum(self):"},{"line_number":356,"context_line":"        img \u003d self._create_img(\u0027qcow2\u0027, 10 * units.Mi)"}],"source_content_type":"text/x-python","patch_set":1,"id":"04548ca6_78183e5a","line":353,"updated":"2024-10-08 11:32:10.000000000","message":"+1","commit_id":"3d4ae167cc1cc3509669a2c30f44e8d31ba39e3f"}]}
