)]}'
{"nova/tests/functional/libvirt/test_report_cpu_traits.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"bc5b188ebcabb0553cc18f13d6737760724263fc","unresolved":true,"context_lines":[{"line_number":165,"context_line":"            # As we are changing the domain caps we need to clear the"},{"line_number":166,"context_line":"            # cache in the host object."},{"line_number":167,"context_line":"            self.compute.driver._host._domain_caps \u003d None"},{"line_number":168,"context_line":"            self.compute.driver._host._supports_amd_sev \u003d None"},{"line_number":169,"context_line":"            self.assertTrue(self.compute.driver._host.supports_amd_sev)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"            mock_exists.assert_has_calls([mock.call(SEV_KERNEL_PARAM_FILE)])"}],"source_content_type":"text/x-python","patch_set":5,"id":"55e8ec8e_5c205b44","line":168,"updated":"2021-03-09 10:31:23.000000000","message":"that\u0027s not related to mypy, right?","commit_id":"141f3e7d4f68577a56c7233ba159671ac0064fd4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"03af12c0c66ebec86c345236a292c4c2dc0301fc","unresolved":false,"context_lines":[{"line_number":165,"context_line":"            # As we are changing the domain caps we need to clear the"},{"line_number":166,"context_line":"            # cache in the host object."},{"line_number":167,"context_line":"            self.compute.driver._host._domain_caps \u003d None"},{"line_number":168,"context_line":"            self.compute.driver._host._supports_amd_sev \u003d None"},{"line_number":169,"context_line":"            self.assertTrue(self.compute.driver._host.supports_amd_sev)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"            mock_exists.assert_has_calls([mock.call(SEV_KERNEL_PARAM_FILE)])"}],"source_content_type":"text/x-python","patch_set":5,"id":"06e6e1cf_09788bb8","line":168,"in_reply_to":"55e8ec8e_5c205b44","updated":"2021-03-09 11:30:21.000000000","message":"It is. With the previous code, mypy couldn\u0027t detect that \u0027supports_amd_sev would always return a boolean since it was coupled to the \u0027self._supports_amd_sev\u0027 attribute and that was only set by side-effect in \u0027_set_amd_sev_support\u0027. Another example:\n\n  import typing as ty\n\n  class Foo:\n      def __init__(self):\n          self._bar: ty.Optional[bool] \u003d None\n\n      def get_bar() -\u003e bool:\n          if self._bar is None:\n              self._set_bar()\n          return self._bar\n\n      def _set_bar() -\u003e None:\n          self._bar \u003d True\n\nThat\u0027ll fail because the type of \u0027self._bar\u0027 is one of True, False or None, but we\u0027ve said it can only be True or False. I could rework this to add a totally unnecessary \u0027is not None\u0027 check, but I think what I did instead was better. Basically the equivalent of:\n\n  class Foo:\n      def __init__(self):\n          self._bar: ty.Optional[bool] \u003d None\n\n      def get_bar() -\u003e bool:\n          if self._bar is not None:\n              self._bar \u003d True\n          return self._bar","commit_id":"141f3e7d4f68577a56c7233ba159671ac0064fd4"}],"nova/virt/libvirt/host.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"bc5b188ebcabb0553cc18f13d6737760724263fc","unresolved":true,"context_lines":[{"line_number":1345,"context_line":""},{"line_number":1346,"context_line":"        caps \u003d self.get_capabilities()"},{"line_number":1347,"context_line":"        if caps.host.cpu.arch !\u003d fields.Architecture.X86_64:"},{"line_number":1348,"context_line":"            return self._supports_amd_sev"},{"line_number":1349,"context_line":""},{"line_number":1350,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":1351,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"18129c30_6d9e55c0","line":1348,"updated":"2021-03-09 10:31:23.000000000","message":"(later) Ahah, OK, I see why you\u0027re doing this.\n\nWell, why aren\u0027t you explaining it in the commit msg ?","commit_id":"141f3e7d4f68577a56c7233ba159671ac0064fd4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"03af12c0c66ebec86c345236a292c4c2dc0301fc","unresolved":false,"context_lines":[{"line_number":1345,"context_line":""},{"line_number":1346,"context_line":"        caps \u003d self.get_capabilities()"},{"line_number":1347,"context_line":"        if caps.host.cpu.arch !\u003d fields.Architecture.X86_64:"},{"line_number":1348,"context_line":"            return self._supports_amd_sev"},{"line_number":1349,"context_line":""},{"line_number":1350,"context_line":"        if not self._kernel_supports_amd_sev():"},{"line_number":1351,"context_line":"            LOG.info(\"kernel doesn\u0027t support AMD SEV\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"07aa9114_4694be91","line":1348,"in_reply_to":"18129c30_6d9e55c0","updated":"2021-03-09 11:30:21.000000000","message":"I have; I\u0027m fixing the type hints 😉 Previously we were relying on truth\u0027y behavior and now we\u0027re explicitly using true/false","commit_id":"141f3e7d4f68577a56c7233ba159671ac0064fd4"}]}
