)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20217,"name":"Anusha Unnam","email":"anusha.unnam25@gmail.com","username":"aunnam"},"change_message_id":"44d99ee543f99df810d3a77f65d229a94bdd01fd","unresolved":false,"context_lines":[{"line_number":11,"context_line":"That will orphan volumes. This commit add the status check after"},{"line_number":12,"context_line":"detaching the volumes."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"DocImpact: config options volume_detach_check_retries and"},{"line_number":15,"context_line":"volume_detach_check_retries_interval are added."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Co-Authored-By: ChangBo Guo (gcb) \u003ceric.guo@easystack.cn\u003e"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9a89bdaa_57543453","line":15,"range":{"start_line":14,"start_character":0,"end_line":15,"end_character":47},"updated":"2016-09-09 20:05:21.000000000","message":"Since these config options are not introduced in the code now, you can remove these from the commit message. Looking at the commit message and code is confusing.","commit_id":"ba7ca2d68da8331654036d332dbc9473b1a515d4"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"57c1ebc6a1e08bff804224b76fb176c47cefa7d4","unresolved":false,"context_lines":[{"line_number":11,"context_line":"That will orphan volumes. This commit add the status check after"},{"line_number":12,"context_line":"detaching the volumes."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"DocImpact: config options volume_detach_check_retries and"},{"line_number":15,"context_line":"volume_detach_check_retries_interval are added."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Co-Authored-By: ChangBo Guo (gcb) \u003ceric.guo@easystack.cn\u003e"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9a89bdaa_92187877","line":15,"range":{"start_line":14,"start_character":0,"end_line":15,"end_character":47},"in_reply_to":"9a89bdaa_57543453","updated":"2016-09-11 02:04:36.000000000","message":"Done","commit_id":"ba7ca2d68da8331654036d332dbc9473b1a515d4"}],"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"606b7d85547b65b31f1b3bdc8401407b3a4642b3","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                    \u0027cache. This may help with block device allocation \u0027"},{"line_number":150,"context_line":"                    \u0027performance. Look at the cinder \u0027"},{"line_number":151,"context_line":"                    \u0027image_volume_cache_enabled configuration option.\u0027),"},{"line_number":152,"context_line":"    cfg.IntOpt(\u0027volume_detach_check_retries\u0027,"},{"line_number":153,"context_line":"               default\u003d60,"},{"line_number":154,"context_line":"               help\u003d\u0027Number of times to retry volume detach \u0027"},{"line_number":155,"context_line":"                    \u0027status on failures.\\n\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_d47832fb","line":152,"updated":"2015-12-22 15:51:21.000000000","message":"Rather than add new config options I kind of wonder if we can just re-use the configs we already have for waiting for attach to complete.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"1a3afe28efa1bb35a6f7668f247439a9040cd70e","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                    \u0027cache. This may help with block device allocation \u0027"},{"line_number":150,"context_line":"                    \u0027performance. Look at the cinder \u0027"},{"line_number":151,"context_line":"                    \u0027image_volume_cache_enabled configuration option.\u0027),"},{"line_number":152,"context_line":"    cfg.IntOpt(\u0027volume_detach_check_retries\u0027,"},{"line_number":153,"context_line":"               default\u003d60,"},{"line_number":154,"context_line":"               help\u003d\u0027Number of times to retry volume detach \u0027"},{"line_number":155,"context_line":"                    \u0027status on failures.\\n\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_f582f1c7","line":152,"in_reply_to":"1a7b0d38_d47832fb","updated":"2015-12-23 05:56:16.000000000","message":"Some thing similar is the \u0027block_device_allocate_retries\u0027 which is used to check if the volume is allocated before doing the attach. If we use this parameter, do we have to change its name to reflect the usage of this commit?\nOr I am missing something better than that option.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"75fe803d1ed866c19dbd49b3780509bcd2a37c7b","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                    \u0027cache. This may help with block device allocation \u0027"},{"line_number":150,"context_line":"                    \u0027performance. Look at the cinder \u0027"},{"line_number":151,"context_line":"                    \u0027image_volume_cache_enabled configuration option.\u0027),"},{"line_number":152,"context_line":"    cfg.IntOpt(\u0027volume_detach_check_retries\u0027,"},{"line_number":153,"context_line":"               default\u003d60,"},{"line_number":154,"context_line":"               help\u003d\u0027Number of times to retry volume detach \u0027"},{"line_number":155,"context_line":"                    \u0027status on failures.\\n\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_da75c8ca","line":152,"in_reply_to":"1a7b0d38_f582f1c7","updated":"2016-01-15 14:16:33.000000000","message":"We could use the depracated_name option so we can change it to block_device_retries, or something like that.\n\nBut +1 to reusing the existing one.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"21491d5e9435d584719115fdad909af29ea5ddab","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                    \u0027cache. This may help with block device allocation \u0027"},{"line_number":150,"context_line":"                    \u0027performance. Look at the cinder \u0027"},{"line_number":151,"context_line":"                    \u0027image_volume_cache_enabled configuration option.\u0027),"},{"line_number":152,"context_line":"    cfg.IntOpt(\u0027volume_detach_check_retries\u0027,"},{"line_number":153,"context_line":"               default\u003d60,"},{"line_number":154,"context_line":"               help\u003d\u0027Number of times to retry volume detach \u0027"},{"line_number":155,"context_line":"                    \u0027status on failures.\\n\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a68dd71_7ce35334","line":152,"in_reply_to":"da6ed579_da75c8ca","updated":"2016-01-26 12:40:50.000000000","message":"Ok, I will do that.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"75fe803d1ed866c19dbd49b3780509bcd2a37c7b","unresolved":false,"context_lines":[{"line_number":191,"context_line":"               help\u003d\u0027Interval in seconds for retrying failed instance file \u0027"},{"line_number":192,"context_line":"                    \u0027deletes. Set to -1 to disable. \u0027"},{"line_number":193,"context_line":"                    \u0027Setting this to 0 will run at the default rate.\u0027),"},{"line_number":194,"context_line":"    cfg.IntOpt(\u0027block_device_allocate_retries_interval\u0027,"},{"line_number":195,"context_line":"               default\u003d3,"},{"line_number":196,"context_line":"               help\u003d\u0027Waiting time interval (seconds) between block\u0027"},{"line_number":197,"context_line":"                    \u0027 device allocation retries on failures\u0027),"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_9a52f033","line":194,"updated":"2016-01-15 14:16:33.000000000","message":"as above, lets just use the same interval?","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"75fe803d1ed866c19dbd49b3780509bcd2a37c7b","unresolved":false,"context_lines":[{"line_number":1447,"context_line":"        # (1) treat  negative config value as 0"},{"line_number":1448,"context_line":"        # (2) the configured value is 0, one attempt should be made"},{"line_number":1449,"context_line":"        # (3) the configured value is \u003e 0, then the total number attempts"},{"line_number":1450,"context_line":"        #      is (retries + 1)"},{"line_number":1451,"context_line":"        attempts \u003d 1"},{"line_number":1452,"context_line":"        if retries \u003e\u003d 1:"},{"line_number":1453,"context_line":"            attempts \u003d retries + 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_f5077f15","line":1450,"updated":"2016-01-15 14:16:33.000000000","message":"The above details should really be in the description of the config value. I assume this matches how the other config is used?","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"21491d5e9435d584719115fdad909af29ea5ddab","unresolved":false,"context_lines":[{"line_number":1447,"context_line":"        # (1) treat  negative config value as 0"},{"line_number":1448,"context_line":"        # (2) the configured value is 0, one attempt should be made"},{"line_number":1449,"context_line":"        # (3) the configured value is \u003e 0, then the total number attempts"},{"line_number":1450,"context_line":"        #      is (retries + 1)"},{"line_number":1451,"context_line":"        attempts \u003d 1"},{"line_number":1452,"context_line":"        if retries \u003e\u003d 1:"},{"line_number":1453,"context_line":"            attempts \u003d retries + 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a68dd71_7c683388","line":1450,"in_reply_to":"da6ed579_f5077f15","updated":"2016-01-26 12:40:50.000000000","message":"Yes, it is more approperiate to move these description to the config value. I will move these comments there.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"606b7d85547b65b31f1b3bdc8401407b3a4642b3","unresolved":false,"context_lines":[{"line_number":2356,"context_line":"                # NOTE(vish): actual driver detach done in driver.destroy, so"},{"line_number":2357,"context_line":"                #             just tell cinder that we are done with it."},{"line_number":2358,"context_line":"                connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":2359,"context_line":"                self.volume_api.terminate_connection(context,"},{"line_number":2360,"context_line":"                                                     bdm.volume_id,"},{"line_number":2361,"context_line":"                                                     connector)"},{"line_number":2362,"context_line":"                self.volume_api.detach(context, bdm.volume_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_f4644e4a","line":2359,"updated":"2015-12-22 15:51:21.000000000","message":"terminate_connection is also async, do we need to wait for that to complete before we call the detach API in cinder? Maybe Scott can answer that.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"df0c7c2b247f912757aed919f128fd507c1480b8","unresolved":false,"context_lines":[{"line_number":2356,"context_line":"                # NOTE(vish): actual driver detach done in driver.destroy, so"},{"line_number":2357,"context_line":"                #             just tell cinder that we are done with it."},{"line_number":2358,"context_line":"                connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":2359,"context_line":"                self.volume_api.terminate_connection(context,"},{"line_number":2360,"context_line":"                                                     bdm.volume_id,"},{"line_number":2361,"context_line":"                                                     connector)"},{"line_number":2362,"context_line":"                self.volume_api.detach(context, bdm.volume_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_2b7d2f6e","line":2359,"in_reply_to":"1a7b0d38_f4644e4a","updated":"2016-01-04 17:30:36.000000000","message":"We do not have to wait for terminate_connection to complete in order to call the detach API. Changing the nova \u003c-\u003e Cinder API to verify that this succeeds has benefits, but it\u0027s beyond the scope of this patch.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"da55bb417a875417c784b5c28266ce4eccd406a0","unresolved":false,"context_lines":[{"line_number":2360,"context_line":"                                                     bdm.volume_id,"},{"line_number":2361,"context_line":"                                                     connector)"},{"line_number":2362,"context_line":"                self.volume_api.detach(context, bdm.volume_id)"},{"line_number":2363,"context_line":"                self._await_volume_detached(context, bdm.volume_id)"},{"line_number":2364,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2365,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"},{"line_number":2366,"context_line":"                          instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_7f37d7e3","line":2363,"updated":"2015-12-22 15:56:01.000000000","message":"Thinking out loud, we really only care about this in the case that nova is going to delete the volume (in _cleanup_volumes), so we could actually move this wait code into that method, right before calling:\n\nself.volume_api.delete(context, bdm.volume_id)\n\nBut maybe that confuses things.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"1a3afe28efa1bb35a6f7668f247439a9040cd70e","unresolved":false,"context_lines":[{"line_number":2360,"context_line":"                                                     bdm.volume_id,"},{"line_number":2361,"context_line":"                                                     connector)"},{"line_number":2362,"context_line":"                self.volume_api.detach(context, bdm.volume_id)"},{"line_number":2363,"context_line":"                self._await_volume_detached(context, bdm.volume_id)"},{"line_number":2364,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2365,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"},{"line_number":2366,"context_line":"                          instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_ff59708f","line":2363,"in_reply_to":"1a7b0d38_7f37d7e3","updated":"2015-12-23 05:56:16.000000000","message":"Yes, that is what I hesitated about before putting this check here.\nIf we put this check right before deleting, all detach requests will be sent here in a row. Then, the checking won\u0027t block subsequencing detach request. I am not sure if that is better. If the volume service is corrupted, sending all the request isn\u0027t that soundable.\nBesides, I agree with you that it confuses.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"75fe803d1ed866c19dbd49b3780509bcd2a37c7b","unresolved":false,"context_lines":[{"line_number":2360,"context_line":"                                                     bdm.volume_id,"},{"line_number":2361,"context_line":"                                                     connector)"},{"line_number":2362,"context_line":"                self.volume_api.detach(context, bdm.volume_id)"},{"line_number":2363,"context_line":"                self._await_volume_detached(context, bdm.volume_id)"},{"line_number":2364,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2365,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"},{"line_number":2366,"context_line":"                          instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_956643b9","line":2363,"in_reply_to":"1a7b0d38_ff59708f","updated":"2016-01-15 14:16:33.000000000","message":"Either way, I wonder if we would be better having a second loop to wait, after sending all the detach calls.\n\nOtherwise this is likely to take far long that it has to.\n\nOnly caring about the delete, seems even better.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"21491d5e9435d584719115fdad909af29ea5ddab","unresolved":false,"context_lines":[{"line_number":2360,"context_line":"                                                     bdm.volume_id,"},{"line_number":2361,"context_line":"                                                     connector)"},{"line_number":2362,"context_line":"                self.volume_api.detach(context, bdm.volume_id)"},{"line_number":2363,"context_line":"                self._await_volume_detached(context, bdm.volume_id)"},{"line_number":2364,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2365,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"},{"line_number":2366,"context_line":"                          instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a68dd71_3cd71b25","line":2363,"in_reply_to":"da6ed579_956643b9","updated":"2016-01-26 12:40:50.000000000","message":"OK. Let\u0027s just put this check right before volume delete.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":20217,"name":"Anusha Unnam","email":"anusha.unnam25@gmail.com","username":"aunnam"},"change_message_id":"44d99ee543f99df810d3a77f65d229a94bdd01fd","unresolved":false,"context_lines":[{"line_number":2283,"context_line":"            if bdm.volume_id and bdm.delete_on_termination:"},{"line_number":2284,"context_line":"                try:"},{"line_number":2285,"context_line":"                    self.volume_api.delete(context, bdm.volume_id)"},{"line_number":2286,"context_line":"                    self._await_volume_detached(context, bdm.volume_id)"},{"line_number":2287,"context_line":"                except Exception as exc:"},{"line_number":2288,"context_line":"                    exc_info \u003d sys.exc_info()"},{"line_number":2289,"context_line":"                    LOG.warning(_LW(\u0027Failed to delete volume: %(volume_id)s \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a89bdaa_77abf81e","line":2286,"range":{"start_line":2286,"start_character":20,"end_line":2286,"end_character":71},"updated":"2016-09-09 20:05:21.000000000","message":"Isn\u0027t this wait check should be before the volume_api.delete call, because this check should be made before we call delete to ensure status is available right?","commit_id":"ba7ca2d68da8331654036d332dbc9473b1a515d4"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"57c1ebc6a1e08bff804224b76fb176c47cefa7d4","unresolved":false,"context_lines":[{"line_number":2283,"context_line":"            if bdm.volume_id and bdm.delete_on_termination:"},{"line_number":2284,"context_line":"                try:"},{"line_number":2285,"context_line":"                    self.volume_api.delete(context, bdm.volume_id)"},{"line_number":2286,"context_line":"                    self._await_volume_detached(context, bdm.volume_id)"},{"line_number":2287,"context_line":"                except Exception as exc:"},{"line_number":2288,"context_line":"                    exc_info \u003d sys.exc_info()"},{"line_number":2289,"context_line":"                    LOG.warning(_LW(\u0027Failed to delete volume: %(volume_id)s \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a89bdaa_f21f0459","line":2286,"range":{"start_line":2286,"start_character":20,"end_line":2286,"end_character":71},"in_reply_to":"9a89bdaa_77abf81e","updated":"2016-09-11 02:04:36.000000000","message":"Done","commit_id":"ba7ca2d68da8331654036d332dbc9473b1a515d4"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c564d0acf9047d13423b1f25994c264f8ec545a6","unresolved":false,"context_lines":[{"line_number":1256,"context_line":"    def _await_volume_detached(self, context, vol_id):"},{"line_number":1257,"context_line":"        start \u003d time.time()"},{"line_number":1258,"context_line":"        retries \u003d CONF.block_device_allocate_retries"},{"line_number":1259,"context_line":"        if retries \u003c 0:"},{"line_number":1260,"context_line":"            LOG.warning(_LW(\"Treating negative config value (%(retries)s) for \""},{"line_number":1261,"context_line":"                            \"\u0027block_device_retries\u0027 as 0.\"),"},{"line_number":1262,"context_line":"                        {\u0027retries\u0027: retries})"},{"line_number":1263,"context_line":""},{"line_number":1264,"context_line":"        attempts \u003d 1"},{"line_number":1265,"context_line":"        if retries \u003e\u003d 1:"},{"line_number":1266,"context_line":"            attempts \u003d retries + 1"},{"line_number":1267,"context_line":"        for attempt in range(1, attempts + 1):"},{"line_number":1268,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1269,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_0690a1eb","line":1266,"range":{"start_line":1259,"start_character":0,"end_line":1266,"end_character":34},"updated":"2017-03-09 08:35:51.000000000","message":"This block code could be refactored like this:\n\n        if retries \u003c 0:\n            LOG.warning(_LW(\"Treating negative config value (%(retries)s) for \"\n                            \"\u0027block_device_retries\u0027 as 0.\"),\n                        {\u0027retries\u0027: retries})\n           retries \u003d 0\n\n        attempts \u003d retries + 1","commit_id":"64cd1b3a59f78551dec542b6490a2dff147886b1"},{"author":{"_account_id":17842,"name":"Huangsm","email":"huangsm@awcloud.com","username":"Huangsm"},"change_message_id":"3f61cf2628962795cae89bf9f3da74877b8583b8","unresolved":false,"context_lines":[{"line_number":1256,"context_line":"    def _await_volume_detached(self, context, vol_id):"},{"line_number":1257,"context_line":"        start \u003d time.time()"},{"line_number":1258,"context_line":"        retries \u003d CONF.block_device_allocate_retries"},{"line_number":1259,"context_line":"        if retries \u003c 0:"},{"line_number":1260,"context_line":"            LOG.warning(_LW(\"Treating negative config value (%(retries)s) for \""},{"line_number":1261,"context_line":"                            \"\u0027block_device_retries\u0027 as 0.\"),"},{"line_number":1262,"context_line":"                        {\u0027retries\u0027: retries})"},{"line_number":1263,"context_line":""},{"line_number":1264,"context_line":"        attempts \u003d 1"},{"line_number":1265,"context_line":"        if retries \u003e\u003d 1:"},{"line_number":1266,"context_line":"            attempts \u003d retries + 1"},{"line_number":1267,"context_line":"        for attempt in range(1, attempts + 1):"},{"line_number":1268,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1269,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_5cd266d3","line":1266,"range":{"start_line":1259,"start_character":0,"end_line":1266,"end_character":34},"in_reply_to":"9a30ddce_0690a1eb","updated":"2017-03-09 09:44:39.000000000","message":"Done","commit_id":"64cd1b3a59f78551dec542b6490a2dff147886b1"},{"author":{"_account_id":9796,"name":"ChangBo Guo","email":"glongwave@gmail.com","username":"gcb"},"change_message_id":"cf5083e325b6351e17a3c425646d76bcc523a9df","unresolved":false,"context_lines":[{"line_number":1256,"context_line":"    def _await_volume_detached(self, context, vol_id):"},{"line_number":1257,"context_line":"        start \u003d time.time()"},{"line_number":1258,"context_line":"        retries \u003d CONF.block_device_allocate_retries"},{"line_number":1259,"context_line":"        if retries \u003c 0:"},{"line_number":1260,"context_line":"            LOG.warning(_LW(\"Treating negative config value (%(retries)s) for \""},{"line_number":1261,"context_line":"                            \"\u0027block_device_retries\u0027 as 0.\"),"},{"line_number":1262,"context_line":"                        {\u0027retries\u0027: retries})"},{"line_number":1263,"context_line":""},{"line_number":1264,"context_line":"        attempts \u003d 1"},{"line_number":1265,"context_line":"        if retries \u003e\u003d 1:"},{"line_number":1266,"context_line":"            attempts \u003d retries + 1"},{"line_number":1267,"context_line":"        for attempt in range(1, attempts + 1):"},{"line_number":1268,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1269,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_7c9d6a58","line":1266,"range":{"start_line":1259,"start_character":0,"end_line":1266,"end_character":34},"in_reply_to":"9a30ddce_0690a1eb","updated":"2017-03-09 09:20:40.000000000","message":"This is follow the way of _await_block_device_map_created, if we need redactor the code, another patch will be good which changes both of  _await_block_device_map_created and  _await_volume_detached","commit_id":"64cd1b3a59f78551dec542b6490a2dff147886b1"},{"author":{"_account_id":17842,"name":"Huangsm","email":"huangsm@awcloud.com","username":"Huangsm"},"change_message_id":"3f61cf2628962795cae89bf9f3da74877b8583b8","unresolved":false,"context_lines":[{"line_number":1270,"context_line":"            if volume_status not in [\u0027in-use\u0027, \u0027detaching\u0027]:"},{"line_number":1271,"context_line":"                if volume_status \u003d\u003d \u0027available\u0027:"},{"line_number":1272,"context_line":"                    return attempt"},{"line_number":1273,"context_line":"                LOG.warning(_LW(\"Volume id: %(vol_id)s finished being \""},{"line_number":1274,"context_line":"                                \"detached but its status is %(vol_status)s.\"),"},{"line_number":1275,"context_line":"                            {\u0027vol_id\u0027: vol_id,"},{"line_number":1276,"context_line":"                             \u0027vol_status\u0027: volume_status})"},{"line_number":1277,"context_line":"                break"},{"line_number":1278,"context_line":"            greenthread.sleep(CONF.block_device_allocate_retries_interval)"},{"line_number":1279,"context_line":"        raise exception.VolumeNotDetached(volume_id\u003dvol_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_9f213050","line":1276,"range":{"start_line":1273,"start_character":0,"end_line":1276,"end_character":58},"updated":"2017-03-09 09:44:39.000000000","message":"I suggest modifying the log description because the description is in conflict with the exception message","commit_id":"64cd1b3a59f78551dec542b6490a2dff147886b1"},{"author":{"_account_id":17842,"name":"Huangsm","email":"huangsm@awcloud.com","username":"Huangsm"},"change_message_id":"3f61cf2628962795cae89bf9f3da74877b8583b8","unresolved":false,"context_lines":[{"line_number":1267,"context_line":"        for attempt in range(1, attempts + 1):"},{"line_number":1268,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1269,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"},{"line_number":1270,"context_line":"            if volume_status not in [\u0027in-use\u0027, \u0027detaching\u0027]:"},{"line_number":1271,"context_line":"                if volume_status \u003d\u003d \u0027available\u0027:"},{"line_number":1272,"context_line":"                    return attempt"},{"line_number":1273,"context_line":"                LOG.warning(_LW(\"Volume id: %(vol_id)s finished being \""},{"line_number":1274,"context_line":"                                \"detached but its status is %(vol_status)s.\"),"},{"line_number":1275,"context_line":"                            {\u0027vol_id\u0027: vol_id,"},{"line_number":1276,"context_line":"                             \u0027vol_status\u0027: volume_status})"},{"line_number":1277,"context_line":"                break"},{"line_number":1278,"context_line":"            greenthread.sleep(CONF.block_device_allocate_retries_interval)"},{"line_number":1279,"context_line":"        raise exception.VolumeNotDetached(volume_id\u003dvol_id,"},{"line_number":1280,"context_line":"                                         seconds\u003dint(time.time() - start),"},{"line_number":1281,"context_line":"                                         attempts\u003dattempt,"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_ffe30c31","line":1278,"range":{"start_line":1270,"start_character":0,"end_line":1278,"end_character":74},"updated":"2017-03-09 09:44:39.000000000","message":"This block code could be refactored like this:\n          if volume_status \u003d\u003d \u0027avaiable\u0027:\n              return attempt\n          elif volume_status not in [\u0027in-use\u0027, \u0027detaching\u0027]:\n              LOG.waring(.....)\n              break\n          else:\n              greenthread.sleep(....)","commit_id":"64cd1b3a59f78551dec542b6490a2dff147886b1"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"a467bb02c7c597ab0a6c855b2088b679b2c8c708","unresolved":false,"context_lines":[{"line_number":528,"context_line":"                \u0027id\u0027: \u0027blah\u0027,"},{"line_number":529,"context_line":"            }"},{"line_number":530,"context_line":""},{"line_number":531,"context_line":"        self.stubs.Set(self.compute.volume_api, \u0027get\u0027, never_get)"},{"line_number":532,"context_line":"        self.assertRaises(exception.VolumeNotDetached,"},{"line_number":533,"context_line":"                          self.compute._await_volume_detached,"},{"line_number":534,"context_line":"                          self.context, \u00271\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_764580b1","line":531,"updated":"2016-01-19 16:52:09.000000000","message":"as per https://blueprints.launchpad.net/nova/+spec/remove-mox can you use the new method self.stub_out instead of the mox method?","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"21491d5e9435d584719115fdad909af29ea5ddab","unresolved":false,"context_lines":[{"line_number":528,"context_line":"                \u0027id\u0027: \u0027blah\u0027,"},{"line_number":529,"context_line":"            }"},{"line_number":530,"context_line":""},{"line_number":531,"context_line":"        self.stubs.Set(self.compute.volume_api, \u0027get\u0027, never_get)"},{"line_number":532,"context_line":"        self.assertRaises(exception.VolumeNotDetached,"},{"line_number":533,"context_line":"                          self.compute._await_volume_detached,"},{"line_number":534,"context_line":"                          self.context, \u00271\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a68dd71_fce0a3fc","line":531,"in_reply_to":"ba63e191_764580b1","updated":"2016-01-26 12:40:50.000000000","message":"Done","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"636baeabe5db04e5ffbbda28bf3c1c4109245a25","unresolved":false,"context_lines":[{"line_number":528,"context_line":"                \u0027id\u0027: \u0027blah\u0027,"},{"line_number":529,"context_line":"            }"},{"line_number":530,"context_line":""},{"line_number":531,"context_line":"        self.stubs.Set(self.compute.volume_api, \u0027get\u0027, never_get)"},{"line_number":532,"context_line":"        self.assertRaises(exception.VolumeNotDetached,"},{"line_number":533,"context_line":"                          self.compute._await_volume_detached,"},{"line_number":534,"context_line":"                          self.context, \u00271\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a5de9d1_f599a220","line":531,"in_reply_to":"ba63e191_764580b1","updated":"2016-01-27 11:17:41.000000000","message":"In the setup() of this class at line 368, it did the stub.Set(self.compute.volume_api, \u0027get\u0027, ...). So switch to use self.stub_out may have to change the whole class. Let\u0027s do this switch in a seperated patch.","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"a467bb02c7c597ab0a6c855b2088b679b2c8c708","unresolved":false,"context_lines":[{"line_number":561,"context_line":"                \u0027id\u0027: \u0027blah\u0027,"},{"line_number":562,"context_line":"            }"},{"line_number":563,"context_line":""},{"line_number":564,"context_line":"        self.stubs.Set(c.volume_api, \u0027get\u0027, slow_get)"},{"line_number":565,"context_line":"        attempts \u003d c._await_volume_detached(self.context, \u00271\u0027)"},{"line_number":566,"context_line":"        self.assertEqual(attempts, 3)"},{"line_number":567,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_761ca0c1","line":564,"updated":"2016-01-19 16:52:09.000000000","message":"same as above","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"21491d5e9435d584719115fdad909af29ea5ddab","unresolved":false,"context_lines":[{"line_number":561,"context_line":"                \u0027id\u0027: \u0027blah\u0027,"},{"line_number":562,"context_line":"            }"},{"line_number":563,"context_line":""},{"line_number":564,"context_line":"        self.stubs.Set(c.volume_api, \u0027get\u0027, slow_get)"},{"line_number":565,"context_line":"        attempts \u003d c._await_volume_detached(self.context, \u00271\u0027)"},{"line_number":566,"context_line":"        self.assertEqual(attempts, 3)"},{"line_number":567,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a68dd71_9ce64715","line":564,"in_reply_to":"ba63e191_761ca0c1","updated":"2016-01-26 12:40:50.000000000","message":"Done","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"a467bb02c7c597ab0a6c855b2088b679b2c8c708","unresolved":false,"context_lines":[{"line_number":576,"context_line":"                \u0027id\u0027: \u0027blah\u0027,"},{"line_number":577,"context_line":"            }"},{"line_number":578,"context_line":""},{"line_number":579,"context_line":"        self.stubs.Set(c.volume_api, \u0027get\u0027, volume_get)"},{"line_number":580,"context_line":"        attempts \u003d c._await_volume_detached(self.context, \u00271\u0027)"},{"line_number":581,"context_line":"        self.assertEqual(1, attempts)"},{"line_number":582,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_f68650da","line":579,"updated":"2016-01-19 16:52:09.000000000","message":"same as above","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"21491d5e9435d584719115fdad909af29ea5ddab","unresolved":false,"context_lines":[{"line_number":576,"context_line":"                \u0027id\u0027: \u0027blah\u0027,"},{"line_number":577,"context_line":"            }"},{"line_number":578,"context_line":""},{"line_number":579,"context_line":"        self.stubs.Set(c.volume_api, \u0027get\u0027, volume_get)"},{"line_number":580,"context_line":"        attempts \u003d c._await_volume_detached(self.context, \u00271\u0027)"},{"line_number":581,"context_line":"        self.assertEqual(1, attempts)"},{"line_number":582,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a68dd71_5cf0cfc9","line":579,"in_reply_to":"ba63e191_f68650da","updated":"2016-01-26 12:40:50.000000000","message":"Done","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"a467bb02c7c597ab0a6c855b2088b679b2c8c708","unresolved":false,"context_lines":[{"line_number":591,"context_line":"                \u0027id\u0027: \u0027blah\u0027,"},{"line_number":592,"context_line":"            }"},{"line_number":593,"context_line":""},{"line_number":594,"context_line":"        self.stubs.Set(c.volume_api, \u0027get\u0027, volume_get)"},{"line_number":595,"context_line":"        attempts \u003d c._await_volume_detached(self.context, \u00271\u0027)"},{"line_number":596,"context_line":"        self.assertEqual(1, attempts)"},{"line_number":597,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_76734016","line":594,"updated":"2016-01-19 16:52:09.000000000","message":"same as above","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"21491d5e9435d584719115fdad909af29ea5ddab","unresolved":false,"context_lines":[{"line_number":591,"context_line":"                \u0027id\u0027: \u0027blah\u0027,"},{"line_number":592,"context_line":"            }"},{"line_number":593,"context_line":""},{"line_number":594,"context_line":"        self.stubs.Set(c.volume_api, \u0027get\u0027, volume_get)"},{"line_number":595,"context_line":"        attempts \u003d c._await_volume_detached(self.context, \u00271\u0027)"},{"line_number":596,"context_line":"        self.assertEqual(1, attempts)"},{"line_number":597,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a68dd71_1cb9f7ec","line":594,"in_reply_to":"ba63e191_76734016","updated":"2016-01-26 12:40:50.000000000","message":"Done","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"a467bb02c7c597ab0a6c855b2088b679b2c8c708","unresolved":false,"context_lines":[{"line_number":9919,"context_line":""},{"line_number":9920,"context_line":"        self.stubs.Set(self.compute, \u0027volume_api\u0027, mox.MockAnything())"},{"line_number":9921,"context_line":"        self.stubs.Set(self.compute, \u0027_prep_block_device\u0027, mox.MockAnything())"},{"line_number":9922,"context_line":"        self.stubs.Set(self.compute.volume_api, \u0027get\u0027, fake_volume_get)"},{"line_number":9923,"context_line":"        self.compute.build_and_run_instance(self.context, instance, {}, {}, {},"},{"line_number":9924,"context_line":"                                            block_device_mapping\u003d[])"},{"line_number":9925,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_96dcb4e5","line":9922,"updated":"2016-01-19 16:52:09.000000000","message":"same as above, I _think_ it is ok if you change the other two previous stubs in this method as well","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"},{"author":{"_account_id":14762,"name":"Zhihai Song","email":"zhhsng@gmail.com","username":"ZhihaiSong"},"change_message_id":"21491d5e9435d584719115fdad909af29ea5ddab","unresolved":false,"context_lines":[{"line_number":9919,"context_line":""},{"line_number":9920,"context_line":"        self.stubs.Set(self.compute, \u0027volume_api\u0027, mox.MockAnything())"},{"line_number":9921,"context_line":"        self.stubs.Set(self.compute, \u0027_prep_block_device\u0027, mox.MockAnything())"},{"line_number":9922,"context_line":"        self.stubs.Set(self.compute.volume_api, \u0027get\u0027, fake_volume_get)"},{"line_number":9923,"context_line":"        self.compute.build_and_run_instance(self.context, instance, {}, {}, {},"},{"line_number":9924,"context_line":"                                            block_device_mapping\u003d[])"},{"line_number":9925,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a68dd71_fcb743f3","line":9922,"in_reply_to":"ba63e191_96dcb4e5","updated":"2016-01-26 12:40:50.000000000","message":"Done","commit_id":"984bebd59d2a5555d1568952cdedcbc0ab6de896"}]}
