)]}'
{"cinder/compute/nova.py":[{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"ecaee4b31d692c0177516b96f668e616c87c20c2","unresolved":false,"context_lines":[{"line_number":139,"context_line":"    def get_server(self, context, server_id):"},{"line_number":140,"context_line":"        try:"},{"line_number":141,"context_line":"            return novaclient(context).servers.get(server_id)"},{"line_number":142,"context_line":"        except Exception:"},{"line_number":143,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_493c9f2f","line":142,"updated":"2014-12-23 04:31:23.000000000","message":"Treating every possible exception as instance being deleted is not right at all.","commit_id":"e50fca29d1b1ab725a7d8aa76ac5a3183479856a"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"dceadf54f00ade37032897634616b1ccfdf5df35","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        try:"},{"line_number":141,"context_line":"            return novaclient(context).servers.get(server_id)"},{"line_number":142,"context_line":"        except Exception:"},{"line_number":143,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_138a3964","line":143,"updated":"2015-01-02 12:08:33.000000000","message":"I think it is not a good choice to silent swallow exceptions in api level. At least you should log the exception.","commit_id":"e50fca29d1b1ab725a7d8aa76ac5a3183479856a"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"392527cb9ecf15afc03efcc664d43482fb829357","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        try:"},{"line_number":197,"context_line":"            novaclient(context).servers.get(server_id)"},{"line_number":198,"context_line":"            return True"},{"line_number":199,"context_line":"        except nova_exceptions.NotFound:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Server (%s) deleted\u0027 % server_id)"},{"line_number":201,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_f93867f0","line":199,"updated":"2015-01-12 10:17:22.000000000","message":"Much better exception. Nice.","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"4b8c4f883317f590eab496e66cf526b4d9264aee","unresolved":false,"context_lines":[{"line_number":197,"context_line":"            novaclient(context).servers.get(server_id)"},{"line_number":198,"context_line":"            return True"},{"line_number":199,"context_line":"        except nova_exceptions.NotFound:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Server (%s) deleted\u0027 % server_id)"},{"line_number":201,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_01b771f6","line":200,"updated":"2015-01-12 15:00:13.000000000","message":"Please, replace \u0027%\u0027 to \u0027,\u0027 according to a logging guidelines","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"23d51d38549e7ea83b4f805660c3465bba22435f","unresolved":false,"context_lines":[{"line_number":197,"context_line":"            novaclient(context).servers.get(server_id)"},{"line_number":198,"context_line":"            return True"},{"line_number":199,"context_line":"        except nova_exceptions.NotFound:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Server (%s) deleted\u0027 % server_id)"},{"line_number":201,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_7e38923b","line":200,"updated":"2015-01-14 00:50:23.000000000","message":"Trung, somewhere else failed to comply with the logging guideline isn\u0027t the excuse for new code skip doing the right thing.","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":12861,"name":"Trung Trinh","email":"trungtt1981@gmail.com","username":"ttt"},"change_message_id":"db12d1731a65dafb09e56d61d52d3b49cd751e2c","unresolved":false,"context_lines":[{"line_number":197,"context_line":"            novaclient(context).servers.get(server_id)"},{"line_number":198,"context_line":"            return True"},{"line_number":199,"context_line":"        except nova_exceptions.NotFound:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Server (%s) deleted\u0027 % server_id)"},{"line_number":201,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_3e70f107","line":200,"in_reply_to":"3a961159_01b771f6","updated":"2015-01-13 04:22:08.000000000","message":"@Ivan:\nWhen you look at the module \"snapshot_actions.py\", at line #48, you will see that \"%\" can be used:\n                  LOG.debug(\"body: %s\" % body)\n\nLink: https://github.com/openstack/cinder/blob/master/cinder/api/contrib/snapshot_actions.py\n\nSo, I think I don\u0027t have to change it","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":12861,"name":"Trung Trinh","email":"trungtt1981@gmail.com","username":"ttt"},"change_message_id":"eaf130e23599d1b65635f54790bff2b1a3934200","unresolved":false,"context_lines":[{"line_number":197,"context_line":"            novaclient(context).servers.get(server_id)"},{"line_number":198,"context_line":"            return True"},{"line_number":199,"context_line":"        except nova_exceptions.NotFound:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Server (%s) deleted\u0027 % server_id)"},{"line_number":201,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_9aff0702","line":200,"in_reply_to":"3a961159_7e38923b","updated":"2015-01-14 03:30:10.000000000","message":"Ok, I\u0027ll change as you want.\n\nHowever, my personal opinion is why the logging guideline (mentioned here) does not comply with the standard Python coding in defining or creating a formatted string???\n\nFor example: some_str \u003d \"Some content with some value %s\" % val","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"bdd84e4dc4983614bf704c44bb7deff4240db922","unresolved":false,"context_lines":[{"line_number":197,"context_line":"            novaclient(context).servers.get(server_id)"},{"line_number":198,"context_line":"            return True"},{"line_number":199,"context_line":"        except nova_exceptions.NotFound:"},{"line_number":200,"context_line":"            LOG.debug(\u0027Server (%s) deleted\u0027 % server_id)"},{"line_number":201,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_22d09af6","line":200,"in_reply_to":"3a961159_9aff0702","updated":"2015-01-14 14:40:38.000000000","message":"The question isn\u0027t about the correct way to format a string, but rather the more efficient way to do logging. The logging framework will handle doing the final string formatting, but only if the logging level actually makes it necessary to do so.\n\nThe point is to avoid doing unnecessary string interpolation if the logging level will just throw away the string anyway.","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"}],"cinder/tests/unit/test_volume.py":[{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"09dfa41d8fbf12bfffa75230b47b087fd3fe7752","unresolved":false,"context_lines":[{"line_number":2875,"context_line":""},{"line_number":2876,"context_line":"        volume_api \u003d cinder.volume.api.API()"},{"line_number":2877,"context_line":""},{"line_number":2878,"context_line":"        self.assertRaises(exception.VolumeAttached,"},{"line_number":2879,"context_line":"                          volume_api.delete,"},{"line_number":2880,"context_line":"                          self.context,"},{"line_number":2881,"context_line":"                          volume,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a016987_4a3993f1","line":2878,"updated":"2015-05-19 07:30:05.000000000","message":"gate-cinder-python27 reports \u0027Volume\u0027 object has no attribute \u0027instance_uuid\u0027.","commit_id":"10af04618014a74b2e568fd630f5f260cf41ba15"}],"cinder/volume/api.py":[{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"dceadf54f00ade37032897634616b1ccfdf5df35","unresolved":false,"context_lines":[{"line_number":286,"context_line":"        # Check if possible or not to allow deleting volume attached to"},{"line_number":287,"context_line":"        # an already-deleted VM"},{"line_number":288,"context_line":"        vol_delete_allowed \u003d False"},{"line_number":289,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \u0027in-use\u0027 and \\"},{"line_number":290,"context_line":"           volume[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and\\"},{"line_number":291,"context_line":"           volume[\u0027instance_uuid\u0027] is not None:"},{"line_number":292,"context_line":"                srv \u003d self.novaapi.get_server(context, volume[\u0027instance_uuid\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_71fd356e","line":289,"updated":"2015-01-02 12:08:33.000000000","message":"You can use parentheses to replace \u0027\\\u0027","commit_id":"e50fca29d1b1ab725a7d8aa76ac5a3183479856a"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"dceadf54f00ade37032897634616b1ccfdf5df35","unresolved":false,"context_lines":[{"line_number":288,"context_line":"        vol_delete_allowed \u003d False"},{"line_number":289,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \u0027in-use\u0027 and \\"},{"line_number":290,"context_line":"           volume[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and\\"},{"line_number":291,"context_line":"           volume[\u0027instance_uuid\u0027] is not None:"},{"line_number":292,"context_line":"                srv \u003d self.novaapi.get_server(context, volume[\u0027instance_uuid\u0027])"},{"line_number":293,"context_line":"                if srv is None:"},{"line_number":294,"context_line":"                    vol_delete_allowed \u003d True"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_718295c9","line":291,"updated":"2015-01-02 12:08:33.000000000","message":"I think the combined conditions here is duplicated with the one in manager.py. If the api.py already checks the condition, why manager.py needs to check them again? Could you extract a common function instead of duplicated code?","commit_id":"e50fca29d1b1ab725a7d8aa76ac5a3183479856a"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"dceadf54f00ade37032897634616b1ccfdf5df35","unresolved":false,"context_lines":[{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        # Skip the Exception to allow deleting volume attached to"},{"line_number":297,"context_line":"        # an already-deleted VM"},{"line_number":298,"context_line":"        if not vol_delete_allowed:"},{"line_number":299,"context_line":"            if volume[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":300,"context_line":"                # Volume is still attached, need to detach first"},{"line_number":301,"context_line":"                raise exception.VolumeAttached(volume_id\u003dvolume_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_f175a5fa","line":298,"updated":"2015-01-02 12:08:33.000000000","message":"I think you and remove variable \u0027\u0027vol_delete_allowed\u0027 and make the code clearer here.","commit_id":"e50fca29d1b1ab725a7d8aa76ac5a3183479856a"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"23d51d38549e7ea83b4f805660c3465bba22435f","unresolved":false,"context_lines":[{"line_number":291,"context_line":"            volume[\u0027instance_uuid\u0027] is not None and"},{"line_number":292,"context_line":"            self.novaapi.is_server_deleted(context,"},{"line_number":293,"context_line":"                                           volume[\u0027instance_uuid\u0027])):"},{"line_number":294,"context_line":"                vol_delete_allowed \u003d True"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        # Skip the Exception to allow deleting volume attached to"},{"line_number":297,"context_line":"        # an already-deleted VM"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_9e47febb","line":294,"updated":"2015-01-14 00:50:23.000000000","message":"Over-indent here.","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"23d51d38549e7ea83b4f805660c3465bba22435f","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        if not vol_delete_allowed:"},{"line_number":299,"context_line":"            if volume[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":300,"context_line":"                # Volume is still attached, need to detach first"},{"line_number":301,"context_line":"                raise exception.VolumeAttached(volume_id\u003dvolume_id)"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if not force and volume[\u0027status\u0027] not in [\"available\", \"error\","},{"line_number":304,"context_line":"                                                      \"error_restoring\","}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_be42faa8","line":301,"updated":"2015-01-14 00:50:23.000000000","message":"It\u0027s not entirely correct to raise VolumeAttached exception here if vol_delete_allowed is False only because force is False.\n\nI\u0027d suggest changing vol_delete_allowed flag to \u0027attached_instance_deleted\u0027, the code would be:\n\n    attached_instance_deleted \u003d False\n    if (volume[\u0027status\u0027] \u003d\u003d \u0027in-use\u0027 and\n        volume[\u0027attache_status\u0027] \u003d\u003d \u0027attached\u0027 and\n        volume[\u0027instance_uuid\u0027] is not None and\n        self.novaapi.is_server_deleted(context,\n                                       volume[\u0027instance_uuid\u0027])):\n        attached_instance_deleted \u003d True\n\n    if not attached_instance_deleted:\n        raise exception.VolumeAttached(volume_id\u003dvolume_id)\n\n    if not force and (volume[\u0027status\u0027] not in [\"available\", \"error\", \n                                                \"error_restoring\",\n                                                \"error_extending\"] or\n                      not attached_instance_deleted):\n        msg \u003d _(...)\n        raise exception.InvalidVolume(...)","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"320e6a465da52a169f269a5eee05180c0f59a637","unresolved":false,"context_lines":[{"line_number":291,"context_line":"            volume[\u0027instance_uuid\u0027] is not None and"},{"line_number":292,"context_line":"            self.novaapi.is_server_deleted(context,"},{"line_number":293,"context_line":"                                           volume[\u0027instance_uuid\u0027])):"},{"line_number":294,"context_line":"                vol_delete_allowed \u003d True"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        # Skip the Exception to allow deleting volume attached to"},{"line_number":297,"context_line":"        # an already-deleted VM"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_b0b6f4fa","line":294,"updated":"2015-01-20 06:26:00.000000000","message":"Winston\u0027s comments were ignored in ps7. Here\u0027s a repost:\n\nOver-indent here.","commit_id":"4cc8160319311c44b480e6783f7f6ea5bc23a60b"},{"author":{"_account_id":12861,"name":"Trung Trinh","email":"trungtt1981@gmail.com","username":"ttt"},"change_message_id":"7e670b51624fc3838a433b533fe73680a8044b43","unresolved":false,"context_lines":[{"line_number":291,"context_line":"            volume[\u0027instance_uuid\u0027] is not None and"},{"line_number":292,"context_line":"            self.novaapi.is_server_deleted(context,"},{"line_number":293,"context_line":"                                           volume[\u0027instance_uuid\u0027])):"},{"line_number":294,"context_line":"                vol_delete_allowed \u003d True"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        # Skip the Exception to allow deleting volume attached to"},{"line_number":297,"context_line":"        # an already-deleted VM"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_36c67c4b","line":294,"in_reply_to":"3a961159_b0b6f4fa","updated":"2015-01-20 08:22:38.000000000","message":"I didn\u0027t ignore! I just forgot it!\nI\u0027ll change as soon as I can.","commit_id":"4cc8160319311c44b480e6783f7f6ea5bc23a60b"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"320e6a465da52a169f269a5eee05180c0f59a637","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        if not vol_delete_allowed:"},{"line_number":299,"context_line":"            if volume[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":300,"context_line":"                # Volume is still attached, need to detach first"},{"line_number":301,"context_line":"                raise exception.VolumeAttached(volume_id\u003dvolume_id)"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if not force and volume[\u0027status\u0027] not in [\"available\", \"error\","},{"line_number":304,"context_line":"                                                      \"error_restoring\","}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_d02d4047","line":301,"updated":"2015-01-20 06:26:00.000000000","message":"Winston\u0027s comments were ignored in ps7. Here\u0027s a repost.\n\nIt\u0027s not entirely correct to raise VolumeAttached exception here if vol_delete_allowed is False only because force is False.\n\nI\u0027d suggest changing vol_delete_allowed flag to \u0027attached_instance_deleted\u0027, the code would be:\n\nattached_instance_deleted \u003d False\nif (volume[\u0027status\u0027] \u003d\u003d \u0027in-use\u0027 and\nvolume[\u0027attache_status\u0027] \u003d\u003d \u0027attached\u0027 and\nvolume[\u0027instance_uuid\u0027] is not None and\nself.novaapi.is_server_deleted(context,\nvolume[\u0027instance_uuid\u0027])):\nattached_instance_deleted \u003d True\n\nif not attached_instance_deleted:\nraise exception.VolumeAttached(volume_id\u003dvolume_id)\n\nif not force and (volume[\u0027status\u0027] not in [\"available\", \"error\",\n\"error_restoring\",\n\"error_extending\"] or\nnot attached_instance_deleted):\nmsg \u003d _(...)\nraise exception.InvalidVolume(...)","commit_id":"4cc8160319311c44b480e6783f7f6ea5bc23a60b"},{"author":{"_account_id":12861,"name":"Trung Trinh","email":"trungtt1981@gmail.com","username":"ttt"},"change_message_id":"7e670b51624fc3838a433b533fe73680a8044b43","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        if not vol_delete_allowed:"},{"line_number":299,"context_line":"            if volume[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":300,"context_line":"                # Volume is still attached, need to detach first"},{"line_number":301,"context_line":"                raise exception.VolumeAttached(volume_id\u003dvolume_id)"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"            if not force and volume[\u0027status\u0027] not in [\"available\", \"error\","},{"line_number":304,"context_line":"                                                      \"error_restoring\","}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_19a7f30c","line":301,"in_reply_to":"3a961159_d02d4047","updated":"2015-01-20 08:22:38.000000000","message":"We should not change the flag \"vol_delete_allowed\" to \"attached_instance_deleted\". This is because at here, we\u0027re in the context of deleting volume and all the checks are to determine if the volume-deleting progress is still allowed or not. If it is not allowed (as in the original Cinder code) then the progress will be terminated by the exception.InvalidVolume at line #292 (based on the original Cinder code). Therefore, if the volume-deleting progress is allowed (after the checks) then I simply skip the two exceptions (one is the exception.VolumeAttached and one is the exception.InvalidVolume).\nThat\u0027s what I did. I didn\u0027t change the conditions which trigger those two exceptions.","commit_id":"4cc8160319311c44b480e6783f7f6ea5bc23a60b"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"961c4fd8caeb2d18af5a0136a59b98e64363b14e","unresolved":false,"context_lines":[{"line_number":285,"context_line":""},{"line_number":286,"context_line":"        # Check if possible or not to allow deleting volume attached to"},{"line_number":287,"context_line":"        # an already-deleted VM"},{"line_number":288,"context_line":"        vol_delete_allowed \u003d False"},{"line_number":289,"context_line":"        if (force and volume[\u0027status\u0027] \u003d\u003d \u0027in-use\u0027 and"},{"line_number":290,"context_line":"            volume[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and"},{"line_number":291,"context_line":"            volume[\u0027instance_uuid\u0027] is not None and"}],"source_content_type":"text/x-python","patch_set":12,"id":"da86d52c_7cd1d8cc","line":288,"updated":"2015-01-31 10:35:18.000000000","message":"I agree with former comments that this name should be changed. There are lots of reasons why volume delete might be allowed, this one tracks the specific case of attach to a deleted server. I\u0027d also like a debug log message adding so that we can see when  this code-path is triggered","commit_id":"4536baf1af2165554655c23a94c6cd246b348d6c"},{"author":{"_account_id":12861,"name":"Trung Trinh","email":"trungtt1981@gmail.com","username":"ttt"},"change_message_id":"3109bc9c6f0eef30352877e646323ac073335d09","unresolved":false,"context_lines":[{"line_number":285,"context_line":""},{"line_number":286,"context_line":"        # Check if possible or not to allow deleting volume attached to"},{"line_number":287,"context_line":"        # an already-deleted VM"},{"line_number":288,"context_line":"        vol_delete_allowed \u003d False"},{"line_number":289,"context_line":"        if (force and volume[\u0027status\u0027] \u003d\u003d \u0027in-use\u0027 and"},{"line_number":290,"context_line":"            volume[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and"},{"line_number":291,"context_line":"            volume[\u0027instance_uuid\u0027] is not None and"}],"source_content_type":"text/x-python","patch_set":12,"id":"da86d52c_65312b0b","line":288,"in_reply_to":"da86d52c_7cd1d8cc","updated":"2015-02-02 04:15:36.000000000","message":"Is this ok to rename the flag \"vol_delete_allowed\" to \"is_vol_orphaned\"? All the checks here are based on volume\u0027s attributes!","commit_id":"4536baf1af2165554655c23a94c6cd246b348d6c"}],"cinder/volume/manager.py":[{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"dceadf54f00ade37032897634616b1ccfdf5df35","unresolved":false,"context_lines":[{"line_number":433,"context_line":"        # Check if possible or not to allow deleting volume attached to"},{"line_number":434,"context_line":"        # an already-deleted VM"},{"line_number":435,"context_line":"        vol_delete_allowed \u003d False"},{"line_number":436,"context_line":"        if volume_ref[\u0027status\u0027] \u003d\u003d \u0027deleting\u0027 and \\"},{"line_number":437,"context_line":"           volume_ref[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and\\"},{"line_number":438,"context_line":"           volume_ref[\u0027instance_uuid\u0027] is not None:"},{"line_number":439,"context_line":"                vol_delete_allowed \u003d True"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_3103ad77","line":436,"updated":"2015-01-02 12:08:33.000000000","message":"You can use parentheses to replace \u0027\\\u0027","commit_id":"e50fca29d1b1ab725a7d8aa76ac5a3183479856a"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"dceadf54f00ade37032897634616b1ccfdf5df35","unresolved":false,"context_lines":[{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        # Skip the Exception to allow deleting volume attached to"},{"line_number":442,"context_line":"        # an already-deleted VM"},{"line_number":443,"context_line":"        if not vol_delete_allowed:"},{"line_number":444,"context_line":"            if volume_ref[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":445,"context_line":"                # Volume is still attached, need to detach first"},{"line_number":446,"context_line":"                raise exception.VolumeAttached(volume_id\u003dvolume_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_3111edaf","line":443,"updated":"2015-01-02 12:08:33.000000000","message":"I think how you use \u0027vol_deleve_allowed\u0027 is confusing. Could remove the variable and combine them into one if-else to throw VolumeAttached?","commit_id":"e50fca29d1b1ab725a7d8aa76ac5a3183479856a"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"392527cb9ecf15afc03efcc664d43482fb829357","unresolved":false,"context_lines":[{"line_number":459,"context_line":"        if not vol_delete_allowed:"},{"line_number":460,"context_line":"            if volume_ref[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":461,"context_line":"                # Volume is still attached, need to detach first"},{"line_number":462,"context_line":"                raise exception.VolumeAttached(volume_id\u003dvolume_id)"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        if (vol_utils.extract_host(volume_ref[\u0027host\u0027]) !\u003d self.host):"},{"line_number":465,"context_line":"            raise exception.InvalidVolume("}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_2471e6a8","line":462,"updated":"2015-01-12 10:17:22.000000000","message":"How can this code ever now be reached?\n\nUntil we have reduced the number of races between attach/detach/delete, I think I\u0027d be more comfortable with a second call into nova to ensure we\u0027re definitely dealing with a deleted instance by the time we get here. We can remove it later.\n\nAnybody else feel this is reasonable? Too paranoid?","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":2759,"name":"Huang Zhiteng","email":"winston.d@gmail.com","username":"zhiteng-huang"},"change_message_id":"23d51d38549e7ea83b4f805660c3465bba22435f","unresolved":false,"context_lines":[{"line_number":459,"context_line":"        if not vol_delete_allowed:"},{"line_number":460,"context_line":"            if volume_ref[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":461,"context_line":"                # Volume is still attached, need to detach first"},{"line_number":462,"context_line":"                raise exception.VolumeAttached(volume_id\u003dvolume_id)"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        if (vol_utils.extract_host(volume_ref[\u0027host\u0027]) !\u003d self.host):"},{"line_number":465,"context_line":"            raise exception.InvalidVolume("}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_de10a6ad","line":462,"updated":"2015-01-14 00:50:23.000000000","message":"I\u0027d agree with Duncan.  If a previous delete operation failed, retrying probably won\u0027t help.  Let\u0027s focus on one thing (allow user to delete volume that is attached to deleted instance by force) at a time.","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":12861,"name":"Trung Trinh","email":"trungtt1981@gmail.com","username":"ttt"},"change_message_id":"c79db20fb65a6380a0cf3c9be16b2d67def27b50","unresolved":false,"context_lines":[{"line_number":459,"context_line":"        if not vol_delete_allowed:"},{"line_number":460,"context_line":"            if volume_ref[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":461,"context_line":"                # Volume is still attached, need to detach first"},{"line_number":462,"context_line":"                raise exception.VolumeAttached(volume_id\u003dvolume_id)"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":"        if (vol_utils.extract_host(volume_ref[\u0027host\u0027]) !\u003d self.host):"},{"line_number":465,"context_line":"            raise exception.InvalidVolume("}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_ffa207fb","line":462,"in_reply_to":"3a961159_2471e6a8","updated":"2015-01-12 10:43:19.000000000","message":"In this module \"manager.py\", the function \"delete_volume()\" is called by the function \"init_host()\" which is invoked upon start-up or re-start of Cinder services in order to perform some kind of clean-up of any volume whose current status is marked \"deleting\". At this point, the status is \"deleting\" because of some failed process of deleting in advance. \nThis modification enables to delete away such volumes. Otherwise, its status remains \"deleting\" forever.\n\nBefore your comment, I did already try invoking Nova API inside this module \"manager.py\". However, it was failed because the \"context\" parameter in this module does not support making connection to NovaClient. This is not like in the module \"api.py\" where the \"context\"  parameter does support making connection to NovaClient.","commit_id":"916daafa41f8371e3addf0f4398ab9c5fb623e5d"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"09dfa41d8fbf12bfffa75230b47b087fd3fe7752","unresolved":false,"context_lines":[{"line_number":538,"context_line":"            if volume_ref[\u0027attach_status\u0027] \u003d\u003d \"attached\":"},{"line_number":539,"context_line":"                # Volume is still attached, need to detach first"},{"line_number":540,"context_line":"                raise exception.VolumeAttached(volume_id\u003dvolume_id)"},{"line_number":541,"context_line":"        "},{"line_number":542,"context_line":"        if (vol_utils.extract_host(volume_ref[\u0027host\u0027]) !\u003d self.host):"},{"line_number":543,"context_line":"            raise exception.InvalidVolume("},{"line_number":544,"context_line":"                reason\u003d_(\"volume is not local to this node\"))"}],"source_content_type":"text/x-python","patch_set":13,"id":"7a016987_4acf5329","line":541,"updated":"2015-05-19 07:30:05.000000000","message":"PEP8: W293 blank line contains whitespace.","commit_id":"10af04618014a74b2e568fd630f5f260cf41ba15"}]}
