)]}'
{"heat/engine/resources/instance.py":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"ac1764830d86d3214d11413e9f77a3a630e75fd5","unresolved":false,"context_lines":[{"line_number":592,"context_line":"            try:"},{"line_number":593,"context_line":"                nova_utils.refresh_server(server)"},{"line_number":594,"context_line":"                if server.status \u003d\u003d \"DELETED\":"},{"line_number":595,"context_line":"                    self.resource_id_set(None)"},{"line_number":596,"context_line":"                    break"},{"line_number":597,"context_line":"            except clients.novaclient.exceptions.NotFound:"},{"line_number":598,"context_line":"                self.resource_id_set(None)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXX%2F%2Fufs%3D","line":595,"updated":"2014-04-28 13:09:10.000000000","message":"you could move self.resource_id_set(None) outside while loop now","commit_id":"18ac4582a3285ed881110b9930e0e3676ff99d49"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"84e55ae3a051d50a6a80e7b0040e694f2ad73ec8","unresolved":false,"context_lines":[{"line_number":592,"context_line":"            try:"},{"line_number":593,"context_line":"                nova_utils.refresh_server(server)"},{"line_number":594,"context_line":"                if server.status \u003d\u003d \"DELETED\":"},{"line_number":595,"context_line":"                    self.resource_id_set(None)"},{"line_number":596,"context_line":"                    break"},{"line_number":597,"context_line":"            except clients.novaclient.exceptions.NotFound:"},{"line_number":598,"context_line":"                self.resource_id_set(None)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXX%2F%2Ftww%3D","line":595,"in_reply_to":"AAAAXX%2F%2Ft8U%3D","updated":"2014-04-29 00:58:32.000000000","message":"ok..Done","commit_id":"18ac4582a3285ed881110b9930e0e3676ff99d49"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"363205b5ec5fc639fb1813a7c98e07b7d7f804f3","unresolved":false,"context_lines":[{"line_number":592,"context_line":"            try:"},{"line_number":593,"context_line":"                nova_utils.refresh_server(server)"},{"line_number":594,"context_line":"                if server.status \u003d\u003d \"DELETED\":"},{"line_number":595,"context_line":"                    self.resource_id_set(None)"},{"line_number":596,"context_line":"                    break"},{"line_number":597,"context_line":"            except clients.novaclient.exceptions.NotFound:"},{"line_number":598,"context_line":"                self.resource_id_set(None)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXX%2F%2Ft8U%3D","line":595,"in_reply_to":"AAAAXX%2F%2FuEY%3D","updated":"2014-04-28 13:46:46.000000000","message":"it is a small deduplication suggestion (remove two lines and put one line after the while loop), as currently the only way to break out of \"while True\" loop is those two cases (\"DELETED\" or not found), so there will be no \"otherwise\".","commit_id":"18ac4582a3285ed881110b9930e0e3676ff99d49"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"af9b5dc8afb416a3f895d8c17e7b41e0310097bc","unresolved":false,"context_lines":[{"line_number":592,"context_line":"            try:"},{"line_number":593,"context_line":"                nova_utils.refresh_server(server)"},{"line_number":594,"context_line":"                if server.status \u003d\u003d \"DELETED\":"},{"line_number":595,"context_line":"                    self.resource_id_set(None)"},{"line_number":596,"context_line":"                    break"},{"line_number":597,"context_line":"            except clients.novaclient.exceptions.NotFound:"},{"line_number":598,"context_line":"                self.resource_id_set(None)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAXX%2F%2FuEY%3D","line":595,"in_reply_to":"AAAAXX%2F%2Fufs%3D","updated":"2014-04-28 13:38:39.000000000","message":"I don\u0027t think that is required. It\u0027s already there in the exception block. Either status DELETED or the instance not found the resource_id would be set to None. We don\u0027t  want to set the resource_id to None otherwise.","commit_id":"18ac4582a3285ed881110b9930e0e3676ff99d49"}],"heat/tests/test_instance.py":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"aada0ec85df54bab2f1cc997c2596d99db42707b","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        self.m.StubOutWithMock(self.fc.client, \u0027get_servers_1234\u0027)"},{"line_number":302,"context_line":"        get \u003d self.fc.client.get_servers_1234"},{"line_number":303,"context_line":"        get().AndRaise(instances.clients.novaclient.exceptions.NotFound(404))"},{"line_number":304,"context_line":""},{"line_number":305,"context_line":"        mox.Replay(get)"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        scheduler.TaskRunner(instance.delete)()"}],"source_content_type":"text/x-python","patch_set":2,"id":"bad4c104_aa3a3034","line":304,"updated":"2014-04-29 10:10:12.000000000","message":"I don\u0027t think that you actually test the changes in the code here. You\u0027d have to make another faked get call that returns instance in ERROR state before this mocked call to test that ERROR state does not trigger the error any more.","commit_id":"a858c2908b0bf9553c0c6351037ad65b051cc322"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"3521fdc9ff6379d78069c68ed6a2cae6422d0d96","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        self.m.StubOutWithMock(self.fc.client, \u0027get_servers_1234\u0027)"},{"line_number":302,"context_line":"        get \u003d self.fc.client.get_servers_1234"},{"line_number":303,"context_line":"        get().AndRaise(instances.clients.novaclient.exceptions.NotFound(404))"},{"line_number":304,"context_line":""},{"line_number":305,"context_line":"        mox.Replay(get)"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        scheduler.TaskRunner(instance.delete)()"}],"source_content_type":"text/x-python","patch_set":2,"id":"bad4c104_ca5db44a","line":304,"in_reply_to":"bad4c104_aa3a3034","updated":"2014-04-29 10:33:17.000000000","message":"this get() line is the mock to nova_utils.refresh_server(). so in this test it refreshes the server, throws a NotFound exception and breaks out, and the code checking for server.status is actually never reached even when you\u0027ve set the instance.status to ERROR couple of lines above. Thus you should prepend this line with something like\n\nget().AndReturn(instance)\n\nso that the while loop runs for two cycles (get server-\u003e status \"Error\" but it\u0027s ok -\u003e get server -\u003e NotFound -\u003e breakout). the same pattern would be valid for ACTIVE status as well","commit_id":"a858c2908b0bf9553c0c6351037ad65b051cc322"}]}
