)]}'
{"cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py":[{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"1d98a46b83e3cb529b0145d88cb33714569b1d28","unresolved":true,"context_lines":[{"line_number":9623,"context_line":"                                               [self.rep_target])"},{"line_number":9624,"context_line":"        self.driver.do_setup(self.ctxt)"},{"line_number":9625,"context_line":""},{"line_number":9626,"context_line":"        UUID \u003d \u002727be57f2-33fd-4665-be20-4c7ed7f7565b\u0027"},{"line_number":9627,"context_line":"        target_change_volume_name \u003d vol_name[\u0027volume_name\u0027] + UUID"},{"line_number":9628,"context_line":"        test_obj \u003d storwize_rep.StorwizeSVCReplicationGMCV(self.driver)"},{"line_number":9629,"context_line":"        vol_name \u003d test_obj.sanitize_volume(target_change_volume_name)"}],"source_content_type":"text/x-python","patch_set":9,"id":"a40cf015_213785e4","line":9626,"updated":"2021-08-10 16:59:00.000000000","message":"nit: use something like VOLUME_ID from cinder.tests.unit.fake_constants","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"5c2435999dea96a529d07f59b348990ac05c5e19","unresolved":false,"context_lines":[{"line_number":9623,"context_line":"                                               [self.rep_target])"},{"line_number":9624,"context_line":"        self.driver.do_setup(self.ctxt)"},{"line_number":9625,"context_line":""},{"line_number":9626,"context_line":"        UUID \u003d \u002727be57f2-33fd-4665-be20-4c7ed7f7565b\u0027"},{"line_number":9627,"context_line":"        target_change_volume_name \u003d vol_name[\u0027volume_name\u0027] + UUID"},{"line_number":9628,"context_line":"        test_obj \u003d storwize_rep.StorwizeSVCReplicationGMCV(self.driver)"},{"line_number":9629,"context_line":"        vol_name \u003d test_obj.sanitize_volume(target_change_volume_name)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3e8edbde_432ed203","line":9626,"in_reply_to":"a40cf015_213785e4","updated":"2021-08-24 03:52:27.000000000","message":"Done","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0543b6f2fe0393ea01aa4a1b2c989c8c332c7812","unresolved":true,"context_lines":[{"line_number":9627,"context_line":"        target_change_volume_name \u003d vol_name[\u0027volume_name\u0027] + UUID"},{"line_number":9628,"context_line":"        test_obj \u003d storwize_rep.StorwizeSVCReplicationGMCV(self.driver)"},{"line_number":9629,"context_line":"        vol_name \u003d test_obj.sanitize_volume(target_change_volume_name)"},{"line_number":9630,"context_line":"        self.assertEqual(vol_name, target_change_volume_name[:63])"},{"line_number":9631,"context_line":""},{"line_number":9632,"context_line":"    def test_storwize_create_volume_with_mirror_replication(self):"},{"line_number":9633,"context_line":"        # Set replication target."}],"source_content_type":"text/x-python","patch_set":9,"id":"73f76004_dccd1783","line":9630,"updated":"2021-08-19 20:55:55.000000000","message":"You\u0027re basically repeating the code here.  You should be checking to make sure that the name doesn\u0027t exceed 63 chars.","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"5c2435999dea96a529d07f59b348990ac05c5e19","unresolved":false,"context_lines":[{"line_number":9627,"context_line":"        target_change_volume_name \u003d vol_name[\u0027volume_name\u0027] + UUID"},{"line_number":9628,"context_line":"        test_obj \u003d storwize_rep.StorwizeSVCReplicationGMCV(self.driver)"},{"line_number":9629,"context_line":"        vol_name \u003d test_obj.sanitize_volume(target_change_volume_name)"},{"line_number":9630,"context_line":"        self.assertEqual(vol_name, target_change_volume_name[:63])"},{"line_number":9631,"context_line":""},{"line_number":9632,"context_line":"    def test_storwize_create_volume_with_mirror_replication(self):"},{"line_number":9633,"context_line":"        # Set replication target."}],"source_content_type":"text/x-python","patch_set":9,"id":"acc2690c_0bda517a","line":9630,"in_reply_to":"73f76004_dccd1783","updated":"2021-08-24 03:52:27.000000000","message":"Done","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":30555,"name":"Fernando Ferraz","display_name":"Fernando Ferraz","email":"fesilva@redhat.com","username":"fernandoperches"},"change_message_id":"9acb8dc2aaec87c0bbf490c979e252c2726e20a8","unresolved":true,"context_lines":[{"line_number":9614,"context_line":"                          self.driver.create_volume, vol)"},{"line_number":9615,"context_line":"        self.assertFalse(create_vdisk.called)"},{"line_number":9616,"context_line":""},{"line_number":9617,"context_line":"    @ddt.data({\u0027volume_name\u0027: \u0027chg_aux_target_test_volume-\u0027},"},{"line_number":9618,"context_line":"              {\u0027volume_name\u0027: \u0027chg_aux_target_test_volume_name-\u0027},"},{"line_number":9619,"context_line":"              {\u0027volume_name\u0027: \u0027chg_aux_target_volume-\u0027})"},{"line_number":9620,"context_line":"    def test_generate_target_change_vol_name(self, vol_name):"}],"source_content_type":"text/x-python","patch_set":10,"id":"8d02c16c_504ddfa6","line":9617,"updated":"2021-08-26 19:53:29.000000000","message":"nit: Not really necessary but this could be replaced by:\n @ddt.data(\u0027chg_aux_target_test_volume-\u0027, \n           \u0027chg_aux_target_test_volume_name-\u0027, \n           \u0027chg_aux_target_volume-\u0027)\n\nThen you just use vol_name in line 9627:\ntarget_change_volume_name \u003d vol_name + UUID","commit_id":"f5668e1068aa11a4350a20b14cf3594268b6e2c9"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"e651d49a6bce3f8b1a0d95d43d4d1cc96605f5b7","unresolved":false,"context_lines":[{"line_number":9614,"context_line":"                          self.driver.create_volume, vol)"},{"line_number":9615,"context_line":"        self.assertFalse(create_vdisk.called)"},{"line_number":9616,"context_line":""},{"line_number":9617,"context_line":"    @ddt.data({\u0027volume_name\u0027: \u0027chg_aux_target_test_volume-\u0027},"},{"line_number":9618,"context_line":"              {\u0027volume_name\u0027: \u0027chg_aux_target_test_volume_name-\u0027},"},{"line_number":9619,"context_line":"              {\u0027volume_name\u0027: \u0027chg_aux_target_volume-\u0027})"},{"line_number":9620,"context_line":"    def test_generate_target_change_vol_name(self, vol_name):"}],"source_content_type":"text/x-python","patch_set":10,"id":"847f72cf_e5ad0196","line":9617,"in_reply_to":"8d02c16c_504ddfa6","updated":"2021-09-01 03:11:54.000000000","message":"Ack","commit_id":"f5668e1068aa11a4350a20b14cf3594268b6e2c9"},{"author":{"_account_id":30555,"name":"Fernando Ferraz","display_name":"Fernando Ferraz","email":"fesilva@redhat.com","username":"fernandoperches"},"change_message_id":"9acb8dc2aaec87c0bbf490c979e252c2726e20a8","unresolved":true,"context_lines":[{"line_number":9628,"context_line":"        test_obj \u003d storwize_rep.StorwizeSVCReplicationGMCV(self.driver)"},{"line_number":9629,"context_line":"        vol_name \u003d test_obj.generate_target_change_vol_name("},{"line_number":9630,"context_line":"            target_change_volume_name)"},{"line_number":9631,"context_line":"        self.assertEqual(vol_name, target_change_volume_name[:63])"},{"line_number":9632,"context_line":"        self.assertTrue(len(vol_name) \u003c\u003d 63)"},{"line_number":9633,"context_line":""},{"line_number":9634,"context_line":"    def test_storwize_create_volume_with_mirror_replication(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"0aef5cd1_73291524","line":9631,"updated":"2021-08-26 19:53:29.000000000","message":"This is also a nit (a stupid one) but the expected parameter for assertEqual is the first and the observed is the second.\ndef assertEqual(self, expected, observed, message\u003d\u0027\u0027):\n\"\"\"Assert that \u0027expected\u0027 is equal to \u0027observed\u0027.","commit_id":"f5668e1068aa11a4350a20b14cf3594268b6e2c9"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"e651d49a6bce3f8b1a0d95d43d4d1cc96605f5b7","unresolved":false,"context_lines":[{"line_number":9628,"context_line":"        test_obj \u003d storwize_rep.StorwizeSVCReplicationGMCV(self.driver)"},{"line_number":9629,"context_line":"        vol_name \u003d test_obj.generate_target_change_vol_name("},{"line_number":9630,"context_line":"            target_change_volume_name)"},{"line_number":9631,"context_line":"        self.assertEqual(vol_name, target_change_volume_name[:63])"},{"line_number":9632,"context_line":"        self.assertTrue(len(vol_name) \u003c\u003d 63)"},{"line_number":9633,"context_line":""},{"line_number":9634,"context_line":"    def test_storwize_create_volume_with_mirror_replication(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"27737235_56e24092","line":9631,"in_reply_to":"0aef5cd1_73291524","updated":"2021-09-01 03:11:54.000000000","message":"Ack","commit_id":"f5668e1068aa11a4350a20b14cf3594268b6e2c9"}],"cinder/volume/drivers/ibm/storwize_svc/replication.py":[{"author":{"_account_id":14806,"name":"Chhavi Agarwal","email":"chhagarw@in.ibm.com","username":"chhagarw"},"change_message_id":"46625af16a403c7c90fb55dd3fc90b6ac77ce355","unresolved":true,"context_lines":[{"line_number":158,"context_line":"        # Trims the length of volume name to less than 63"},{"line_number":159,"context_line":"        # characters and then checks with the volume-UUID"},{"line_number":160,"context_line":"        new_vol_name \u003d (vol_name)[:62]"},{"line_number":161,"context_line":"        if new_vol_name[-8:] in vref[\u0027name_id\u0027]:"},{"line_number":162,"context_line":"            return new_vol_name"},{"line_number":163,"context_line":"        error_msg \u003d _(\"Unable to create the GMCV volume as Change_Aux_Volume\""},{"line_number":164,"context_line":"                      \"name length is beyond supported limit of Storwize\""}],"source_content_type":"text/x-python","patch_set":2,"id":"c48682e4_72a2f247","line":161,"updated":"2021-05-13 08:55:19.000000000","message":"What are we checking here ??","commit_id":"ed4d261d1197b89361a5732a0901cc9b0526367b"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"5c2435999dea96a529d07f59b348990ac05c5e19","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        # Trims the length of volume name to less than 63"},{"line_number":159,"context_line":"        # characters and then checks with the volume-UUID"},{"line_number":160,"context_line":"        new_vol_name \u003d (vol_name)[:62]"},{"line_number":161,"context_line":"        if new_vol_name[-8:] in vref[\u0027name_id\u0027]:"},{"line_number":162,"context_line":"            return new_vol_name"},{"line_number":163,"context_line":"        error_msg \u003d _(\"Unable to create the GMCV volume as Change_Aux_Volume\""},{"line_number":164,"context_line":"                      \"name length is beyond supported limit of Storwize\""}],"source_content_type":"text/x-python","patch_set":2,"id":"4c692a4c_d45c204a","line":161,"in_reply_to":"4231a6a3_1871c440","updated":"2021-08-24 03:52:27.000000000","message":"Done","commit_id":"ed4d261d1197b89361a5732a0901cc9b0526367b"},{"author":{"_account_id":32036,"name":"katari manoj kumar","email":"katkumar@in.ibm.com","username":"katarimanojkumar"},"change_message_id":"0532d2e8b6ef3a2851e64cd6b97fbd905ac367d0","unresolved":true,"context_lines":[{"line_number":158,"context_line":"        # Trims the length of volume name to less than 63"},{"line_number":159,"context_line":"        # characters and then checks with the volume-UUID"},{"line_number":160,"context_line":"        new_vol_name \u003d (vol_name)[:62]"},{"line_number":161,"context_line":"        if new_vol_name[-8:] in vref[\u0027name_id\u0027]:"},{"line_number":162,"context_line":"            return new_vol_name"},{"line_number":163,"context_line":"        error_msg \u003d _(\"Unable to create the GMCV volume as Change_Aux_Volume\""},{"line_number":164,"context_line":"                      \"name length is beyond supported limit of Storwize\""}],"source_content_type":"text/x-python","patch_set":2,"id":"4231a6a3_1871c440","line":161,"in_reply_to":"c48682e4_72a2f247","updated":"2021-05-13 09:06:53.000000000","message":"suppose if there is as new volumename_template that allows displayname length \u003e37, there is a chance for reduced vol_id characters count in the name.\n\nwe just ensure that minimum of 8 characters of volid is part of aux change volume name.\n\nIf we are sure that there will no other template used by customer, we can ignore this check.","commit_id":"ed4d261d1197b89361a5732a0901cc9b0526367b"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"d5793dcc114095e8c311de53a93454436db2375a","unresolved":true,"context_lines":[{"line_number":165,"context_line":"        # If length of the volume name exceeds the Max limit, Trims"},{"line_number":166,"context_line":"        # the length to less than 63 characters"},{"line_number":167,"context_line":"        if len(target_change_vol_name) \u003e 63:"},{"line_number":168,"context_line":"            target_change_vol_name \u003d (target_change_vol_name)[:63]"},{"line_number":169,"context_line":"        try:"},{"line_number":170,"context_line":"            src_attr \u003d self.driver._helpers.get_vdisk_attributes("},{"line_number":171,"context_line":"                vref[\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"ef37a077_2e79ad02","line":168,"updated":"2021-07-16 15:39:00.000000000","message":"This seems like something that warrants a log message, certainly INFO and maybe WARNING.\n\nI don\u0027t see any existing code that limits the length of Storwize volume names. Why is this (replication setup) the first place where the limit is being enforced? I guess what I\u0027m asking is, are there other places where the limit should also be enforced?","commit_id":"ed595f57c5fa76d57e8747ce1d66de00b2fe0b21"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"5c2435999dea96a529d07f59b348990ac05c5e19","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        # If length of the volume name exceeds the Max limit, Trims"},{"line_number":166,"context_line":"        # the length to less than 63 characters"},{"line_number":167,"context_line":"        if len(target_change_vol_name) \u003e 63:"},{"line_number":168,"context_line":"            target_change_vol_name \u003d (target_change_vol_name)[:63]"},{"line_number":169,"context_line":"        try:"},{"line_number":170,"context_line":"            src_attr \u003d self.driver._helpers.get_vdisk_attributes("},{"line_number":171,"context_line":"                vref[\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"162c87fd_76893a21","line":168,"in_reply_to":"84f8c16a_e4024913","updated":"2021-08-24 03:52:27.000000000","message":"Done","commit_id":"ed595f57c5fa76d57e8747ce1d66de00b2fe0b21"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"9b9ad4bd02905f966a6c4c859d9da3a8355cd298","unresolved":true,"context_lines":[{"line_number":165,"context_line":"        # If length of the volume name exceeds the Max limit, Trims"},{"line_number":166,"context_line":"        # the length to less than 63 characters"},{"line_number":167,"context_line":"        if len(target_change_vol_name) \u003e 63:"},{"line_number":168,"context_line":"            target_change_vol_name \u003d (target_change_vol_name)[:63]"},{"line_number":169,"context_line":"        try:"},{"line_number":170,"context_line":"            src_attr \u003d self.driver._helpers.get_vdisk_attributes("},{"line_number":171,"context_line":"                vref[\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"84f8c16a_e4024913","line":168,"in_reply_to":"ef37a077_2e79ad02","updated":"2021-07-21 09:22:26.000000000","message":"Sure, will be adding a LOG message stating the reason.\nRegarding the code-changes specific to only (replication setup), the volumes names are framed by concatenation of constant(i.e, from storwize_const.py) and vref[\u0027name\u0027].\n\nWe used to consider the default vref[\u0027name\u0027] that we get from (\u003cclass \u0027cinder.objects.volume.Volume\u0027\u003e ), But our client has been using a custom-name template(i.e,being defined at cinder.CONF) rather to default-name.\n\nHence, after quite a good amount of testing and analysis we could conclude that, \"target_change_vol_name\" is the only variable prone to exceed the supported limit of our storage.","commit_id":"ed595f57c5fa76d57e8747ce1d66de00b2fe0b21"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"1d98a46b83e3cb529b0145d88cb33714569b1d28","unresolved":true,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def sanitize_volume(self, target_change_vol_name):"},{"line_number":158,"context_line":"        # When we consider a custom-name template (defined at cinder.CONF)"},{"line_number":159,"context_line":"        # rather to default-name i.e vref[\u0027name\u0027] \u003d \"volume-UUID\", while"},{"line_number":160,"context_line":"        # creation of GMCV volume \"target_change_vol_name\" is the only"},{"line_number":161,"context_line":"        # variable prone to exceed 63 characters which is the supported"},{"line_number":162,"context_line":"        # limit of IBM Storwize."}],"source_content_type":"text/x-python","patch_set":9,"id":"1074db0a_18f8063a","line":159,"range":{"start_line":159,"start_character":52,"end_line":159,"end_character":66},"updated":"2021-08-10 16:59:00.000000000","message":"Although this could be worded more clearly, I think this is saying the custom name template will ensure the vref[\u0027name\u0027] includes a UUID, and therefore truncating the name should not result in a naming collision with another volume.","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0543b6f2fe0393ea01aa4a1b2c989c8c332c7812","unresolved":true,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def sanitize_volume(self, target_change_vol_name):"},{"line_number":158,"context_line":"        # When we consider a custom-name template (defined at cinder.CONF)"},{"line_number":159,"context_line":"        # rather to default-name i.e vref[\u0027name\u0027] \u003d \"volume-UUID\", while"},{"line_number":160,"context_line":"        # creation of GMCV volume \"target_change_vol_name\" is the only"},{"line_number":161,"context_line":"        # variable prone to exceed 63 characters which is the supported"},{"line_number":162,"context_line":"        # limit of IBM Storwize."}],"source_content_type":"text/x-python","patch_set":9,"id":"92803e3e_25e3eed1","line":159,"range":{"start_line":159,"start_character":52,"end_line":159,"end_character":66},"in_reply_to":"1074db0a_18f8063a","updated":"2021-08-19 20:55:55.000000000","message":"This could definitely be worded more clearly.  As far as I can tell, this is what\u0027s going on:\n\nThe \u0027name\u0027 on the Volume object is generated, not stored, and there doesn\u0027t seem to be any length restriction on it (because it\u0027s in the config file, not the database).  The generated name is template + string representation of a UUID, and the calling function is slapping on two 4 char prefixes in front of that.  Since 36+8\u003d44, if the config template is longer than 19 chars, we\u0027ll exceed the max length limitation of Storwize.\n\nThe problem I see with the approach taken in this function is that if there\u0027s a long template and we simply take the first 63 chars like at line 167, all the target_change_vol_name could wind up being the same.  I don\u0027t know if that\u0027s an issue or not (that is, it might not be a problem for the storage system, but if people are using these names for anything, customers will complain).\n\nWhat you might want to do is ignore the target_vol_name and instead pass the vref[\u0027name\u0027] directly to this function.  Then do something like:\n\n   MAX_LEN \u003d 63   # use a better name and add this to storwize_const\n   useful_chars \u003d MAX_LEN - len(storwize_const.REPLICA_AUX_VOL_PREFIX + storwize_const.REPLICA_CHG_VOL_PREFIX)\n   return \"%(chg)s%(aux)s%(name)s\" % {\u0027chg\u0027: storwize_const.REPLICA_CHG_VOL_PREFIX,\n\u0027aux\u0027: storwize_const.REPLICA_AUX_VOL_PREFIX, \u0027name\u0027: name[-useful_chars:]}\n\nThis way, you\u0027ll preserve the current prefixes and also the UUUID, which will contain all the randomness to keep all of these different.\n\nIf you do what I suggest, you should change the name of this function to something like \u0027generate_target_change_vol_name\u0027.","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"69083ff4e801099b2784c2a914edb212572c4b9a","unresolved":true,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def sanitize_volume(self, target_change_vol_name):"},{"line_number":158,"context_line":"        # When we consider a custom-name template (defined at cinder.CONF)"},{"line_number":159,"context_line":"        # rather to default-name i.e vref[\u0027name\u0027] \u003d \"volume-UUID\", while"},{"line_number":160,"context_line":"        # creation of GMCV volume \"target_change_vol_name\" is the only"},{"line_number":161,"context_line":"        # variable prone to exceed 63 characters which is the supported"},{"line_number":162,"context_line":"        # limit of IBM Storwize."}],"source_content_type":"text/x-python","patch_set":9,"id":"7a6d3636_60b412e0","line":159,"range":{"start_line":159,"start_character":52,"end_line":159,"end_character":66},"in_reply_to":"58507dc7_648790ab","updated":"2021-09-07 16:23:57.000000000","message":"You\u0027re going to have to help me out here.  Are you talking about the volume_name_template defined by cinder here:\nhttps://opendev.org/openstack/cinder/src/commit/b812c98e15bf7bc09342df91003c2db8314a5482/cinder/db/api.py#L51\n\nThat\u0027s used in two places in the cinder code:\nhttps://opendev.org/openstack/cinder/src/commit/b812c98e15bf7bc09342df91003c2db8314a5482/cinder/db/sqlalchemy/models.py#L269\nhttps://opendev.org/openstack/cinder/src/commit/b812c98e15bf7bc09342df91003c2db8314a5482/cinder/objects/volume.py#L164\n\nIn either of those, if the volume_name_template is configured to \u0027volume-%(display_name).37s-%(id).13s\u0027, you will raise a TypeError (format requires a mapping).\n\nThe bug and comment here both mention cinder.conf, and I don\u0027t see any kind of name template defined in storwize_svc_common.py, so I\u0027m not sure what we\u0027re talking about.  Please at least update the comment so that when it says \"a custom-name template (defined at cinder.CONF)\" it\u0027s clear what config option is being referred to.","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"44f85d13f50593e81144f7eb1a62c8a7011f80e4","unresolved":true,"context_lines":[{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def sanitize_volume(self, target_change_vol_name):"},{"line_number":158,"context_line":"        # When we consider a custom-name template (defined at cinder.CONF)"},{"line_number":159,"context_line":"        # rather to default-name i.e vref[\u0027name\u0027] \u003d \"volume-UUID\", while"},{"line_number":160,"context_line":"        # creation of GMCV volume \"target_change_vol_name\" is the only"},{"line_number":161,"context_line":"        # variable prone to exceed 63 characters which is the supported"},{"line_number":162,"context_line":"        # limit of IBM Storwize."}],"source_content_type":"text/x-python","patch_set":9,"id":"58507dc7_648790ab","line":159,"range":{"start_line":159,"start_character":52,"end_line":159,"end_character":66},"in_reply_to":"92803e3e_25e3eed1","updated":"2021-08-23 19:11:27.000000000","message":"The customer(PowerVC) always uses the custom-template name in this format only i.e, \"volume_name_template \u003d \u0027volume-%(display_name).37s-%(id).13s\u0027\", the template name takes only 37 characters as display_name and rest are accommodated by UUID only towards the end of the name.\n\nHence, considering the above scenario, even though after truncation of \"target_change_vol_name\" the name generated does not result in any duplication with other volume names.\n\nThank you for suggesting an approach, but considering the above condition and proper analysis we are accurate that current code changes are good enough. Please consider the above approach with custom-template name framing and share you thoughts.","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":33431,"name":"Fábio Oliveira","email":"fabioaurelio1269@gmail.com","username":"fabiooliveira1"},"change_message_id":"e4c09a03ec8c0ca0e5587c30dc17497091d51b23","unresolved":true,"context_lines":[{"line_number":155,"context_line":"            driver, replication_target, target_helpers)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def sanitize_volume(self, target_change_vol_name):"},{"line_number":158,"context_line":"        # When we consider a custom-name template (defined at cinder.CONF)"},{"line_number":159,"context_line":"        # rather to default-name i.e vref[\u0027name\u0027] \u003d \"volume-UUID\", while"},{"line_number":160,"context_line":"        # creation of GMCV volume \"target_change_vol_name\" is the only"},{"line_number":161,"context_line":"        # variable prone to exceed 63 characters which is the supported"},{"line_number":162,"context_line":"        # limit of IBM Storwize."},{"line_number":163,"context_line":"        if len(target_change_vol_name) \u003e 63:"},{"line_number":164,"context_line":"            LOG.warning(\u0027Truncating the target_change_vol_name : %s, as it is \u0027"},{"line_number":165,"context_line":"                        \u0027exceeding the maximum volume name length supported \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"6c398b56_8a06fad2","line":162,"range":{"start_line":158,"start_character":8,"end_line":162,"end_character":32},"updated":"2021-08-12 13:14:08.000000000","message":"As this comment has many lines, wouldn\u0027t it be better with \"\"\" pattern","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"0543b6f2fe0393ea01aa4a1b2c989c8c332c7812","unresolved":true,"context_lines":[{"line_number":155,"context_line":"            driver, replication_target, target_helpers)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def sanitize_volume(self, target_change_vol_name):"},{"line_number":158,"context_line":"        # When we consider a custom-name template (defined at cinder.CONF)"},{"line_number":159,"context_line":"        # rather to default-name i.e vref[\u0027name\u0027] \u003d \"volume-UUID\", while"},{"line_number":160,"context_line":"        # creation of GMCV volume \"target_change_vol_name\" is the only"},{"line_number":161,"context_line":"        # variable prone to exceed 63 characters which is the supported"},{"line_number":162,"context_line":"        # limit of IBM Storwize."},{"line_number":163,"context_line":"        if len(target_change_vol_name) \u003e 63:"},{"line_number":164,"context_line":"            LOG.warning(\u0027Truncating the target_change_vol_name : %s, as it is \u0027"},{"line_number":165,"context_line":"                        \u0027exceeding the maximum volume name length supported \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"fdba8734_81c031c0","line":162,"range":{"start_line":158,"start_character":8,"end_line":162,"end_character":32},"in_reply_to":"6c398b56_8a06fad2","updated":"2021-08-19 20:55:55.000000000","message":"I think lines 160-162 should be in the commit message, not here, because they explain why you are making this change only for this one field.  They don\u0027t describe what this function does.","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"5c2435999dea96a529d07f59b348990ac05c5e19","unresolved":false,"context_lines":[{"line_number":155,"context_line":"            driver, replication_target, target_helpers)"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def sanitize_volume(self, target_change_vol_name):"},{"line_number":158,"context_line":"        # When we consider a custom-name template (defined at cinder.CONF)"},{"line_number":159,"context_line":"        # rather to default-name i.e vref[\u0027name\u0027] \u003d \"volume-UUID\", while"},{"line_number":160,"context_line":"        # creation of GMCV volume \"target_change_vol_name\" is the only"},{"line_number":161,"context_line":"        # variable prone to exceed 63 characters which is the supported"},{"line_number":162,"context_line":"        # limit of IBM Storwize."},{"line_number":163,"context_line":"        if len(target_change_vol_name) \u003e 63:"},{"line_number":164,"context_line":"            LOG.warning(\u0027Truncating the target_change_vol_name : %s, as it is \u0027"},{"line_number":165,"context_line":"                        \u0027exceeding the maximum volume name length supported \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"8da3b6fe_853ae31e","line":162,"range":{"start_line":158,"start_character":8,"end_line":162,"end_character":32},"in_reply_to":"fdba8734_81c031c0","updated":"2021-08-24 03:52:27.000000000","message":"Done","commit_id":"93348ef43ad2b4b0ae7c69b735ba01f767ff0cc2"},{"author":{"_account_id":30555,"name":"Fernando Ferraz","display_name":"Fernando Ferraz","email":"fesilva@redhat.com","username":"fernandoperches"},"change_message_id":"9acb8dc2aaec87c0bbf490c979e252c2726e20a8","unresolved":true,"context_lines":[{"line_number":168,"context_line":"            LOG.warning(\u0027Truncating the target_change_vol_name : %s, as it is \u0027"},{"line_number":169,"context_line":"                        \u0027exceeding the maximum volume name length supported \u0027"},{"line_number":170,"context_line":"                        \u0027by Storwize\u0027, target_change_vol_name)"},{"line_number":171,"context_line":"            target_change_vol_name \u003d (target_change_vol_name)[:63]"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        return target_change_vol_name"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"ebf2df7c_8e98631a","line":171,"updated":"2021-08-26 19:53:29.000000000","message":"I\u0027m wondering if truncating the volume name would later impact in other parts of the code such as [0] and [1]\n[0] https://github.com/openstack/cinder/blob/d29f12117e220eda6f2e8a3d4288701c7e98096f/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py#L2496\n[1]https://github.com/openstack/cinder/blob/d29f12117e220eda6f2e8a3d4288701c7e98096f/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py#L3853\n\nThis is the only reason why I gave a -1 so if I\u0027m wrong just say and I will drop it immediately.","commit_id":"f5668e1068aa11a4350a20b14cf3594268b6e2c9"},{"author":{"_account_id":30555,"name":"Fernando Ferraz","display_name":"Fernando Ferraz","email":"fesilva@redhat.com","username":"fernandoperches"},"change_message_id":"7f54d85a8020e4eb1d70d14e6bd51128b401ea05","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            LOG.warning(\u0027Truncating the target_change_vol_name : %s, as it is \u0027"},{"line_number":169,"context_line":"                        \u0027exceeding the maximum volume name length supported \u0027"},{"line_number":170,"context_line":"                        \u0027by Storwize\u0027, target_change_vol_name)"},{"line_number":171,"context_line":"            target_change_vol_name \u003d (target_change_vol_name)[:63]"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        return target_change_vol_name"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"14054209_edb8b12d","line":171,"in_reply_to":"514ad94e_26d6723e","updated":"2021-08-30 18:32:42.000000000","message":"Ok great, so I will remove the -1 as my point was already verified and tested by Amar.","commit_id":"f5668e1068aa11a4350a20b14cf3594268b6e2c9"},{"author":{"_account_id":32075,"name":"Amar","display_name":"Amar Rajeev Singuluri","email":"amar.rajeev.singuluri@ibm.com","username":"amar7ibm"},"change_message_id":"5dc4d3bcddb3ede037cbc3c6e91e1c91d76c8d25","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            LOG.warning(\u0027Truncating the target_change_vol_name : %s, as it is \u0027"},{"line_number":169,"context_line":"                        \u0027exceeding the maximum volume name length supported \u0027"},{"line_number":170,"context_line":"                        \u0027by Storwize\u0027, target_change_vol_name)"},{"line_number":171,"context_line":"            target_change_vol_name \u003d (target_change_vol_name)[:63]"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        return target_change_vol_name"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"514ad94e_26d6723e","line":171,"in_reply_to":"ebf2df7c_8e98631a","updated":"2021-08-30 10:29:08.000000000","message":"Initially while providing a fix, we were also considering all these after effect scenarios (like failing at name framing for extend and delete of volumes). But after conscientious testing we are sure that truncating of volume_name does not impact other cinder operations like EXTEND and DELETION of a volume, As the name framing happens as expected.","commit_id":"f5668e1068aa11a4350a20b14cf3594268b6e2c9"}]}
