)]}'
{"nova/tests/unit/virt/libvirt/test_guest.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ad59a8a2a532f7772680aab11c5226908bf1eaf4","unresolved":false,"context_lines":[{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    def test_detach_device_with_retry_device_missing(self):"},{"line_number":338,"context_line":"        self._test_detach_device_with_retry_failure()"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def _test_detach_device_with_retry_no_inactive("},{"line_number":341,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":342,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_6e73f0b5","line":339,"updated":"2020-07-17 15:23:07.000000000","message":"These 3 tests make sense bc they\u0027re testing the retry (second try) of the detach, which will happen if the live detach initially failed with one of:\n\nlibvirt.VIR_ERR_OPERATION_FAILED,\nlibvirt.VIR_ERR_INTERNAL_ERROR,\nlibvirt.VIR_ERR_DEVICE_MISSING\n\nThe inactive detach \"always works\" in that it\u0027s either successfully detached or it raises DeviceNotFound.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"f2624848aa6e485c1d62a35406ffb46c6a7832d0","unresolved":false,"context_lines":[{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    def test_detach_device_with_retry_device_missing(self):"},{"line_number":338,"context_line":"        self._test_detach_device_with_retry_failure()"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def _test_detach_device_with_retry_no_inactive("},{"line_number":341,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":342,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_aeafc87b","line":339,"in_reply_to":"bf51134e_6e73f0b5","updated":"2020-07-17 15:40:26.000000000","message":"\u003e The inactive detach \"always works\" in that it\u0027s either successfully\n \u003e detached or it raises DeviceNotFound.\n\nNote that is only raises DeviceNotFound if we catch VIR_ERR_DEVICE_MISSING from v4.1.0.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ad59a8a2a532f7772680aab11c5226908bf1eaf4","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        self._test_detach_device_with_retry_failure()"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def _test_detach_device_with_retry_no_inactive("},{"line_number":341,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":342,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"},{"line_number":343,"context_line":"        # This simulates a persistent domain detach failing because"},{"line_number":344,"context_line":"        # the device is not found in the inactive config"},{"line_number":345,"context_line":"        conf \u003d mock.Mock(spec\u003dvconfig.LibvirtConfigGuestDevice)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_ee94208f","line":342,"range":{"start_line":341,"start_character":14,"end_line":342,"end_character":62},"updated":"2020-07-17 15:23:07.000000000","message":"These args are never used in this function...","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"f2624848aa6e485c1d62a35406ffb46c6a7832d0","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        self._test_detach_device_with_retry_failure()"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def _test_detach_device_with_retry_no_inactive("},{"line_number":341,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":342,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"},{"line_number":343,"context_line":"        # This simulates a persistent domain detach failing because"},{"line_number":344,"context_line":"        # the device is not found in the inactive config"},{"line_number":345,"context_line":"        conf \u003d mock.Mock(spec\u003dvconfig.LibvirtConfigGuestDevice)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_0eeb54dc","line":342,"range":{"start_line":341,"start_character":14,"end_line":342,"end_character":62},"in_reply_to":"bf51134e_ee94208f","updated":"2020-07-17 15:40:26.000000000","message":"Gah thanks!","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ad59a8a2a532f7772680aab11c5226908bf1eaf4","unresolved":false,"context_lines":[{"line_number":354,"context_line":"        fake_exc \u003d fakelibvirt.make_libvirtError("},{"line_number":355,"context_line":"            fakelibvirt.libvirtError, \"\","},{"line_number":356,"context_line":"            error_message\u003d\"invalid argument: no target device vdb\","},{"line_number":357,"context_line":"            error_code\u003dfakelibvirt.VIR_ERR_INVALID_ARG,"},{"line_number":358,"context_line":"            error_domain\u003dfakelibvirt.VIR_FROM_DOMAIN)"},{"line_number":359,"context_line":"        # Detach from persistent raises not found, detach from live succeeds"},{"line_number":360,"context_line":"        self.domain.detachDeviceFlags.side_effect \u003d [fake_exc, None]"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_6e9810cc","line":357,"range":{"start_line":357,"start_character":35,"end_line":357,"end_character":54},"updated":"2020-07-17 15:23:07.000000000","message":"This is the signal for \"no inactive\" which will raise DeviceNotFound.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"f2624848aa6e485c1d62a35406ffb46c6a7832d0","unresolved":false,"context_lines":[{"line_number":354,"context_line":"        fake_exc \u003d fakelibvirt.make_libvirtError("},{"line_number":355,"context_line":"            fakelibvirt.libvirtError, \"\","},{"line_number":356,"context_line":"            error_message\u003d\"invalid argument: no target device vdb\","},{"line_number":357,"context_line":"            error_code\u003dfakelibvirt.VIR_ERR_INVALID_ARG,"},{"line_number":358,"context_line":"            error_domain\u003dfakelibvirt.VIR_FROM_DOMAIN)"},{"line_number":359,"context_line":"        # Detach from persistent raises not found, detach from live succeeds"},{"line_number":360,"context_line":"        self.domain.detachDeviceFlags.side_effect \u003d [fake_exc, None]"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_6e8c902e","line":357,"range":{"start_line":357,"start_character":35,"end_line":357,"end_character":54},"in_reply_to":"bf51134e_6e9810cc","updated":"2020-07-17 15:40:26.000000000","message":"Yup, I need to wire up the kwarg here so this can also be VIR_ERR_DEVICE_MISSING as is the case with libvirt v4.1.0.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ad59a8a2a532f7772680aab11c5226908bf1eaf4","unresolved":false,"context_lines":[{"line_number":379,"context_line":""},{"line_number":380,"context_line":"    def test_detach_device_with_retry_no_inactive_device_missing(self):"},{"line_number":381,"context_line":"        self._test_detach_device_with_retry_no_inactive()"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def _test_detach_device_with_retry_no_live("},{"line_number":384,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":385,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_ae7b4879","line":382,"updated":"2020-07-17 15:23:07.000000000","message":"These 2 tests are dealing with inactive being already detached and then trying to detach from live after. But there should only be one of these and there should be no args passed.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"f2624848aa6e485c1d62a35406ffb46c6a7832d0","unresolved":false,"context_lines":[{"line_number":379,"context_line":""},{"line_number":380,"context_line":"    def test_detach_device_with_retry_no_inactive_device_missing(self):"},{"line_number":381,"context_line":"        self._test_detach_device_with_retry_no_inactive()"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def _test_detach_device_with_retry_no_live("},{"line_number":384,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":385,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_ce779c3b","line":382,"in_reply_to":"bf51134e_ae7b4879","updated":"2020-07-17 15:40:26.000000000","message":"We need to cover both once the kwargs are actually used in the underlying test.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ad59a8a2a532f7772680aab11c5226908bf1eaf4","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        self._test_detach_device_with_retry_no_inactive()"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def _test_detach_device_with_retry_no_live("},{"line_number":384,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":385,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"},{"line_number":386,"context_line":"        # This simulates a persistent domain detach failing because"},{"line_number":387,"context_line":"        # the device is not found on the live config"},{"line_number":388,"context_line":"        conf \u003d mock.Mock(spec\u003dvconfig.LibvirtConfigGuestDevice)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_6ee6504d","line":385,"range":{"start_line":384,"start_character":14,"end_line":385,"end_character":62},"updated":"2020-07-17 15:23:07.000000000","message":"These args are never used in this function...","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"f2624848aa6e485c1d62a35406ffb46c6a7832d0","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        self._test_detach_device_with_retry_no_inactive()"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def _test_detach_device_with_retry_no_live("},{"line_number":384,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":385,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"},{"line_number":386,"context_line":"        # This simulates a persistent domain detach failing because"},{"line_number":387,"context_line":"        # the device is not found on the live config"},{"line_number":388,"context_line":"        conf \u003d mock.Mock(spec\u003dvconfig.LibvirtConfigGuestDevice)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_6e877014","line":385,"range":{"start_line":384,"start_character":14,"end_line":385,"end_character":62},"in_reply_to":"bf51134e_6ee6504d","updated":"2020-07-17 15:40:26.000000000","message":"Gah thanks!","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ad59a8a2a532f7772680aab11c5226908bf1eaf4","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"    def test_detach_device_with_retry_no_live_device_missing(self):"},{"line_number":417,"context_line":"        self._test_detach_device_with_retry_no_live()"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"    def test_get_xml_desc(self):"},{"line_number":420,"context_line":"        self.guest.get_xml_desc()"},{"line_number":421,"context_line":"        self.domain.XMLDesc.assert_called_once_with(flags\u003d0)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_ced67c54","line":418,"updated":"2020-07-17 15:23:07.000000000","message":"And these are supposed to be simulating a device only attached to the persistent domain and not the live domain. But this test isn\u0027t reflecting a real life scenario as VIR_ERR_INVALID_ARG is raised when the persistent device is not attached when the detach attempt happens.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"f2624848aa6e485c1d62a35406ffb46c6a7832d0","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"    def test_detach_device_with_retry_no_live_device_missing(self):"},{"line_number":417,"context_line":"        self._test_detach_device_with_retry_no_live()"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"    def test_get_xml_desc(self):"},{"line_number":420,"context_line":"        self.guest.get_xml_desc()"},{"line_number":421,"context_line":"        self.domain.XMLDesc.assert_called_once_with(flags\u003d0)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_2e9c5869","line":418,"in_reply_to":"bf51134e_ced67c54","updated":"2020-07-17 15:40:26.000000000","message":"VIR_ERR_INVALID_ARG or VIR_ERR_DEVICE_MISSING can be raised when the device isn\u0027t attached to the persistent / inactive config. I\u0027m not fully sold on this being a valid test anyway but wanted to cover it as the original test_detach_device_with_retry_invalid_argument_no_live was here.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ae6165ea6d0088ac1e1c1b3b47959a980cec3690","unresolved":false,"context_lines":[{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    def test_detach_device_with_retry_device_missing(self):"},{"line_number":338,"context_line":"        self._test_detach_device_with_retry_failure()"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def _test_detach_device_with_retry_no_inactive("},{"line_number":341,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":342,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf51134e_69980acc","line":339,"updated":"2020-07-17 16:25:11.000000000","message":"OK, so we have VIR_ERR_OPERATION_FAILED, VIR_ERR_INTERNAL_ERROR, and VIR_ERR_DEVICE_MISSING covered here. Do we also need to cover VIR_ERR_INVALID_ARG? (If we aren\u0027t discriminating about which error applies to which of live/persistent domain?)","commit_id":"a8946820f6f00f01248ad6c4cf18ac5b5e5e355b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ae6165ea6d0088ac1e1c1b3b47959a980cec3690","unresolved":false,"context_lines":[{"line_number":379,"context_line":""},{"line_number":380,"context_line":"    def test_detach_device_with_retry_no_inactive_device_missing(self):"},{"line_number":381,"context_line":"        self._test_detach_device_with_retry_no_inactive()"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    def _test_detach_device_with_retry_no_live("},{"line_number":384,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":385,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf51134e_c977963b","line":382,"updated":"2020-07-17 16:25:11.000000000","message":"Here we cover VIR_ERR_INVALID_ARG and VIR_ERR_DEVICE_MISSING. Should we also cover VIR_ERR_OPERATION_FAILED and VIR_ERR_INTERNAL_ERROR if we\u0027re not labeling any errors as only for live or only for persistent?","commit_id":"a8946820f6f00f01248ad6c4cf18ac5b5e5e355b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ae6165ea6d0088ac1e1c1b3b47959a980cec3690","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"    def test_detach_device_with_retry_no_live_device_missing(self):"},{"line_number":417,"context_line":"        self._test_detach_device_with_retry_no_live()"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"    def test_get_xml_desc(self):"},{"line_number":420,"context_line":"        self.guest.get_xml_desc()"},{"line_number":421,"context_line":"        self.domain.XMLDesc.assert_called_once_with(flags\u003d0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf51134e_e99ffa4e","line":418,"updated":"2020-07-17 16:25:11.000000000","message":"Same for these two, covering VIR_ERR_INVALID_ARG and VIR_ERR_DEVICE_MISSING. What about VIR_ERR_OPERATION_FAILED and VIR_ERR_INTERNAL_ERROR?","commit_id":"a8946820f6f00f01248ad6c4cf18ac5b5e5e355b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f14ab35448ce5523029240e073adb89db5d38290","unresolved":false,"context_lines":[{"line_number":310,"context_line":"            error_message\u003derror_message,"},{"line_number":311,"context_line":"            error_code\u003derror_code,"},{"line_number":312,"context_line":"            error_domain\u003dfakelibvirt.VIR_FROM_DOMAIN)"},{"line_number":313,"context_line":"        mock_detach.side_effect \u003d [None, fake_exc]"},{"line_number":314,"context_line":"        retry_detach \u003d self.guest.detach_device_with_retry("},{"line_number":315,"context_line":"            get_config, fake_device, live\u003dTrue,"},{"line_number":316,"context_line":"            inc_sleep_time\u003d.01, max_retry_count\u003d3)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf51134e_d7a37db0","line":313,"range":{"start_line":313,"start_character":35,"end_line":313,"end_character":49},"updated":"2020-07-21 20:35:56.000000000","message":"None indicates the successful first detach, fake_exc indicates the failing(not found) second detach from live.","commit_id":"8aea4ee468bcc3641876bd6c33e1ed1c7e942f34"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f14ab35448ce5523029240e073adb89db5d38290","unresolved":false,"context_lines":[{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    def test_detach_device_with_retry_second_detach_device_missing(self):"},{"line_number":338,"context_line":"        self._test_detach_device_with_retry_second_detach_failure()"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def _test_detach_device_with_retry_first_detach_failure("},{"line_number":341,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":342,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf51134e_f7b961ec","line":339,"updated":"2020-07-21 20:35:56.000000000","message":"OK, so these 3 tests ^ cover the second detach (+1 on the test name change). The second detach can only be for the live detach. The live detach can only be one of:\n\nVIR_ERR_OPERATION_FAILED\nVIR_ERR_INTERNAL_ERROR\nVIR_ERR_DEVICE_MISSING\n\nthe first two of which will be removed once the min is \u003e\u003d 4.1.0.","commit_id":"8aea4ee468bcc3641876bd6c33e1ed1c7e942f34"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f14ab35448ce5523029240e073adb89db5d38290","unresolved":false,"context_lines":[{"line_number":358,"context_line":"            error_code\u003derror_code,"},{"line_number":359,"context_line":"            error_domain\u003dfakelibvirt.VIR_FROM_DOMAIN)"},{"line_number":360,"context_line":"        # Detach from persistent raises not found, detach from live succeeds"},{"line_number":361,"context_line":"        self.domain.detachDeviceFlags.side_effect \u003d [fake_exc, None]"},{"line_number":362,"context_line":"        retry_detach \u003d self.guest.detach_device_with_retry(get_config,"},{"line_number":363,"context_line":"            fake_device, live\u003dTrue, inc_sleep_time\u003d.01, max_retry_count\u003d3)"},{"line_number":364,"context_line":"        # We should have tried to detach from the persistent domain"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf51134e_17033575","line":361,"range":{"start_line":361,"start_character":53,"end_line":361,"end_character":67},"updated":"2020-07-21 20:35:56.000000000","message":"OK, so the way this test was originally written, the intent was that the detach from persistent fails (and VIR_ERR_INVALID_ARG is the only error code for that). The rest of the error codes are for a failure to detach from live.\n\nIt is true though that we do call detach with live + persistent flags and it would be possible for detach from persistent to succeed while detach from live fails in that *single call*. And I think this is what lyarwood is covering here, both cases: detach from persistent fails (VIR_ERR_INVALID_ARG) and then detach from live success OR detach from persistent succeeds and detach from live fails with not found the first time and succeeds the second time. Which means we would substitute each of the 4 error codes here to get the behavior.\n\nThis all means that the comments on L343 and L351 and L360 are no longer accurate. It should really say \"Detach from persistent *or live* raises not found\" since we\u0027re covering all the error codes now (which is a good thing).\n\nI can update the code comments and +2. Just don\u0027t want to knowingly leave potential confusion for others (in the backports, as you said you\u0027re going to refactor all of this on master).","commit_id":"8aea4ee468bcc3641876bd6c33e1ed1c7e942f34"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f14ab35448ce5523029240e073adb89db5d38290","unresolved":false,"context_lines":[{"line_number":391,"context_line":"            error_message\u003d\"invalid argument: no target device vdb\")"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def test_detach_device_with_retry_first_detach_device_missing(self):"},{"line_number":394,"context_line":"        self._test_detach_device_with_retry_first_detach_failure()"},{"line_number":395,"context_line":""},{"line_number":396,"context_line":"    def test_get_xml_desc(self):"},{"line_number":397,"context_line":"        self.guest.get_xml_desc()"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf51134e_1738553b","line":394,"updated":"2020-07-21 20:35:56.000000000","message":"These 4 tests ^ cover the first detach (persistent or live) failing with not found, then the live detach succeeds after.","commit_id":"8aea4ee468bcc3641876bd6c33e1ed1c7e942f34"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f6d2a2a875afbdaaa9e7d20eb98a1c049ccd2c8","unresolved":false,"context_lines":[{"line_number":296,"context_line":"    @mock.patch.object(libvirt_guest.Guest, \"detach_device\")"},{"line_number":297,"context_line":"    def _test_detach_device_with_retry_second_detach_failure("},{"line_number":298,"context_line":"        self, mock_detach, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"},{"line_number":299,"context_line":"        error_message\u003d\"device not found: disk vdb not found\"):"},{"line_number":300,"context_line":"        # This simulates a retry of the transient/live domain detach"},{"line_number":301,"context_line":"        # failing because the device is not found"},{"line_number":302,"context_line":"        conf \u003d mock.Mock(spec\u003dvconfig.LibvirtConfigGuestDevice)"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf51134e_7538a29e","line":299,"range":{"start_line":299,"start_character":60,"end_line":299,"end_character":62},"updated":"2020-07-22 09:13:04.000000000","message":"style nit: It\u0027d be easier visually distinguish the parameters and body of the function if you dragged it down a line and dedented\n\n  def _test_foo(\n      self, param_a, ...\n  ):","commit_id":"902f09af251d2b2e56fb2f2900a3510baf38a508"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f6d2a2a875afbdaaa9e7d20eb98a1c049ccd2c8","unresolved":false,"context_lines":[{"line_number":335,"context_line":"            error_message\u003d\"operation failed: disk vdb not found\")"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    def test_detach_device_with_retry_second_detach_device_missing(self):"},{"line_number":338,"context_line":"        self._test_detach_device_with_retry_second_detach_failure()"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"    def _test_detach_device_with_retry_first_detach_failure("},{"line_number":341,"context_line":"        self, error_code\u003dfakelibvirt.VIR_ERR_DEVICE_MISSING,"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf51134e_d526ce68","line":338,"range":{"start_line":338,"start_character":66,"end_line":338,"end_character":67},"updated":"2020-07-22 09:13:04.000000000","message":"nit: This would have been slightly easier to grok if you didn\u0027t provide default values above and instead set them here","commit_id":"902f09af251d2b2e56fb2f2900a3510baf38a508"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f6d2a2a875afbdaaa9e7d20eb98a1c049ccd2c8","unresolved":false,"context_lines":[{"line_number":401,"context_line":"            error_message\u003d\"invalid argument: no target device vdb\")"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"    def test_detach_device_with_retry_first_detach_device_missing(self):"},{"line_number":404,"context_line":"        self._test_detach_device_with_retry_first_detach_failure()"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    def test_get_xml_desc(self):"},{"line_number":407,"context_line":"        self.guest.get_xml_desc()"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf51134e_551abe16","line":404,"range":{"start_line":404,"start_character":65,"end_line":404,"end_character":66},"updated":"2020-07-22 09:13:04.000000000","message":"Same argument around default parameters here","commit_id":"902f09af251d2b2e56fb2f2900a3510baf38a508"}],"nova/virt/libvirt/guest.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"d5bce352d2cb1997eea99e184ad99de1e3647a1b","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                                   libvirt.VIR_ERR_INTERNAL_ERROR,"},{"line_number":401,"context_line":"                                   libvirt.VIR_ERR_DEVICE_MISSING):"},{"line_number":402,"context_line":"                        errmsg \u003d ex.get_error_message()"},{"line_number":403,"context_line":"                        if \u0027not found\u0027 in errmsg:"},{"line_number":404,"context_line":"                            # This will be raised if the live domain"},{"line_number":405,"context_line":"                            # detach fails because the device is not found"},{"line_number":406,"context_line":"                            raise exception.DeviceNotFound("}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_d83802d6","line":403,"updated":"2020-07-17 13:41:57.000000000","message":"I assume this can also go when we remove the above? Maybe not worth calling (someone will recognize it)","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"1108db630d4c07b9dfa6c70c8aba25f4f508533b","unresolved":false,"context_lines":[{"line_number":400,"context_line":"                                   libvirt.VIR_ERR_INTERNAL_ERROR,"},{"line_number":401,"context_line":"                                   libvirt.VIR_ERR_DEVICE_MISSING):"},{"line_number":402,"context_line":"                        errmsg \u003d ex.get_error_message()"},{"line_number":403,"context_line":"                        if \u0027not found\u0027 in errmsg:"},{"line_number":404,"context_line":"                            # This will be raised if the live domain"},{"line_number":405,"context_line":"                            # detach fails because the device is not found"},{"line_number":406,"context_line":"                            raise exception.DeviceNotFound("}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_d8c2c286","line":403,"in_reply_to":"bf51134e_d83802d6","updated":"2020-07-17 13:46:54.000000000","message":"Yes and I\u0027m working on the removal in a FUP now as I\u0027d like to also refactor most of this flow anyway.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b1a55e342f39b980ff4704f7e8a1e9aa34b3fbaf","unresolved":false,"context_lines":[{"line_number":401,"context_line":"                                   libvirt.VIR_ERR_DEVICE_MISSING):"},{"line_number":402,"context_line":"                        errmsg \u003d ex.get_error_message()"},{"line_number":403,"context_line":"                        if \u0027not found\u0027 in errmsg:"},{"line_number":404,"context_line":"                            # This will be raised if the live domain"},{"line_number":405,"context_line":"                            # detach fails because the device is not found"},{"line_number":406,"context_line":"                            raise exception.DeviceNotFound("},{"line_number":407,"context_line":"                                device\u003dalternative_device_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_aecea82a","line":404,"range":{"start_line":404,"start_character":57,"end_line":404,"end_character":61},"updated":"2020-07-17 15:50:21.000000000","message":"\"VIR_ERR_INVALID_ARG or VIR_ERR_DEVICE_MISSING can be raised when the device isn\u0027t attached to the persistent / inactive config.\"\n\nIf this is the case, maybe we ought to remove the \"live\" and \"persistent\" words from these code comments (also L411) because that was part of what confused me while reviewing the tests.","commit_id":"96a9b5eb1b722d1afb09580b53063ecbdddc228b"}]}
