)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9046,"name":"Maithem","email":"munshedm@vmware.com","username":"Maithem"},"change_message_id":"a19f11b1a990218514b1f1a7bc08e9b5420ad783","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When deleting a vm with state \"shelved\" or \"shelved-offloaded\","},{"line_number":10,"context_line":"the vm\u0027s snapshot like ‘shelved image’ should also be removed."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"DocImpact"},{"line_number":13,"context_line":"Change-Id: Ie9b0f8dec8f85351ef188f70e0fe9414e332aafe"},{"line_number":14,"context_line":"Closes-Bug: #1259462"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":21,"id":"AAAAUH%2F%2FJRY%3D","line":12,"updated":"2014-01-17 01:15:40.000000000","message":"Maybe elaborate on what in particular impacts the docs.","commit_id":"9010fcd6041224fe829e638ec658b1fd1ee57b46"}],"nova/compute/api.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b36079cd43c913999fef59832c9f0c6ea9aba5c9","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"), snapshot_id)"},{"line_number":1356,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1357,"context_line":"            except Exception as exc:"},{"line_number":1358,"context_line":"                LOG.warn(_(\"Failed to delete snapshot \""},{"line_number":1359,"context_line":"                           \"from shelved instance (%s).\"), exc)"},{"line_number":1360,"context_line":""},{"line_number":1361,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAT3%2F%2F81Q%3D","line":1358,"updated":"2013-12-26 13:02:30.000000000","message":"consider using warning instead of warn","commit_id":"e4aefcc85a574dc3a2f9affb589245d2d5cf7a1a"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"53d70185c263080c47fa2ef98c039b2afeeed444","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"), snapshot_id)"},{"line_number":1356,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1357,"context_line":"            except Exception as exc:"},{"line_number":1358,"context_line":"                LOG.warn(_(\"Failed to delete snapshot \""},{"line_number":1359,"context_line":"                           \"from shelved instance (%s).\"), exc)"},{"line_number":1360,"context_line":""},{"line_number":1361,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAT3%2F%2F8vM%3D","line":1358,"in_reply_to":"AAAAT3%2F%2F81Q%3D","updated":"2013-12-26 13:45:56.000000000","message":"@Gary, just curious what is the difference between warn and warning? Some code using warn and some using warning.","commit_id":"e4aefcc85a574dc3a2f9affb589245d2d5cf7a1a"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"f908c2c25f7a796db3ee383c2f091d564c51e894","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"), snapshot_id)"},{"line_number":1356,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1357,"context_line":"            except Exception as exc:"},{"line_number":1358,"context_line":"                LOG.warn(_(\"Failed to delete snapshot \""},{"line_number":1359,"context_line":"                           \"from shelved instance (%s).\"), exc)"},{"line_number":1360,"context_line":""},{"line_number":1361,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAT3%2F%2F6hY%3D","line":1358,"in_reply_to":"AAAAT3%2F%2F8vM%3D","updated":"2013-12-27 08:40:32.000000000","message":"@Jay Lau, If you are looking on help(logging) you can see: \n    warn \u003d warning(self, msg, *args, **kwargs)\n\nIt\u0027s only an alias. I think @garyk just wants we use warning by convention to keep the code clean.","commit_id":"e4aefcc85a574dc3a2f9affb589245d2d5cf7a1a"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"b1dc3b93b33102052c8299468799c918dfdd5b8f","unresolved":false,"context_lines":[{"line_number":1356,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1357,"context_line":"            except Exception as exc:"},{"line_number":1358,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1359,"context_line":"                              \"from shelved instance (%s).\"), exc)"},{"line_number":1360,"context_line":""},{"line_number":1361,"context_line":"        try:"},{"line_number":1362,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAT3%2F%2F0%2F8%3D","line":1359,"updated":"2013-12-30 15:55:38.000000000","message":"For this log line and the one on line 1354 you should pass instance\u003dinstance to the log method.  This adds the instance uuid to the log line.","commit_id":"eaa18bbcc5316814a85e6f8904f76ec9f93a6312"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"7eb8b45ee127de17031fb516855ac24060b6269e","unresolved":false,"context_lines":[{"line_number":1356,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1357,"context_line":"            except Exception as exc:"},{"line_number":1358,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1359,"context_line":"                              \"from shelved instance (%s).\"), exc)"},{"line_number":1360,"context_line":""},{"line_number":1361,"context_line":"        try:"},{"line_number":1362,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAT3%2F%2F080%3D","line":1359,"in_reply_to":"AAAAT3%2F%2F0%2F8%3D","updated":"2013-12-30 16:22:10.000000000","message":"Done","commit_id":"eaa18bbcc5316814a85e6f8904f76ec9f93a6312"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"857b6ca44643c79273cbc55272117c5da63102ce","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"},{"line_number":1357,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1358,"context_line":"            except exception.NovaException as exc:"},{"line_number":1359,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1360,"context_line":"                              \"from shelved instance (%s).\"),"},{"line_number":1361,"context_line":"                            exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAT3%2F%2FzCI%3D","line":1358,"updated":"2013-12-31 10:39:33.000000000","message":"I have used NovaException instead of Exception, it\u0027s looks more stronger like that.","commit_id":"dfeac83332c31945ec7c6df97adf5d125773da2a"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"0340fe948b3d74554e825990bb2c973192675c4d","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"},{"line_number":1357,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1358,"context_line":"            except exception.NovaException as exc:"},{"line_number":1359,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1360,"context_line":"                              \"from shelved instance (%s).\"),"},{"line_number":1361,"context_line":"                            exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAT3%2F%2FyX0%3D","line":1358,"in_reply_to":"AAAAT3%2F%2FzCI%3D","updated":"2013-12-31 16:19:36.000000000","message":"Exception would actually be better here.  No failure here should prevent the rest of the delete from occurring.","commit_id":"dfeac83332c31945ec7c6df97adf5d125773da2a"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"fb14a017711838c428c92b590adc6140e3e49ce0","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"},{"line_number":1357,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1358,"context_line":"            except Exception as exc:"},{"line_number":1359,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1360,"context_line":"                              \"from shelved instance (%s).\"),"},{"line_number":1361,"context_line":"                            exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fh7c%3D","line":1358,"updated":"2014-01-12 13:10:32.000000000","message":"Can you please catch the exact exceptions here?","commit_id":"f89011fd34dbb5548c3ea77ab1bdfab3cd6a3dcd"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3728b93d1c5f606105176a99961c706697c05fb8","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"},{"line_number":1357,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1358,"context_line":"            except Exception as exc:"},{"line_number":1359,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1360,"context_line":"                              \"from shelved instance (%s).\"),"},{"line_number":1361,"context_line":"                            exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fh4U%3D","line":1358,"in_reply_to":"AAAAUH%2F%2Fh58%3D","updated":"2014-01-12 13:54:58.000000000","message":"I like your solution, I\u0027m working on a new patchset. Then we will wait for Andrew.","commit_id":"f89011fd34dbb5548c3ea77ab1bdfab3cd6a3dcd"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"c79de6c714f90192f47ef7fea38675004b404d3f","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"},{"line_number":1357,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1358,"context_line":"            except Exception as exc:"},{"line_number":1359,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1360,"context_line":"                              \"from shelved instance (%s).\"),"},{"line_number":1361,"context_line":"                            exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fh58%3D","line":1358,"in_reply_to":"AAAAUH%2F%2Fh6Y%3D","updated":"2014-01-12 13:32:25.000000000","message":"Hmm, seems different people have different understanding for this part.\n\nPlease take a look at review comments for https://review.openstack.org/#/c/57229/3/nova/api/openstack/compute/contrib/attach_interfaces.py\n\nWhat about do it as https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/contrib/admin_actions.py#L150\n\nFirst try to catch exact exceptions then catch general exception to make sure all cases are handled?","commit_id":"f89011fd34dbb5548c3ea77ab1bdfab3cd6a3dcd"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"5c6bf85e4a0dc1bb253034e38a3ed6f808e3492b","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"},{"line_number":1357,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1358,"context_line":"            except Exception as exc:"},{"line_number":1359,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1360,"context_line":"                              \"from shelved instance (%s).\"),"},{"line_number":1361,"context_line":"                            exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fh6Y%3D","line":1358,"in_reply_to":"AAAAUH%2F%2Fh7c%3D","updated":"2014-01-12 13:18:33.000000000","message":"As Andrew said, it should be better to ensure there is no way to stop the process.\n\nhttps://review.openstack.org/#/c/61462/12/nova/compute/api.py","commit_id":"f89011fd34dbb5548c3ea77ab1bdfab3cd6a3dcd"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"59650f143bf82615242832927b33cf26ba15af92","unresolved":false,"context_lines":[{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"},{"line_number":1357,"context_line":"                self.image_service.delete(context, snapshot_id)"},{"line_number":1358,"context_line":"            except exception.NovaException as exc:"},{"line_number":1359,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1360,"context_line":"                              \"from shelved instance (%s).\"),"},{"line_number":1361,"context_line":"                            exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2Fh1Q%3D","line":1358,"updated":"2014-01-12 14:31:33.000000000","message":"Can you please catch the exact exceptions?\n\nhttps://github.com/openstack/nova/blob/master/nova/image/glance.py#L411\nhttps://github.com/openstack/nova/blob/master/nova/image/glance.py#L413","commit_id":"57e47b08040719c1110378cbf9e4d92db542bf38"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"54076d6af2f8bb41e851051a846c2f523978ebfb","unresolved":false,"context_lines":[{"line_number":1359,"context_line":"                    exception.ImageNotAuthorized) as exc:"},{"line_number":1360,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1361,"context_line":"                              \"from shelved instance (%s).\"),"},{"line_number":1362,"context_line":"                            exc, instance\u003dinstance)"},{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance (%s).\"),"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2Fen8%3D","line":1362,"updated":"2014-01-13 13:59:07.000000000","message":"we should use exc.format_message() ?","commit_id":"b6555d0708e0a9b5e6008bce1dc4a45e5705e964"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"e3f75636b8a9f19ebfe200bcbe4cb4f9151bf7e9","unresolved":false,"context_lines":[{"line_number":1359,"context_line":"                    exception.ImageNotAuthorized) as exc:"},{"line_number":1360,"context_line":"                LOG.warning(_(\"Failed to delete snapshot \""},{"line_number":1361,"context_line":"                              \"from shelved instance (%s).\"),"},{"line_number":1362,"context_line":"                            exc, instance\u003dinstance)"},{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance (%s).\"),"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FedU%3D","line":1362,"in_reply_to":"AAAAUH%2F%2Fen8%3D","updated":"2014-01-13 14:24:37.000000000","message":"Sounds better yes.","commit_id":"b6555d0708e0a9b5e6008bce1dc4a45e5705e964"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"54076d6af2f8bb41e851051a846c2f523978ebfb","unresolved":false,"context_lines":[{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance (%s).\"),"},{"line_number":1366,"context_line":"                              exc, instance\u003dinstance)"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"        try:"},{"line_number":1369,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2Feno%3D","line":1366,"updated":"2014-01-13 13:59:07.000000000","message":"LOG.exception will output the detail of exception, looks like we needn\u0027t print exc by ourself","commit_id":"b6555d0708e0a9b5e6008bce1dc4a45e5705e964"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"ef09d57418ad32a44ce494eb40674639fd18fef5","unresolved":false,"context_lines":[{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance (%s).\"),"},{"line_number":1366,"context_line":"                              exc, instance\u003dinstance)"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"        try:"},{"line_number":1369,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FeIY%3D","line":1366,"in_reply_to":"AAAAUH%2F%2FeS4%3D","updated":"2014-01-13 15:11:21.000000000","message":"Thanks for all of this information. I\u0027m working on a new patchset.","commit_id":"b6555d0708e0a9b5e6008bce1dc4a45e5705e964"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"36940c2d642fdb97d93e21dc830fcad78c73fe53","unresolved":false,"context_lines":[{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance (%s).\"),"},{"line_number":1366,"context_line":"                              exc, instance\u003dinstance)"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"        try:"},{"line_number":1369,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FeS4%3D","line":1366,"in_reply_to":"AAAAUH%2F%2FeVE%3D","updated":"2014-01-13 14:48:03.000000000","message":"I mean if I write the code like:\n        try:\n            raise Exception(\u0027abcd\u0027) \n        except:\n            LOG.exception(\u0027test\u0027)\n\nThe output will be:\n2014-01-13 22:44:16.491 15844 ERROR nova.compute.manager [-] test\n\n2014-01-13 22:44:16.491 15844 TRACE nova.compute.manager Traceback (most recent call last):\n\n2014-01-13 22:44:16.491 15844 TRACE nova.compute.manager   File \"/opt/stack/nova/nova/compute/manager.py\", line 452, in __init__\n\n2014-01-13 22:44:16.491 15844 TRACE nova.compute.manager     raise Exception(\u0027abcd\u0027)\n\n2014-01-13 22:44:16.491 15844 TRACE nova.compute.manager Exception: abcd\n\n2014-01-13 22:44:16.491 15844 TRACE nova.compute.manager\n\nThe output already include the trace of exception. So that means we needn\u0027t pass the instance of exception into the LOG.exception.\n\nHow about we just write like:\n LOG.exception(_(\"Something wrong happened when trying to delete snapshot from shelved instance\"))","commit_id":"b6555d0708e0a9b5e6008bce1dc4a45e5705e964"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"a30cee593a4a84cd0a830375599fa0a33be0a2c9","unresolved":false,"context_lines":[{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance (%s).\"),"},{"line_number":1366,"context_line":"                              exc, instance\u003dinstance)"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"        try:"},{"line_number":1369,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FeVE%3D","line":1366,"in_reply_to":"AAAAUH%2F%2FeZA%3D","updated":"2014-01-13 14:39:04.000000000","message":"Sorry, \nLOG.exception will output a string because we pass a string not an instance of Exception.\nI have used LOG.exception because the most of the part of the code uses LOG.exception.\n\nWhat do you think I have to use? LOG.error?","commit_id":"b6555d0708e0a9b5e6008bce1dc4a45e5705e964"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"28935518cb5cb0819d23e6841a41eea31bd99b70","unresolved":false,"context_lines":[{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance (%s).\"),"},{"line_number":1366,"context_line":"                              exc, instance\u003dinstance)"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"        try:"},{"line_number":1369,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2FeZA%3D","line":1366,"in_reply_to":"AAAAUH%2F%2Febk%3D","updated":"2014-01-13 14:31:00.000000000","message":"Sorry, I didn\u0027t get what you mean","commit_id":"b6555d0708e0a9b5e6008bce1dc4a45e5705e964"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"e3f75636b8a9f19ebfe200bcbe4cb4f9151bf7e9","unresolved":false,"context_lines":[{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance (%s).\"),"},{"line_number":1366,"context_line":"                              exc, instance\u003dinstance)"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"        try:"},{"line_number":1369,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2Febk%3D","line":1366,"in_reply_to":"AAAAUH%2F%2Feno%3D","updated":"2014-01-13 14:24:37.000000000","message":"Actually I pass a string so the output will be what we are expect. I have used \"exception\" in reference to the rest of the code. What do you suggest?","commit_id":"b6555d0708e0a9b5e6008bce1dc4a45e5705e964"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"be3a02131379ead077cda648096a47f86700685c","unresolved":false,"context_lines":[{"line_number":1362,"context_line":"                            exc.format_message(), instance\u003dinstance)"},{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance.\"))"},{"line_number":1366,"context_line":""},{"line_number":1367,"context_line":"        try:"},{"line_number":1368,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2FeBc%3D","line":1365,"updated":"2014-01-13 15:31:17.000000000","message":"You should add \"instance\u003dinstance\" here like you have for the warning log line above.","commit_id":"c6fa2d1412c851fe82054f5f92b4a9d534e32b53"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"cfb2049ebfc42f020a67dd7dea0ba272ffa2db0c","unresolved":false,"context_lines":[{"line_number":1362,"context_line":"                            exc.format_message(), instance\u003dinstance)"},{"line_number":1363,"context_line":"            except Exception as exc:"},{"line_number":1364,"context_line":"                LOG.exception(_(\"Something wrong happened when trying to \""},{"line_number":1365,"context_line":"                                \"delete snapshot from shelved instance.\"))"},{"line_number":1366,"context_line":""},{"line_number":1367,"context_line":"        try:"},{"line_number":1368,"context_line":"            # NOTE(maoy): no expected_task_state needs to be set"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2Fd%2Bg%3D","line":1365,"in_reply_to":"AAAAUH%2F%2FeBc%3D","updated":"2014-01-13 15:35:47.000000000","message":"Sure.","commit_id":"c6fa2d1412c851fe82054f5f92b4a9d534e32b53"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a229f73380f488fc797321231e79c828326553dc","unresolved":false,"context_lines":[{"line_number":1350,"context_line":"        if instance[\u0027vm_state\u0027] in (vm_states.SHELVED,"},{"line_number":1351,"context_line":"                                    vm_states.SHELVED_OFFLOADED):"},{"line_number":1352,"context_line":"            try:"},{"line_number":1353,"context_line":"                snapshot_id \u003d instance.system_metadata.get(\u0027shelved_image_id\u0027)"},{"line_number":1354,"context_line":"                LOG.info(_(\"Working on deleting snapshot %s \""},{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUH%2F%2B8Z8%3D","line":1353,"updated":"2014-01-20 15:01:17.000000000","message":"this line does not need to be part of the try statement\nthe LOG too","commit_id":"e055fcc38ad8b3841b5b6cdec9362a1867486bf9"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"3d51e1b65aab57d1c694b3e470d9222eccc292f3","unresolved":false,"context_lines":[{"line_number":1350,"context_line":"        if instance[\u0027vm_state\u0027] in (vm_states.SHELVED,"},{"line_number":1351,"context_line":"                                    vm_states.SHELVED_OFFLOADED):"},{"line_number":1352,"context_line":"            try:"},{"line_number":1353,"context_line":"                snapshot_id \u003d instance.system_metadata.get(\u0027shelved_image_id\u0027)"},{"line_number":1354,"context_line":"                LOG.info(_(\"Working on deleting snapshot %s \""},{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUH%2F%2B76M%3D","line":1353,"in_reply_to":"AAAAUH%2F%2B8V0%3D","updated":"2014-01-20 16:11:08.000000000","message":"Well, the .get(...) will never fail, and the log statement generally won\u0027t unless there\u0027s a formatting issue, so no, they don\u0027t really need to be part of it","commit_id":"e055fcc38ad8b3841b5b6cdec9362a1867486bf9"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"596aeb89ec3877d155821bf692931261d3db4534","unresolved":false,"context_lines":[{"line_number":1350,"context_line":"        if instance[\u0027vm_state\u0027] in (vm_states.SHELVED,"},{"line_number":1351,"context_line":"                                    vm_states.SHELVED_OFFLOADED):"},{"line_number":1352,"context_line":"            try:"},{"line_number":1353,"context_line":"                snapshot_id \u003d instance.system_metadata.get(\u0027shelved_image_id\u0027)"},{"line_number":1354,"context_line":"                LOG.info(_(\"Working on deleting snapshot %s \""},{"line_number":1355,"context_line":"                           \"from shelved instance...\"),"},{"line_number":1356,"context_line":"                         snapshot_id, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAUH%2F%2B8V0%3D","line":1353,"in_reply_to":"AAAAUH%2F%2B8Z8%3D","updated":"2014-01-20 15:09:35.000000000","message":"Are you sure? At this step we really want that nothing can trouble the deleting.","commit_id":"e055fcc38ad8b3841b5b6cdec9362a1867486bf9"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"fe23081bf8090d5ecd93580a3ff22d59ac766970","unresolved":false,"context_lines":[{"line_number":1349,"context_line":"        # At these states an instance has a snapshot associate."},{"line_number":1350,"context_line":"        if instance[\u0027vm_state\u0027] in (vm_states.SHELVED,"},{"line_number":1351,"context_line":"                                    vm_states.SHELVED_OFFLOADED):"},{"line_number":1352,"context_line":"            snapshot_id \u003d instance.system_metadata.get(\u0027shelved_image_id\u0027)"},{"line_number":1353,"context_line":"            LOG.info(_(\"Working on deleting snapshot %s \""},{"line_number":1354,"context_line":"                       \"from shelved instance...\"),"},{"line_number":1355,"context_line":"                     snapshot_id, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAUH%2F%2BEKA%3D","line":1352,"updated":"2014-01-30 14:44:14.000000000","message":"Thanks for pulling these out of the try/except.","commit_id":"48729259c570d73d7c35228718ecc4e9bb258e36"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"61159ee01f9bf9d25c87e423fdab60336c3e42b2","unresolved":false,"context_lines":[{"line_number":1349,"context_line":"        # At these states an instance has a snapshot associate."},{"line_number":1350,"context_line":"        if instance[\u0027vm_state\u0027] in (vm_states.SHELVED,"},{"line_number":1351,"context_line":"                                    vm_states.SHELVED_OFFLOADED):"},{"line_number":1352,"context_line":"            snapshot_id \u003d instance.system_metadata.get(\u0027shelved_image_id\u0027)"},{"line_number":1353,"context_line":"            LOG.info(_(\"Working on deleting snapshot %s \""},{"line_number":1354,"context_line":"                       \"from shelved instance...\"),"},{"line_number":1355,"context_line":"                     snapshot_id, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAUH%2F%2BEBo%3D","line":1352,"in_reply_to":"AAAAUH%2F%2BEKA%3D","updated":"2014-01-30 15:06:15.000000000","message":"np, it\u0027s normal. The verify failed because of a merge conflict So I used it to update the code :)","commit_id":"48729259c570d73d7c35228718ecc4e9bb258e36"}],"nova/tests/compute/test_compute_api.py":[{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"e95e0b8c06d6c6e5942f8a797c09193e85168eca","unresolved":false,"context_lines":[{"line_number":584,"context_line":"        fake_sys_meta \u003d dict(shelved_image_id\u003d\u0027fake-shelved\u0027)"},{"line_number":585,"context_line":"        self._test_delete(\u0027delete\u0027,"},{"line_number":586,"context_line":"                          vm_state\u003dvm_states.SHELVED,"},{"line_number":587,"context_line":"                          system_metadata\u003dfake_sys_meta)"},{"line_number":588,"context_line":""},{"line_number":589,"context_line":"    def test_delete_with_down_host(self):"},{"line_number":590,"context_line":"        self._test_delete(\u0027delete\u0027, host\u003d\u0027down-host\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAT3%2F%2F9eA%3D","line":587,"updated":"2013-12-26 09:20:37.000000000","message":"I hope that we can add a use case for SHELVED_OFFLOADED status to make sure all your code change can be covered.","commit_id":"e4aefcc85a574dc3a2f9affb589245d2d5cf7a1a"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"f908c2c25f7a796db3ee383c2f091d564c51e894","unresolved":false,"context_lines":[{"line_number":584,"context_line":"        fake_sys_meta \u003d dict(shelved_image_id\u003d\u0027fake-shelved\u0027)"},{"line_number":585,"context_line":"        self._test_delete(\u0027delete\u0027,"},{"line_number":586,"context_line":"                          vm_state\u003dvm_states.SHELVED,"},{"line_number":587,"context_line":"                          system_metadata\u003dfake_sys_meta)"},{"line_number":588,"context_line":""},{"line_number":589,"context_line":"    def test_delete_with_down_host(self):"},{"line_number":590,"context_line":"        self._test_delete(\u0027delete\u0027, host\u003d\u0027down-host\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAT3%2F%2F6gw%3D","line":587,"in_reply_to":"AAAAT3%2F%2F9eA%3D","updated":"2013-12-27 08:40:32.000000000","message":"Sure, i\u0027m working on that.","commit_id":"e4aefcc85a574dc3a2f9affb589245d2d5cf7a1a"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"a12074e1f89dc9af4ead3de50881135b3d76a323","unresolved":false,"context_lines":[{"line_number":582,"context_line":"        self._test_delete(\u0027delete\u0027, vm_state\u003dvm_states.RESIZED)"},{"line_number":583,"context_line":""},{"line_number":584,"context_line":"    def test_delete_shelved(self):"},{"line_number":585,"context_line":"        fake_sys_meta \u003d dict(shelved_image_id\u003d\u0027fake-shelved\u0027)"},{"line_number":586,"context_line":"        self._test_delete(\u0027delete\u0027,"},{"line_number":587,"context_line":"                          vm_state\u003dvm_states.SHELVED,"},{"line_number":588,"context_line":"                          system_metadata\u003dfake_sys_meta)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAT3%2F%2F1v0%3D","line":585,"updated":"2013-12-30 11:56:18.000000000","message":"please use {} instead of dict() http://doughellmann.com/2012/11/the-performance-impact-of-using-dict-instead-of-in-cpython-2-7.html","commit_id":"0df9469bb0bbeb1488994201c7d41b90e6c66d8c"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3cad88d9522477ed3e4ceca9983188bad6dfa67b","unresolved":false,"context_lines":[{"line_number":582,"context_line":"        self._test_delete(\u0027delete\u0027, vm_state\u003dvm_states.RESIZED)"},{"line_number":583,"context_line":""},{"line_number":584,"context_line":"    def test_delete_shelved(self):"},{"line_number":585,"context_line":"        fake_sys_meta \u003d dict(shelved_image_id\u003d\u0027fake-shelved\u0027)"},{"line_number":586,"context_line":"        self._test_delete(\u0027delete\u0027,"},{"line_number":587,"context_line":"                          vm_state\u003dvm_states.SHELVED,"},{"line_number":588,"context_line":"                          system_metadata\u003dfake_sys_meta)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAT3%2F%2F1qE%3D","line":585,"in_reply_to":"AAAAT3%2F%2F1v0%3D","updated":"2013-12-30 12:27:27.000000000","message":"Done, Thanks for the article.","commit_id":"0df9469bb0bbeb1488994201c7d41b90e6c66d8c"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"a12074e1f89dc9af4ead3de50881135b3d76a323","unresolved":false,"context_lines":[{"line_number":588,"context_line":"                          system_metadata\u003dfake_sys_meta)"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"    def test_delete_shelved_offloaded(self):"},{"line_number":591,"context_line":"        fake_sys_meta \u003d dict(shelved_image_id\u003d\u0027fake-shelved\u0027)"},{"line_number":592,"context_line":"        self._test_delete(\u0027delete\u0027,"},{"line_number":593,"context_line":"                          vm_state\u003dvm_states.SHELVED_OFFLOADED,"},{"line_number":594,"context_line":"                          system_metadata\u003dfake_sys_meta)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAT3%2F%2F1vs%3D","line":591,"updated":"2013-12-30 11:56:18.000000000","message":"ditto","commit_id":"0df9469bb0bbeb1488994201c7d41b90e6c66d8c"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"3cad88d9522477ed3e4ceca9983188bad6dfa67b","unresolved":false,"context_lines":[{"line_number":588,"context_line":"                          system_metadata\u003dfake_sys_meta)"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"    def test_delete_shelved_offloaded(self):"},{"line_number":591,"context_line":"        fake_sys_meta \u003d dict(shelved_image_id\u003d\u0027fake-shelved\u0027)"},{"line_number":592,"context_line":"        self._test_delete(\u0027delete\u0027,"},{"line_number":593,"context_line":"                          vm_state\u003dvm_states.SHELVED_OFFLOADED,"},{"line_number":594,"context_line":"                          system_metadata\u003dfake_sys_meta)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAT3%2F%2F1qA%3D","line":591,"in_reply_to":"AAAAT3%2F%2F1vs%3D","updated":"2013-12-30 12:27:27.000000000","message":"Done","commit_id":"0df9469bb0bbeb1488994201c7d41b90e6c66d8c"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"857b6ca44643c79273cbc55272117c5da63102ce","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        image_service \u003d self.compute_api.image_service"},{"line_number":424,"context_line":"        self.mox.StubOutWithMock(image_service, \u0027delete\u0027)"},{"line_number":425,"context_line":"        snapshot_id \u003d inst.system_metadata.get(\u0027shelved_image_id\u0027)"},{"line_number":426,"context_line":"        if snapshot_id is not None:"},{"line_number":427,"context_line":"            # Image found."},{"line_number":428,"context_line":"            image_service.delete(self.context, snapshot_id).AndReturn(True)"},{"line_number":429,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAT3%2F%2FzBw%3D","line":426,"updated":"2013-12-31 10:39:33.000000000","message":"I don\u0027t know if it good to use a condition in a test, so i\u0027m waiting your  returns.","commit_id":"dfeac83332c31945ec7c6df97adf5d125773da2a"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"0340fe948b3d74554e825990bb2c973192675c4d","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        image_service \u003d self.compute_api.image_service"},{"line_number":424,"context_line":"        self.mox.StubOutWithMock(image_service, \u0027delete\u0027)"},{"line_number":425,"context_line":"        snapshot_id \u003d inst.system_metadata.get(\u0027shelved_image_id\u0027)"},{"line_number":426,"context_line":"        if snapshot_id is not None:"},{"line_number":427,"context_line":"            # Image found."},{"line_number":428,"context_line":"            image_service.delete(self.context, snapshot_id).AndReturn(True)"},{"line_number":429,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAT3%2F%2FyX4%3D","line":426,"in_reply_to":"AAAAT3%2F%2FzBw%3D","updated":"2013-12-31 16:19:36.000000000","message":"Using a condition in a test is fine.\n\nI would modify this a little bit though.  Don\u0027t have snapshot_id be None in the test, but set it to something like \u0027fake-dne\u0027 and raise an exception for that case.  shelved_image_id not existing is a different, and less likely, error condition which would probably result in a different exception.","commit_id":"dfeac83332c31945ec7c6df97adf5d125773da2a"}]}
