)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d64b02c10a0e5c1c3d15330bceb56136fe08c361","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"PoisonFunctions poisons Host._init_events without checking if it\u0027s"},{"line_number":10,"context_line":"already mocked. This creates a proper headscratcher when you try to"},{"line_number":11,"context_line":"use FakeLibvirtFixture with ServersTestBase: if you use"},{"line_number":12,"context_line":"FakeLibvirtFixture before calling super.setUp() PoisonFunctions will"},{"line_number":13,"context_line":"poison the function we already mocked, if we call it in the other"},{"line_number":14,"context_line":"order setUp() will fail when it tries to start nova-compute."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I6d8214c75a67c87ec5a7406f3cc2e8b923aa4d84"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5f7c97a3_f2cbea47","line":13,"range":{"start_line":11,"start_character":45,"end_line":13,"end_character":37},"updated":"2018-07-30 05:59:07.000000000","message":"So it can be fixed by fixing the order of the fixtures in your test. I think we (can) have plenty of similar issues like ConfigFixture setting some conf value while your test has already set up something with self.flags().\n\nAnyhow I think the current fix is a right step forward.","commit_id":"e802c0a7eeff1ee7e168c9ec8bf8bb20aad0ce44"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"30beaaa68217a6772febe61ded919f823fd8a14d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"PoisonFunctions poisons Host._init_events without checking if it\u0027s"},{"line_number":10,"context_line":"already mocked. This creates a proper headscratcher when you try to"},{"line_number":11,"context_line":"use FakeLibvirtFixture with ServersTestBase: if you use"},{"line_number":12,"context_line":"FakeLibvirtFixture before calling super.setUp() PoisonFunctions will"},{"line_number":13,"context_line":"poison the function we already mocked, if we call it in the other"},{"line_number":14,"context_line":"order setUp() will fail when it tries to start nova-compute."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I6d8214c75a67c87ec5a7406f3cc2e8b923aa4d84"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5f7c97a3_a1917e55","line":13,"range":{"start_line":11,"start_character":45,"end_line":13,"end_character":37},"in_reply_to":"5f7c97a3_f2cbea47","updated":"2018-07-31 12:17:03.000000000","message":"Yeah, in this specific instance I hit different 2 different issues depending on which order you used, so neither order worked. This one was the more obtuse: it\u0027s telling me I can\u0027t use the mocked function I definitely already mocked. There may have been cursing :)","commit_id":"e802c0a7eeff1ee7e168c9ec8bf8bb20aad0ce44"}],"nova/tests/fixtures.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3cda8abb368e467dfa20f2c98165dd87ad080201","unresolved":false,"context_lines":[{"line_number":953,"context_line":""},{"line_number":954,"context_line":"        # Don\u0027t poison the function if it\u0027s already mocked"},{"line_number":955,"context_line":"        if not isinstance(nova.virt.libvirt.host.Host._init_events,"},{"line_number":956,"context_line":"                          mock.MagicMock):"},{"line_number":957,"context_line":"            self.useFixture(fixtures.MockPatch("},{"line_number":958,"context_line":"                \u0027nova.virt.libvirt.host.Host._init_events\u0027,"},{"line_number":959,"context_line":"                side_effect\u003devloop))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_6e8f45d3","line":956,"range":{"start_line":956,"start_character":31,"end_line":956,"end_character":40},"updated":"2018-07-25 14:14:27.000000000","message":"suggest using Mock here, since MagicMock is a superclass and it\u0027s more generic.","commit_id":"998d5e54b1816f799397b5c369fe6860a1652594"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"4f5df55a7e860da10295ba7d757d6136195ce9bb","unresolved":false,"context_lines":[{"line_number":953,"context_line":""},{"line_number":954,"context_line":"        # Don\u0027t poison the function if it\u0027s already mocked"},{"line_number":955,"context_line":"        if not isinstance(nova.virt.libvirt.host.Host._init_events,"},{"line_number":956,"context_line":"                          mock.MagicMock):"},{"line_number":957,"context_line":"            self.useFixture(fixtures.MockPatch("},{"line_number":958,"context_line":"                \u0027nova.virt.libvirt.host.Host._init_events\u0027,"},{"line_number":959,"context_line":"                side_effect\u003devloop))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_74e13d2b","line":956,"range":{"start_line":956,"start_character":31,"end_line":956,"end_character":40},"in_reply_to":"5f7c97a3_6e8f45d3","updated":"2018-07-26 13:30:22.000000000","message":"Ack.","commit_id":"998d5e54b1816f799397b5c369fe6860a1652594"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3cda8abb368e467dfa20f2c98165dd87ad080201","unresolved":false,"context_lines":[{"line_number":954,"context_line":"        # Don\u0027t poison the function if it\u0027s already mocked"},{"line_number":955,"context_line":"        if not isinstance(nova.virt.libvirt.host.Host._init_events,"},{"line_number":956,"context_line":"                          mock.MagicMock):"},{"line_number":957,"context_line":"            self.useFixture(fixtures.MockPatch("},{"line_number":958,"context_line":"                \u0027nova.virt.libvirt.host.Host._init_events\u0027,"},{"line_number":959,"context_line":"                side_effect\u003devloop))"},{"line_number":960,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_ee7035de","line":957,"range":{"start_line":957,"start_character":37,"end_line":957,"end_character":46},"updated":"2018-07-25 14:14:27.000000000","message":"I think having switched to MockPatch, you may be able to take out the goofiness on L944-947.","commit_id":"998d5e54b1816f799397b5c369fe6860a1652594"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"4f5df55a7e860da10295ba7d757d6136195ce9bb","unresolved":false,"context_lines":[{"line_number":954,"context_line":"        # Don\u0027t poison the function if it\u0027s already mocked"},{"line_number":955,"context_line":"        if not isinstance(nova.virt.libvirt.host.Host._init_events,"},{"line_number":956,"context_line":"                          mock.MagicMock):"},{"line_number":957,"context_line":"            self.useFixture(fixtures.MockPatch("},{"line_number":958,"context_line":"                \u0027nova.virt.libvirt.host.Host._init_events\u0027,"},{"line_number":959,"context_line":"                side_effect\u003devloop))"},{"line_number":960,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_542681bb","line":957,"range":{"start_line":957,"start_character":37,"end_line":957,"end_character":46},"in_reply_to":"5f7c97a3_ee7035de","updated":"2018-07-26 13:30:22.000000000","message":"Still need to import it because now we use it in the isinstance() check. The comment is out of date, though. I\u0027ll fix it.","commit_id":"998d5e54b1816f799397b5c369fe6860a1652594"}]}
