)]}'
{"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c7a1d43c4cf4cea64b589bf421294d2010915847","unresolved":false,"context_lines":[{"line_number":14313,"context_line":"            self.assertRaises(test.TestingException,"},{"line_number":14314,"context_line":"                              drvr._create_domain_and_network,"},{"line_number":14315,"context_line":"                              self.context, \u0027xml\u0027, instance, [], None)"},{"line_number":14316,"context_line":"            self.assertTrue(mock_cleanup.called)"},{"line_number":14317,"context_line":""},{"line_number":14318,"context_line":"        the_test()"},{"line_number":14319,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_ec21bdfd","line":14316,"updated":"2016-12-09 16:00:31.000000000","message":"nit: mock_cleanup.assert_called_once_with(...) but...","commit_id":"8aad8c719c331445340120efb53bd6ec75c8be19"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ea22f19b0755bffdbe491287a8db1e324a51b148","unresolved":false,"context_lines":[{"line_number":14313,"context_line":"            self.assertRaises(test.TestingException,"},{"line_number":14314,"context_line":"                              drvr._create_domain_and_network,"},{"line_number":14315,"context_line":"                              self.context, \u0027xml\u0027, instance, [], None)"},{"line_number":14316,"context_line":"            self.assertTrue(mock_cleanup.called)"},{"line_number":14317,"context_line":""},{"line_number":14318,"context_line":"        the_test()"},{"line_number":14319,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_8741020e","line":14316,"in_reply_to":"3a71b18c_ec21bdfd","updated":"2016-12-09 16:11:11.000000000","message":"The cleanup is exercised in the above tests and I\u0027d have to mock out the block device into stuff to make sure it was called with the right thing. The subject of this test is making sure that we end up calling the cleanup routine with the exception happening. I\u0027ll mock out the handler to separate this from the ones below.","commit_id":"8aad8c719c331445340120efb53bd6ec75c8be19"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c7a1d43c4cf4cea64b589bf421294d2010915847","unresolved":false,"context_lines":[{"line_number":14317,"context_line":""},{"line_number":14318,"context_line":"        the_test()"},{"line_number":14319,"context_line":""},{"line_number":14320,"context_line":"    def test_cleanup_failed_start_no_guest(self):"},{"line_number":14321,"context_line":"        drvr \u003d libvirt_driver.LibvirtDriver(mock.MagicMock(), False)"},{"line_number":14322,"context_line":"        with mock.patch.object(drvr, \u0027cleanup\u0027) as mock_cleanup:"},{"line_number":14323,"context_line":"            drvr._cleanup_failed_start(None, None, None, None, None)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_4c79d1fb","line":14320,"range":{"start_line":14320,"start_character":8,"end_line":14320,"end_character":42},"updated":"2016-12-09 16:00:31.000000000","message":"This is redundant with the test above.","commit_id":"8aad8c719c331445340120efb53bd6ec75c8be19"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ea22f19b0755bffdbe491287a8db1e324a51b148","unresolved":false,"context_lines":[{"line_number":14317,"context_line":""},{"line_number":14318,"context_line":"        the_test()"},{"line_number":14319,"context_line":""},{"line_number":14320,"context_line":"    def test_cleanup_failed_start_no_guest(self):"},{"line_number":14321,"context_line":"        drvr \u003d libvirt_driver.LibvirtDriver(mock.MagicMock(), False)"},{"line_number":14322,"context_line":"        with mock.patch.object(drvr, \u0027cleanup\u0027) as mock_cleanup:"},{"line_number":14323,"context_line":"            drvr._cleanup_failed_start(None, None, None, None, None)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_67ece629","line":14320,"range":{"start_line":14320,"start_character":8,"end_line":14320,"end_character":42},"in_reply_to":"3a71b18c_4c79d1fb","updated":"2016-12-09 16:11:11.000000000","message":"It is, but I did this anyway so the helper was fully covered on its own.","commit_id":"8aad8c719c331445340120efb53bd6ec75c8be19"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f4d2c357d3ce03d8f48ada6e6c42c44e789c814c","unresolved":false,"context_lines":[{"line_number":5044,"context_line":"                if guest:"},{"line_number":5045,"context_line":"                    guest.poweroff()"},{"line_number":5046,"context_line":"                self.cleanup(context, instance, network_info\u003dnetwork_info,"},{"line_number":5047,"context_line":"                             block_device_info\u003dblock_device_info)"},{"line_number":5048,"context_line":""},{"line_number":5049,"context_line":"        # Resume only if domain has been paused"},{"line_number":5050,"context_line":"        if pause:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_a8ab581d","line":5047,"updated":"2016-12-08 20:28:10.000000000","message":"This should semantically be the same as the above Timeout case, or the VIF create case for new and existing VMs. Any failure, run cleanup().","commit_id":"f152cbd644507d6a195380f1a6cbbfc0925a3008"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"83803c21f6e9a759760fcd7909d94936bef76fa5","unresolved":false,"context_lines":[{"line_number":5044,"context_line":"                if guest:"},{"line_number":5045,"context_line":"                    guest.poweroff()"},{"line_number":5046,"context_line":"                self.cleanup(context, instance, network_info\u003dnetwork_info,"},{"line_number":5047,"context_line":"                             block_device_info\u003dblock_device_info)"},{"line_number":5048,"context_line":""},{"line_number":5049,"context_line":"        # Resume only if domain has been paused"},{"line_number":5050,"context_line":"        if pause:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_5b2b49eb","line":5047,"in_reply_to":"3a71b18c_3b7854f2","updated":"2016-12-09 14:53:33.000000000","message":"Yeah, it\u0027s just not much repeated code and we\u0027ll have to pass five things to it which kinda negates the benefit I think. But, I\u0027ll change it and add tests.","commit_id":"f152cbd644507d6a195380f1a6cbbfc0925a3008"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"70a1d121c79f94a4f59339fde642ffeaeb7ce82e","unresolved":false,"context_lines":[{"line_number":5044,"context_line":"                if guest:"},{"line_number":5045,"context_line":"                    guest.poweroff()"},{"line_number":5046,"context_line":"                self.cleanup(context, instance, network_info\u003dnetwork_info,"},{"line_number":5047,"context_line":"                             block_device_info\u003dblock_device_info)"},{"line_number":5048,"context_line":""},{"line_number":5049,"context_line":"        # Resume only if domain has been paused"},{"line_number":5050,"context_line":"        if pause:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_3b7854f2","line":5047,"in_reply_to":"3a71b18c_a8ab581d","updated":"2016-12-09 12:14:14.000000000","message":"Makes sense to me. Stylistically might be good to look for a better way to re-use the poweroff and cleanup stanza. We\u0027ve already got it twice. Three times seems a bit excessive.","commit_id":"f152cbd644507d6a195380f1a6cbbfc0925a3008"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7dbfd92dea257eaa9aaf7297ae9872be72725710","unresolved":false,"context_lines":[{"line_number":4969,"context_line":"    def _cleanup_failed_start(self, context, instance, network_info,"},{"line_number":4970,"context_line":"                              block_device_info, guest):"},{"line_number":4971,"context_line":"        if guest:"},{"line_number":4972,"context_line":"            guest.poweroff()"},{"line_number":4973,"context_line":"        self.cleanup(context, instance, network_info\u003dnetwork_info,"},{"line_number":4974,"context_line":"                     block_device_info\u003dblock_device_info)"},{"line_number":4975,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_86cae89f","line":4972,"updated":"2016-12-09 15:10:10.000000000","message":"Will this fail if the guest isn\u0027t running?","commit_id":"954a76be0193ae12e8f28d16334944a7c5a8a29a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e6d80c3a7cefd5f865c8e98fd097c51b58ad4122","unresolved":false,"context_lines":[{"line_number":4969,"context_line":"    def _cleanup_failed_start(self, context, instance, network_info,"},{"line_number":4970,"context_line":"                              block_device_info, guest):"},{"line_number":4971,"context_line":"        if guest:"},{"line_number":4972,"context_line":"            guest.poweroff()"},{"line_number":4973,"context_line":"        self.cleanup(context, instance, network_info\u003dnetwork_info,"},{"line_number":4974,"context_line":"                     block_device_info\u003dblock_device_info)"},{"line_number":4975,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_a6128407","line":4972,"in_reply_to":"3a71b18c_86cae89f","updated":"2016-12-09 15:14:07.000000000","message":"I dunno, but it\u0027s the same thing we do for the other two error cases, so I\u0027d not expect to change it just because a different error is thrown, right?","commit_id":"954a76be0193ae12e8f28d16334944a7c5a8a29a"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"32efd7fde2cccd8d42bc73ae049c33751978eafa","unresolved":false,"context_lines":[{"line_number":5029,"context_line":"            # bail here"},{"line_number":5030,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":5031,"context_line":"                self._cleanup_failed_start(context, instance, network_info,"},{"line_number":5032,"context_line":"                                           block_device_info, guest)"},{"line_number":5033,"context_line":"        except eventlet.timeout.Timeout:"},{"line_number":5034,"context_line":"            # We never heard from Neutron"},{"line_number":5035,"context_line":"            LOG.warning(_LW(\u0027Timeout waiting for vif plugging callback for \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_46bc506c","line":5032,"updated":"2016-12-09 15:25:02.000000000","message":"Since we are not logging or doing anything specific for this exception, maybe it makes sense to just remove it.  The exception will then be trapped at L5042.","commit_id":"954a76be0193ae12e8f28d16334944a7c5a8a29a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7dbfd92dea257eaa9aaf7297ae9872be72725710","unresolved":false,"context_lines":[{"line_number":5041,"context_line":"                raise exception.VirtualInterfaceCreateException()"},{"line_number":5042,"context_line":"        except Exception:"},{"line_number":5043,"context_line":"            # Any other error, be sure to clean up"},{"line_number":5044,"context_line":"            LOG.error(_LE(\u0027Failed to start libvirt guest\u0027),"},{"line_number":5045,"context_line":"                      instance\u003dinstance)"},{"line_number":5046,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":5047,"context_line":"                self._cleanup_failed_start(context, instance, network_info,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_663a2c9a","line":5044,"range":{"start_line":5044,"start_character":37,"end_line":5044,"end_character":42},"updated":"2016-12-09 15:10:10.000000000","message":"nit: Might be better to say \u0027create\u0027 here, only because if power_on is False, then we don\u0027t actually launch/start the guest. I\u0027m thinking of the case where we\u0027re resizing or migrating a stopped instance, we don\u0027t actually start it up after the migration.","commit_id":"954a76be0193ae12e8f28d16334944a7c5a8a29a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e6d80c3a7cefd5f865c8e98fd097c51b58ad4122","unresolved":false,"context_lines":[{"line_number":5041,"context_line":"                raise exception.VirtualInterfaceCreateException()"},{"line_number":5042,"context_line":"        except Exception:"},{"line_number":5043,"context_line":"            # Any other error, be sure to clean up"},{"line_number":5044,"context_line":"            LOG.error(_LE(\u0027Failed to start libvirt guest\u0027),"},{"line_number":5045,"context_line":"                      instance\u003dinstance)"},{"line_number":5046,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":5047,"context_line":"                self._cleanup_failed_start(context, instance, network_info,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_66bdccd6","line":5044,"range":{"start_line":5044,"start_character":37,"end_line":5044,"end_character":42},"in_reply_to":"3a71b18c_663a2c9a","updated":"2016-12-09 15:14:07.000000000","message":"I think that admins would probably interpret these differently. In libvirt speak, creating the domain is equivalent to \"starting\" it for nova. This method is only ever called when nova actually wants to start it (i.e. from spawn). If we have to spawn it and plan to destroy it again to sync state, we\u0027re still starting it here, so I think it\u0027s correct to say that.","commit_id":"954a76be0193ae12e8f28d16334944a7c5a8a29a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cca84ad0f1e54c4055f3aa5a1682386812f42487","unresolved":false,"context_lines":[{"line_number":5041,"context_line":"                raise exception.VirtualInterfaceCreateException()"},{"line_number":5042,"context_line":"        except Exception:"},{"line_number":5043,"context_line":"            # Any other error, be sure to clean up"},{"line_number":5044,"context_line":"            LOG.error(_LE(\u0027Failed to start libvirt guest\u0027),"},{"line_number":5045,"context_line":"                      instance\u003dinstance)"},{"line_number":5046,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":5047,"context_line":"                self._cleanup_failed_start(context, instance, network_info,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_a69c445e","line":5044,"range":{"start_line":5044,"start_character":37,"end_line":5044,"end_character":42},"in_reply_to":"3a71b18c_66bdccd6","updated":"2016-12-09 15:17:10.000000000","message":"This method is called from more places than spawn, it\u0027s also called from finish_migration, hard reboot, resume, and finish_revert_migration. Maybe I\u0027m not following your point though.","commit_id":"954a76be0193ae12e8f28d16334944a7c5a8a29a"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"8d770702be1d19b4c37a4cb9be5de0a9f308ada4","unresolved":false,"context_lines":[{"line_number":4970,"context_line":"                              block_device_info, guest):"},{"line_number":4971,"context_line":"        try:"},{"line_number":4972,"context_line":"            if guest and guest.is_active():"},{"line_number":4973,"context_line":"                guest.poweroff()"},{"line_number":4974,"context_line":"        finally:"},{"line_number":4975,"context_line":"            self.cleanup(context, instance, network_info\u003dnetwork_info,"},{"line_number":4976,"context_line":"                         block_device_info\u003dblock_device_info)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_6ceccd29","line":4973,"updated":"2016-12-09 15:49:01.000000000","message":"You could save a trip to libvirt and some noise in the logs if you wrote:\n\ntry:\n  if guest:\n    guest.poweroff()\nexcept libvirt.libvirtError as ex:\n  if ex.get_error_code() !\u003d libvirt.VIR_ERR_OPERATION_INVALID\n    raise\nfinally:\n  self.cleanup(...)","commit_id":"8aad8c719c331445340120efb53bd6ec75c8be19"}]}
