)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"a7c8fda1d54857163c3f347998e4e30df0e5b94a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"e754d82d_cd68b6a1","updated":"2021-11-16 21:41:40.000000000","message":"I found some points to consider before going ahead.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":33594,"name":"Thales Elero Cervi","display_name":"Thales Cervi","email":"thaleselero.cervi@windriver.com","username":"tcervi"},"change_message_id":"a6025eff1e0b149951d515e9cd81bf666bf6fe1b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"962c6646_a5cced63","updated":"2021-11-16 19:57:26.000000000","message":"LGTM","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"0c220127bc6910c6090af64e99a34670679d976d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"20090a0d_2e23497a","updated":"2022-01-12 15:10:52.000000000","message":"Adding some cores since this is sitting for a while now","commit_id":"acb896e85313f1cb4cb7f0ebcb46e239946f931d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0bbc2b7e3686b2c0039e0c24c0afedd11c5064dd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"3769350c_e8ad37cf","updated":"2022-02-18 14:36:12.000000000","message":"As I understand the bug, the problem is that client programs are using the create call to do updates, and hence the permissions appear not to be working correctly.  But if you make API calls directly for create vs. update, the policies are correctly applied.\n\nI am not in favor of complicating the API code to handle something that the clients are doing incorrectly.  Am I correct that that\u0027s what\u0027s happening here?","commit_id":"acb896e85313f1cb4cb7f0ebcb46e239946f931d"},{"author":{"_account_id":30615,"name":"Tushar Trambak Gite","email":"tushargite96@gmail.com","username":"tushargite96"},"change_message_id":"040d09bcef05270d15f5f624d54728f0cb3c65bb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"0e49d131_bb4d7695","updated":"2022-01-24 10:09:57.000000000","message":"LGTM","commit_id":"acb896e85313f1cb4cb7f0ebcb46e239946f931d"},{"author":{"_account_id":33618,"name":"Arthur Luz de Ávila","display_name":"Arthur Luz de Avila","email":"Arthur.LuzdeAvila@windriver.com","username":"luzdeav"},"change_message_id":"867074ac9f1086aad21eabb887e88a568191d2e8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"d14156d7_30f06bba","updated":"2022-01-03 20:38:10.000000000","message":"LGTM","commit_id":"acb896e85313f1cb4cb7f0ebcb46e239946f931d"},{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"95f9fb4e94e7b154365e298a8bd5a5cafa7a10b8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"273c31ed_5a58e206","updated":"2021-12-01 18:22:44.000000000","message":"Thanks for the clarifications!","commit_id":"acb896e85313f1cb4cb7f0ebcb46e239946f931d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"fb9eb694f3a64ab3ac0680d908458aaf65ff6c31","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"78a4a69b_39b91b31","updated":"2022-03-02 15:11:21.000000000","message":"The API is functioning as designed.  The place to fix this is in the client programs that seem to be giving misleading information about what those calls are doing.\n\nFeel free to bring this up at the cinder weekly meeting if you\u0027d like more discussion.","commit_id":"acb896e85313f1cb4cb7f0ebcb46e239946f931d"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"8071ec510e9a4d6f844ba6b0835453a3141bb0a7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"a3f725b3_90f412c3","in_reply_to":"3769350c_e8ad37cf","updated":"2022-02-18 15:15:23.000000000","message":"I strongly disagree with your opinion here. I think we shouldn\u0027t rely on the client\u0027s correct usage of the API and protect the API against both intentional and accidental misusage. OR change the API so it doesn\u0027t do \"create_or_update\", but that would hurt other projects/consumers that rely on that like horizon.","commit_id":"acb896e85313f1cb4cb7f0ebcb46e239946f931d"}],"cinder/tests/unit/volume/test_volume.py":[{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"a7c8fda1d54857163c3f347998e4e30df0e5b94a","unresolved":true,"context_lines":[{"line_number":495,"context_line":"            **self.volume_params"},{"line_number":496,"context_line":"        )"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"        def _fail_policy_authorize(policy, **_):"},{"line_number":499,"context_line":"            if policy \u003d\u003d vol_meta_policy.UPDATE_POLICY:"},{"line_number":500,"context_line":"                raise exception.PolicyNotAuthorized(action\u003d\u0027Test\u0027)"},{"line_number":501,"context_line":""},{"line_number":502,"context_line":"        with mock.patch.object(self.context, \u0027authorize\u0027) as mock_auth:"},{"line_number":503,"context_line":"            mock_auth.side_effect \u003d _fail_policy_authorize"}],"source_content_type":"text/x-python","patch_set":3,"id":"88501826_07d47b62","line":500,"range":{"start_line":498,"start_character":0,"end_line":500,"end_character":66},"updated":"2021-11-16 21:41:40.000000000","message":"This test will always raise an exception. I don\u0027t see where it is tested the different systems behaviors, depending on whether the new metadata is CREATED, or UPDATED, and the influence of the corresponding policies on those scenarios.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"6e430147d2a597241d2e572575c944f4841b81b9","unresolved":true,"context_lines":[{"line_number":495,"context_line":"            **self.volume_params"},{"line_number":496,"context_line":"        )"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"        def _fail_policy_authorize(policy, **_):"},{"line_number":499,"context_line":"            if policy \u003d\u003d vol_meta_policy.UPDATE_POLICY:"},{"line_number":500,"context_line":"                raise exception.PolicyNotAuthorized(action\u003d\u0027Test\u0027)"},{"line_number":501,"context_line":""},{"line_number":502,"context_line":"        with mock.patch.object(self.context, \u0027authorize\u0027) as mock_auth:"},{"line_number":503,"context_line":"            mock_auth.side_effect \u003d _fail_policy_authorize"}],"source_content_type":"text/x-python","patch_set":3,"id":"95043219_0536dc72","line":500,"range":{"start_line":498,"start_character":0,"end_line":500,"end_character":66},"in_reply_to":"444231b6_b2b739e9","updated":"2021-11-16 22:43:50.000000000","message":"And, btw, the test that checks the positive scenario is right above this one.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"320152973d6c21e70f8868ff51d2616a144f6bfb","unresolved":true,"context_lines":[{"line_number":495,"context_line":"            **self.volume_params"},{"line_number":496,"context_line":"        )"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"        def _fail_policy_authorize(policy, **_):"},{"line_number":499,"context_line":"            if policy \u003d\u003d vol_meta_policy.UPDATE_POLICY:"},{"line_number":500,"context_line":"                raise exception.PolicyNotAuthorized(action\u003d\u0027Test\u0027)"},{"line_number":501,"context_line":""},{"line_number":502,"context_line":"        with mock.patch.object(self.context, \u0027authorize\u0027) as mock_auth:"},{"line_number":503,"context_line":"            mock_auth.side_effect \u003d _fail_policy_authorize"}],"source_content_type":"text/x-python","patch_set":3,"id":"444231b6_b2b739e9","line":500,"range":{"start_line":498,"start_character":0,"end_line":500,"end_character":66},"in_reply_to":"88501826_07d47b62","updated":"2021-11-16 22:41:58.000000000","message":"This is a unit test, not an integration test.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":33431,"name":"Fábio Oliveira","email":"fabioaurelio1269@gmail.com","username":"fabiooliveira1"},"change_message_id":"6ba6afc0b1e2ceb761bb73c4e873e4f0f8b7a0e4","unresolved":true,"context_lines":[{"line_number":495,"context_line":"            **self.volume_params"},{"line_number":496,"context_line":"        )"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"        def _fail_policy_authorize(policy, **_):"},{"line_number":499,"context_line":"            if policy \u003d\u003d vol_meta_policy.UPDATE_POLICY:"},{"line_number":500,"context_line":"                raise exception.PolicyNotAuthorized(action\u003d\u0027Test\u0027)"},{"line_number":501,"context_line":""},{"line_number":502,"context_line":"        with mock.patch.object(self.context, \u0027authorize\u0027) as mock_auth:"},{"line_number":503,"context_line":"            mock_auth.side_effect \u003d _fail_policy_authorize"}],"source_content_type":"text/x-python","patch_set":3,"id":"f4356e74_3dbc8fe3","line":500,"range":{"start_line":498,"start_character":0,"end_line":500,"end_character":66},"in_reply_to":"95043219_0536dc72","updated":"2022-02-18 15:00:13.000000000","message":"I get what you mean on this tests, but It would be way better to have tests only for create_volume_metadata and others only for _update_volume_metadata.\n\nOn create, you could provide the input and also mock _update to return all the possible outcomes (success, exceptions, etc).\n\nOn _update, you also could provide the right input and test it alone.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"}],"cinder/volume/api.py":[{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"a7c8fda1d54857163c3f347998e4e30df0e5b94a","unresolved":true,"context_lines":[{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"    def create_volume_metadata(self, context, volume, metadata):"},{"line_number":1134,"context_line":"        \"\"\"Creates volume metadata.\"\"\""},{"line_number":1135,"context_line":"        context.authorize(vol_meta_policy.CREATE_POLICY, target_obj\u003dvolume)"},{"line_number":1136,"context_line":"        db_meta \u003d self._update_volume_metadata(context, volume, metadata)"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"        LOG.info(\"Create volume metadata completed successfully.\","},{"line_number":1139,"context_line":"                 resource\u003dvolume)"}],"source_content_type":"text/x-python","patch_set":3,"id":"a628116d_1a18e305","line":1136,"range":{"start_line":1135,"start_character":0,"end_line":1136,"end_character":73},"updated":"2021-11-16 21:41:40.000000000","message":"This will set the policy for the CREATE scenario, before calling _update_volume_metadata()","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"95f9fb4e94e7b154365e298a8bd5a5cafa7a10b8","unresolved":false,"context_lines":[{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"    def create_volume_metadata(self, context, volume, metadata):"},{"line_number":1134,"context_line":"        \"\"\"Creates volume metadata.\"\"\""},{"line_number":1135,"context_line":"        context.authorize(vol_meta_policy.CREATE_POLICY, target_obj\u003dvolume)"},{"line_number":1136,"context_line":"        db_meta \u003d self._update_volume_metadata(context, volume, metadata)"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"        LOG.info(\"Create volume metadata completed successfully.\","},{"line_number":1139,"context_line":"                 resource\u003dvolume)"}],"source_content_type":"text/x-python","patch_set":3,"id":"f52c2d7b_31aea9a0","line":1136,"range":{"start_line":1135,"start_character":0,"end_line":1136,"end_character":73},"in_reply_to":"22f40abd_4586a28c","updated":"2021-12-01 18:22:44.000000000","message":"This comment was just intended to show the code point where the policy is taken.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"320152973d6c21e70f8868ff51d2616a144f6bfb","unresolved":true,"context_lines":[{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"    def create_volume_metadata(self, context, volume, metadata):"},{"line_number":1134,"context_line":"        \"\"\"Creates volume metadata.\"\"\""},{"line_number":1135,"context_line":"        context.authorize(vol_meta_policy.CREATE_POLICY, target_obj\u003dvolume)"},{"line_number":1136,"context_line":"        db_meta \u003d self._update_volume_metadata(context, volume, metadata)"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"        LOG.info(\"Create volume metadata completed successfully.\","},{"line_number":1139,"context_line":"                 resource\u003dvolume)"}],"source_content_type":"text/x-python","patch_set":3,"id":"22f40abd_4586a28c","line":1136,"range":{"start_line":1135,"start_character":0,"end_line":1136,"end_character":73},"in_reply_to":"a628116d_1a18e305","updated":"2021-11-16 22:41:58.000000000","message":"This doesn\u0027t *set* anything: https://github.com/openstack/cinder/blob/master/cinder/context.py#L199","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"a7c8fda1d54857163c3f347998e4e30df0e5b94a","unresolved":true,"context_lines":[{"line_number":1160,"context_line":"            LOG.info(msg, resource\u003dvolume)"},{"line_number":1161,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1162,"context_line":""},{"line_number":1163,"context_line":"        if set(volume.metadata.keys()) \u0026 set(metadata.keys()):"},{"line_number":1164,"context_line":"            context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"        return self.db.volume_metadata_update(context, volume[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a2f799c_d50d79ac","line":1163,"range":{"start_line":1163,"start_character":8,"end_line":1163,"end_character":61},"updated":"2021-11-16 21:41:40.000000000","message":"This will tell if data has been populated, not whether it is a CREATE or UPDATE scenario","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"320152973d6c21e70f8868ff51d2616a144f6bfb","unresolved":true,"context_lines":[{"line_number":1160,"context_line":"            LOG.info(msg, resource\u003dvolume)"},{"line_number":1161,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1162,"context_line":""},{"line_number":1163,"context_line":"        if set(volume.metadata.keys()) \u0026 set(metadata.keys()):"},{"line_number":1164,"context_line":"            context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"        return self.db.volume_metadata_update(context, volume[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"6340b927_88bfbe67","line":1163,"range":{"start_line":1163,"start_character":8,"end_line":1163,"end_character":61},"in_reply_to":"3a2f799c_d50d79ac","updated":"2021-11-16 22:41:58.000000000","message":"I think you got it wrong. This line checks if there is any intersection between the keys of the metadata that are already on the volume and the keys of the metadata provided in the call for this method. If there is any intersection, it means that there is metadata being updated.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"95f9fb4e94e7b154365e298a8bd5a5cafa7a10b8","unresolved":false,"context_lines":[{"line_number":1160,"context_line":"            LOG.info(msg, resource\u003dvolume)"},{"line_number":1161,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1162,"context_line":""},{"line_number":1163,"context_line":"        if set(volume.metadata.keys()) \u0026 set(metadata.keys()):"},{"line_number":1164,"context_line":"            context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"        return self.db.volume_metadata_update(context, volume[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"6122527a_4c34afe8","line":1163,"range":{"start_line":1163,"start_character":8,"end_line":1163,"end_character":61},"in_reply_to":"6340b927_88bfbe67","updated":"2021-12-01 18:22:44.000000000","message":"Understood","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"a7c8fda1d54857163c3f347998e4e30df0e5b94a","unresolved":true,"context_lines":[{"line_number":1161,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1162,"context_line":""},{"line_number":1163,"context_line":"        if set(volume.metadata.keys()) \u0026 set(metadata.keys()):"},{"line_number":1164,"context_line":"            context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"        return self.db.volume_metadata_update(context, volume[\u0027id\u0027],"},{"line_number":1167,"context_line":"                                              metadata, delete, meta_type)"}],"source_content_type":"text/x-python","patch_set":3,"id":"84e5db6c_8c6bd0a9","line":1164,"range":{"start_line":1164,"start_character":12,"end_line":1164,"end_character":79},"updated":"2021-11-16 21:41:40.000000000","message":"This action is not applicable for the CREATE scenario.\nNote that _update_volume_metadata() is used in both CREATE and UPDATE scenarios.\n\nHave you considered the proposed solution in the bug description?\nhttps://bugs.launchpad.net/cinder/+bug/1929606","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"95f9fb4e94e7b154365e298a8bd5a5cafa7a10b8","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1162,"context_line":""},{"line_number":1163,"context_line":"        if set(volume.metadata.keys()) \u0026 set(metadata.keys()):"},{"line_number":1164,"context_line":"            context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"        return self.db.volume_metadata_update(context, volume[\u0027id\u0027],"},{"line_number":1167,"context_line":"                                              metadata, delete, meta_type)"}],"source_content_type":"text/x-python","patch_set":3,"id":"537333e8_e6df4981","line":1164,"range":{"start_line":1164,"start_character":12,"end_line":1164,"end_character":79},"in_reply_to":"38dd653e_91663758","updated":"2021-12-01 18:22:44.000000000","message":"Got it. We just have to be careful that Horizon always uses the CREATE API.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"320152973d6c21e70f8868ff51d2616a144f6bfb","unresolved":true,"context_lines":[{"line_number":1161,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":1162,"context_line":""},{"line_number":1163,"context_line":"        if set(volume.metadata.keys()) \u0026 set(metadata.keys()):"},{"line_number":1164,"context_line":"            context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"        return self.db.volume_metadata_update(context, volume[\u0027id\u0027],"},{"line_number":1167,"context_line":"                                              metadata, delete, meta_type)"}],"source_content_type":"text/x-python","patch_set":3,"id":"38dd653e_91663758","line":1164,"range":{"start_line":1164,"start_character":12,"end_line":1164,"end_character":79},"in_reply_to":"84e5db6c_8c6bd0a9","updated":"2021-11-16 22:41:58.000000000","message":"Please see the answer in L1136. I did consider, L1163 does that in a more efficient way.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"a7c8fda1d54857163c3f347998e4e30df0e5b94a","unresolved":true,"context_lines":[{"line_number":1174,"context_line":"        `metadata` argument will be deleted."},{"line_number":1175,"context_line":""},{"line_number":1176,"context_line":"        \"\"\""},{"line_number":1177,"context_line":"        context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1178,"context_line":"        db_meta \u003d self._update_volume_metadata(context, volume, metadata,"},{"line_number":1179,"context_line":"                                               delete, meta_type)"},{"line_number":1180,"context_line":""},{"line_number":1181,"context_line":"        # TODO(jdg): Implement an RPC call for drivers that may use this info"},{"line_number":1182,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"f8e7e6f4_c3974295","line":1179,"range":{"start_line":1177,"start_character":0,"end_line":1179,"end_character":0},"updated":"2021-11-16 21:41:40.000000000","message":"This will set the policy for the UPDATE scenario, before calling _update_volume_metadata()","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":33136,"name":"Rogerio Ferraz","display_name":"Rogerio Ferraz","email":"rferraz.windriver@gmail.com","username":"rferraz"},"change_message_id":"95f9fb4e94e7b154365e298a8bd5a5cafa7a10b8","unresolved":false,"context_lines":[{"line_number":1174,"context_line":"        `metadata` argument will be deleted."},{"line_number":1175,"context_line":""},{"line_number":1176,"context_line":"        \"\"\""},{"line_number":1177,"context_line":"        context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1178,"context_line":"        db_meta \u003d self._update_volume_metadata(context, volume, metadata,"},{"line_number":1179,"context_line":"                                               delete, meta_type)"},{"line_number":1180,"context_line":""},{"line_number":1181,"context_line":"        # TODO(jdg): Implement an RPC call for drivers that may use this info"},{"line_number":1182,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3812221c_42e6e584","line":1179,"range":{"start_line":1177,"start_character":0,"end_line":1179,"end_character":0},"in_reply_to":"83947b15_6b5362d1","updated":"2021-12-01 18:22:44.000000000","message":"This comment was just intended to show the code point where the policy is taken.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"320152973d6c21e70f8868ff51d2616a144f6bfb","unresolved":true,"context_lines":[{"line_number":1174,"context_line":"        `metadata` argument will be deleted."},{"line_number":1175,"context_line":""},{"line_number":1176,"context_line":"        \"\"\""},{"line_number":1177,"context_line":"        context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1178,"context_line":"        db_meta \u003d self._update_volume_metadata(context, volume, metadata,"},{"line_number":1179,"context_line":"                                               delete, meta_type)"},{"line_number":1180,"context_line":""},{"line_number":1181,"context_line":"        # TODO(jdg): Implement an RPC call for drivers that may use this info"},{"line_number":1182,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"83947b15_6b5362d1","line":1179,"range":{"start_line":1177,"start_character":0,"end_line":1179,"end_character":0},"in_reply_to":"f8e7e6f4_c3974295","updated":"2021-11-16 22:41:58.000000000","message":"Again, this doesn\u0027t *set* anything. Please take a look the method doc.","commit_id":"b02bff9cdfd696303452de4e79be71dedef0208f"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0bbc2b7e3686b2c0039e0c24c0afedd11c5064dd","unresolved":true,"context_lines":[{"line_number":1132,"context_line":""},{"line_number":1133,"context_line":"    def create_volume_metadata(self, context, volume, metadata):"},{"line_number":1134,"context_line":"        \"\"\"Creates volume metadata.\"\"\""},{"line_number":1135,"context_line":"        context.authorize(vol_meta_policy.CREATE_POLICY, target_obj\u003dvolume)"},{"line_number":1136,"context_line":"        db_meta \u003d self._update_volume_metadata(context, volume, metadata)"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":"        LOG.info(\"Create volume metadata completed successfully.\","}],"source_content_type":"text/x-python","patch_set":4,"id":"a54f60bf_fb951d0f","line":1135,"range":{"start_line":1135,"start_character":8,"end_line":1135,"end_character":75},"updated":"2022-02-18 14:36:12.000000000","message":"If you don\u0027t have create permission, the create call will fail here.","commit_id":"acb896e85313f1cb4cb7f0ebcb46e239946f931d"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0bbc2b7e3686b2c0039e0c24c0afedd11c5064dd","unresolved":true,"context_lines":[{"line_number":1174,"context_line":"        `metadata` argument will be deleted."},{"line_number":1175,"context_line":""},{"line_number":1176,"context_line":"        \"\"\""},{"line_number":1177,"context_line":"        context.authorize(vol_meta_policy.UPDATE_POLICY, target_obj\u003dvolume)"},{"line_number":1178,"context_line":"        db_meta \u003d self._update_volume_metadata(context, volume, metadata,"},{"line_number":1179,"context_line":"                                               delete, meta_type)"},{"line_number":1180,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"e66b8082_75df2f76","line":1177,"range":{"start_line":1177,"start_character":8,"end_line":1177,"end_character":75},"updated":"2022-02-18 14:36:12.000000000","message":"The check is being done here.  A user without update permission will fail before the _update function is called.","commit_id":"acb896e85313f1cb4cb7f0ebcb46e239946f931d"}]}
