)]}'
{"nova/tests/unit/virt/libvirt/test_host.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"660d582c6cefbb4196a6191c2f496fc65cf5ab1f","unresolved":false,"context_lines":[{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_get_memory_used_xen(self):"},{"line_number":746,"context_line":"        self.flags(virt_type\u003d\u0027xen\u0027, group\u003d\u0027libvirt\u0027)"},{"line_number":747,"context_line":"        with mock.patch.object(self.host, \"_sum_domain_memory_mb\") \\"},{"line_number":748,"context_line":"                as mock_sumDomainMemory:"},{"line_number":749,"context_line":"            mock_sumDomainMemory.return_value \u003d 8192"},{"line_number":750,"context_line":"            self.assertEqual(8192, self.host.get_memory_mb_used())"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_dc3a78cb","line":747,"range":{"start_line":747,"start_character":67,"end_line":747,"end_character":68},"updated":"2018-06-11 18:43:09.000000000","message":"again with the backslash","commit_id":"dddb8147d71623a3e00417af260ecad4ee2d6454"},{"author":{"_account_id":26006,"name":"Zack Cornelius","email":"zack.cornelius@kove.net","username":"zcornelius"},"change_message_id":"7417e192f91ab9c941b190fe2cf4d4c277d49cee","unresolved":false,"context_lines":[{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_get_memory_used_xen(self):"},{"line_number":746,"context_line":"        self.flags(virt_type\u003d\u0027xen\u0027, group\u003d\u0027libvirt\u0027)"},{"line_number":747,"context_line":"        with mock.patch.object(self.host, \"_sum_domain_memory_mb\") \\"},{"line_number":748,"context_line":"                as mock_sumDomainMemory:"},{"line_number":749,"context_line":"            mock_sumDomainMemory.return_value \u003d 8192"},{"line_number":750,"context_line":"            self.assertEqual(8192, self.host.get_memory_mb_used())"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_1c5550c2","line":747,"range":{"start_line":747,"start_character":67,"end_line":747,"end_character":68},"in_reply_to":"5f7c97a3_dc3a78cb","updated":"2018-06-11 19:01:51.000000000","message":"Yep. Missed this change in this patch, and errantly included it in the next patch instead (Which also causes this test to fail tox py35). Posting a new set soon with the proper fix here in a moment.","commit_id":"dddb8147d71623a3e00417af260ecad4ee2d6454"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7a0aeb3b7b155120896c9ed34b525e1a718d5179","unresolved":false,"context_lines":[{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_get_memory_used_xen(self):"},{"line_number":746,"context_line":"        self.flags(virt_type\u003d\u0027xen\u0027, group\u003d\u0027libvirt\u0027)"},{"line_number":747,"context_line":"        with test.nested("},{"line_number":748,"context_line":"                mock.patch.object(self.host, \"_sum_domain_memory_mb\"),"},{"line_number":749,"context_line":"                mock.patch(\u0027sys.platform\u0027, \u0027linux2\u0027)"},{"line_number":750,"context_line":"                ) as (mock_sumDomainMemory, mock_platform):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_1700ca01","line":747,"range":{"start_line":747,"start_character":13,"end_line":747,"end_character":25},"updated":"2018-06-11 21:35:43.000000000","message":"you don\u0027t need test.nested [1].  You can do this as:\n\n with (mock.patch.object(self.host, \"_sum_domain_memory_mb) as mock_sumDomainMemory,\n       mock.patch(\u0027sys.platform\u0027, \u0027linux2\u0027)):\n\n[1] https://stackoverflow.com/questions/893333/multiple-variables-in-python-with-statement","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e5f1fabff08cd8b01fff3a86251ee7a885506c13","unresolved":false,"context_lines":[{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_get_memory_used_xen(self):"},{"line_number":746,"context_line":"        self.flags(virt_type\u003d\u0027xen\u0027, group\u003d\u0027libvirt\u0027)"},{"line_number":747,"context_line":"        with test.nested("},{"line_number":748,"context_line":"                mock.patch.object(self.host, \"_sum_domain_memory_mb\"),"},{"line_number":749,"context_line":"                mock.patch(\u0027sys.platform\u0027, \u0027linux2\u0027)"},{"line_number":750,"context_line":"                ) as (mock_sumDomainMemory, mock_platform):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_222c8c00","line":747,"range":{"start_line":747,"start_character":13,"end_line":747,"end_character":25},"in_reply_to":"5f7c97a3_0284f009","updated":"2018-06-12 16:07:52.000000000","message":"I didn\u0027t want to hold up on this.  I would fast-approve a fup to fix it, if you\u0027re so inclined :)","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"0a280a75d855d2cf0052e3f9044dae19dc407902","unresolved":false,"context_lines":[{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_get_memory_used_xen(self):"},{"line_number":746,"context_line":"        self.flags(virt_type\u003d\u0027xen\u0027, group\u003d\u0027libvirt\u0027)"},{"line_number":747,"context_line":"        with test.nested("},{"line_number":748,"context_line":"                mock.patch.object(self.host, \"_sum_domain_memory_mb\"),"},{"line_number":749,"context_line":"                mock.patch(\u0027sys.platform\u0027, \u0027linux2\u0027)"},{"line_number":750,"context_line":"                ) as (mock_sumDomainMemory, mock_platform):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_0284f009","line":747,"range":{"start_line":747,"start_character":13,"end_line":747,"end_character":25},"in_reply_to":"5f7c97a3_1700ca01","updated":"2018-06-12 16:04:08.000000000","message":"Good point I think we stopped to accept using it for new tests.","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"e548c27b953ff94851dfd6d0e56d955947d4e3ea","unresolved":false,"context_lines":[{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_get_memory_used_xen(self):"},{"line_number":746,"context_line":"        self.flags(virt_type\u003d\u0027xen\u0027, group\u003d\u0027libvirt\u0027)"},{"line_number":747,"context_line":"        with test.nested("},{"line_number":748,"context_line":"                mock.patch.object(self.host, \"_sum_domain_memory_mb\"),"},{"line_number":749,"context_line":"                mock.patch(\u0027sys.platform\u0027, \u0027linux2\u0027)"},{"line_number":750,"context_line":"                ) as (mock_sumDomainMemory, mock_platform):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_8219e0d1","line":747,"range":{"start_line":747,"start_character":13,"end_line":747,"end_character":25},"in_reply_to":"5f7c97a3_222c8c00","updated":"2018-06-12 16:11:20.000000000","message":"I\u0027m not, we could still clean the whole file in one patch.","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"}],"nova/virt/libvirt/host.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b74f4d8a560c8f8761866f8e2b627497508c2a35","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        \"\"\""},{"line_number":768,"context_line":"        return self._get_hardware_info()[1]"},{"line_number":769,"context_line":""},{"line_number":770,"context_line":"    def _sum_domain_memory_mb(self, host_id\u003dNone):"},{"line_number":771,"context_line":"        \"\"\"Get the total memory consumed by guest domains"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"        For xen, subtract available host memory from the host_id domain to"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_bf5ca919","line":770,"range":{"start_line":770,"start_character":36,"end_line":770,"end_character":48},"updated":"2018-06-06 22:56:05.000000000","message":"This doesn\u0027t seem necessary within this patch.  Having added logic you\u0027re not using, I would think UT would be warranted.\n\n[Laterr] I see that it\u0027s used in the subsequent patch; maybe it should be added then.  But I\u0027m not loving the semantic; I think it would read better as a boolean like include_host\u003dFalse.  Then L786 would be:\n\n if include_host and guest.id \u003d\u003d 0:","commit_id":"539b7f7a6db27038471d62fab57a20a1040789e9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a26397f1e9cd030a38255cb95a51a57f1bfaff8d","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        \"\"\""},{"line_number":768,"context_line":"        return self._get_hardware_info()[1]"},{"line_number":769,"context_line":""},{"line_number":770,"context_line":"    def _sum_domain_memory_mb(self, host_id\u003dNone):"},{"line_number":771,"context_line":"        \"\"\"Get the total memory consumed by guest domains"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"        For xen, subtract available host memory from the host_id domain to"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_b62fe286","line":770,"range":{"start_line":770,"start_character":36,"end_line":770,"end_character":48},"in_reply_to":"5f7c97a3_957f40aa","updated":"2018-06-07 14:38:49.000000000","message":"It\u0027s always going to be zero for the xen case.\n\nTBH, I think I would change this to _sum_domain_zero_memory_mb(), nix the host_id and make it xen-specific until it needs to not be. It\u0027ll just be clearer, IMHO.\n\nAlso, I\u0027d refactor the tests that we have for the xen path to test this specifically, and add a trivial one to just make sure the helper is called in the case of virt_type being xen.","commit_id":"539b7f7a6db27038471d62fab57a20a1040789e9"},{"author":{"_account_id":26006,"name":"Zack Cornelius","email":"zack.cornelius@kove.net","username":"zcornelius"},"change_message_id":"09114323ee5f0f7536cd72ea6a3e8cdf8794ff4d","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        \"\"\""},{"line_number":768,"context_line":"        return self._get_hardware_info()[1]"},{"line_number":769,"context_line":""},{"line_number":770,"context_line":"    def _sum_domain_memory_mb(self, host_id\u003dNone):"},{"line_number":771,"context_line":"        \"\"\"Get the total memory consumed by guest domains"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"        For xen, subtract available host memory from the host_id domain to"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_dfcde586","line":770,"range":{"start_line":770,"start_character":36,"end_line":770,"end_character":48},"in_reply_to":"5f7c97a3_bf5ca919","updated":"2018-06-06 23:06:19.000000000","message":"I was trying to avoid the inclusion of xen specific knowledge here, where guest id 0 is the host, and instead go for a more general case where any ID could be the host, leaving the xen specific knowledge in get_memory_mb_used.\n\nI\u0027m not at all sold that this is the best way. Not opposed to changing this.","commit_id":"539b7f7a6db27038471d62fab57a20a1040789e9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6c53f0636e9535caff7c39559e8a077fa6ea4a44","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        \"\"\""},{"line_number":768,"context_line":"        return self._get_hardware_info()[1]"},{"line_number":769,"context_line":""},{"line_number":770,"context_line":"    def _sum_domain_memory_mb(self, host_id\u003dNone):"},{"line_number":771,"context_line":"        \"\"\"Get the total memory consumed by guest domains"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"        For xen, subtract available host memory from the host_id domain to"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_957f40aa","line":770,"range":{"start_line":770,"start_character":36,"end_line":770,"end_character":48},"in_reply_to":"5f7c97a3_dfcde586","updated":"2018-06-07 13:37:06.000000000","message":"Okay, that\u0027s a fair point.  I don\u0027t know which is better; I\u0027ll leave it to folks with more domain expertise.","commit_id":"539b7f7a6db27038471d62fab57a20a1040789e9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b74f4d8a560c8f8761866f8e2b627497508c2a35","unresolved":false,"context_lines":[{"line_number":800,"context_line":"        idx2 \u003d m.index(\u0027Buffers:\u0027)"},{"line_number":801,"context_line":"        idx3 \u003d m.index(\u0027Cached:\u0027)"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"        avail \u003d (int(m[idx1 + 1]) + int(m[idx2 + 1]) + int(m[idx3 + 1]))"},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        return avail"},{"line_number":806,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_ffd54148","line":803,"range":{"start_line":803,"start_character":16,"end_line":803,"end_character":72},"updated":"2018-06-06 22:56:05.000000000","message":"outer parens unnecessary.","commit_id":"539b7f7a6db27038471d62fab57a20a1040789e9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b74f4d8a560c8f8761866f8e2b627497508c2a35","unresolved":false,"context_lines":[{"line_number":816,"context_line":"            # For xen, report the sum of all domains, with"},{"line_number":817,"context_line":"            return self._sum_domain_memory_mb(host_id\u003d0)"},{"line_number":818,"context_line":"        else:"},{"line_number":819,"context_line":"            return self.get_memory_mb_total() - \\"},{"line_number":820,"context_line":"                   (self._get_avail_memory_kb() // units.Ki)"},{"line_number":821,"context_line":""},{"line_number":822,"context_line":"    def get_cpu_stats(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_3f7179a9","line":819,"range":{"start_line":819,"start_character":48,"end_line":819,"end_character":49},"updated":"2018-06-06 22:56:05.000000000","message":"nit: prefer extra parens over backslashes.","commit_id":"539b7f7a6db27038471d62fab57a20a1040789e9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a26397f1e9cd030a38255cb95a51a57f1bfaff8d","unresolved":false,"context_lines":[{"line_number":816,"context_line":"            # For xen, report the sum of all domains, with"},{"line_number":817,"context_line":"            return self._sum_domain_memory_mb(host_id\u003d0)"},{"line_number":818,"context_line":"        else:"},{"line_number":819,"context_line":"            return self.get_memory_mb_total() - \\"},{"line_number":820,"context_line":"                   (self._get_avail_memory_kb() // units.Ki)"},{"line_number":821,"context_line":""},{"line_number":822,"context_line":"    def get_cpu_stats(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_fb1ea372","line":819,"range":{"start_line":819,"start_character":48,"end_line":819,"end_character":49},"in_reply_to":"5f7c97a3_3f7179a9","updated":"2018-06-07 14:38:49.000000000","message":"I and the rest of the nova codebase do as well.","commit_id":"539b7f7a6db27038471d62fab57a20a1040789e9"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"324318ceb9e2d66d575e530488b72106e2db3293","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        \"\"\""},{"line_number":768,"context_line":"        return self._get_hardware_info()[1]"},{"line_number":769,"context_line":""},{"line_number":770,"context_line":"    def _sum_domain_memory_mb(self):"},{"line_number":771,"context_line":"        \"\"\"Get the total memory consumed by guest domains"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"        Subtract available host memory from dom0 to get real used memory"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_c284b8b3","line":770,"updated":"2018-06-12 16:13:16.000000000","message":"Because we have hardcoded the value for Xen we could have find a name for the method related with xen","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fec9ca5b484b7fd2ce1c0820dd8a965e7419ce35","unresolved":false,"context_lines":[{"line_number":767,"context_line":"        \"\"\""},{"line_number":768,"context_line":"        return self._get_hardware_info()[1]"},{"line_number":769,"context_line":""},{"line_number":770,"context_line":"    def _sum_domain_memory_mb(self):"},{"line_number":771,"context_line":"        \"\"\"Get the total memory consumed by guest domains"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"        Subtract available host memory from dom0 to get real used memory"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_026dd001","line":770,"in_reply_to":"5f7c97a3_c284b8b3","updated":"2018-06-12 16:17:06.000000000","message":"The docstring for this specifically mentions dom0","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"0a280a75d855d2cf0052e3f9044dae19dc407902","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                            \" %(uuid)s, exception: %(ex)s\","},{"line_number":784,"context_line":"                            {\"uuid\": guest.uuid, \"ex\": e})"},{"line_number":785,"context_line":"                continue"},{"line_number":786,"context_line":"            if guest.id \u003d\u003d 0:"},{"line_number":787,"context_line":"                # Memory usage for the host domain (dom0 in xen) is the"},{"line_number":788,"context_line":"                # reported memory minus available memory"},{"line_number":789,"context_line":"                used +\u003d (dom_mem - self._get_avail_memory_kb())"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_a2e73c12","line":786,"range":{"start_line":786,"start_character":26,"end_line":786,"end_character":29},"updated":"2018-06-12 16:04:08.000000000","message":"So the preference was to hardcore this part.","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fec9ca5b484b7fd2ce1c0820dd8a965e7419ce35","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                            \" %(uuid)s, exception: %(ex)s\","},{"line_number":784,"context_line":"                            {\"uuid\": guest.uuid, \"ex\": e})"},{"line_number":785,"context_line":"                continue"},{"line_number":786,"context_line":"            if guest.id \u003d\u003d 0:"},{"line_number":787,"context_line":"                # Memory usage for the host domain (dom0 in xen) is the"},{"line_number":788,"context_line":"                # reported memory minus available memory"},{"line_number":789,"context_line":"                used +\u003d (dom_mem - self._get_avail_memory_kb())"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_e269b4f7","line":786,"range":{"start_line":786,"start_character":26,"end_line":786,"end_character":29},"in_reply_to":"5f7c97a3_42666853","updated":"2018-06-12 16:17:06.000000000","message":"The commentary is on the next line (dom0)","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e5f1fabff08cd8b01fff3a86251ee7a885506c13","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                            \" %(uuid)s, exception: %(ex)s\","},{"line_number":784,"context_line":"                            {\"uuid\": guest.uuid, \"ex\": e})"},{"line_number":785,"context_line":"                continue"},{"line_number":786,"context_line":"            if guest.id \u003d\u003d 0:"},{"line_number":787,"context_line":"                # Memory usage for the host domain (dom0 in xen) is the"},{"line_number":788,"context_line":"                # reported memory minus available memory"},{"line_number":789,"context_line":"                used +\u003d (dom_mem - self._get_avail_memory_kb())"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_c2f59884","line":786,"range":{"start_line":786,"start_character":26,"end_line":786,"end_character":29},"in_reply_to":"5f7c97a3_a2e73c12","updated":"2018-06-12 16:07:52.000000000","message":"See Dan\u0027s commentary on PS2","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"e548c27b953ff94851dfd6d0e56d955947d4e3ea","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                            \" %(uuid)s, exception: %(ex)s\","},{"line_number":784,"context_line":"                            {\"uuid\": guest.uuid, \"ex\": e})"},{"line_number":785,"context_line":"                continue"},{"line_number":786,"context_line":"            if guest.id \u003d\u003d 0:"},{"line_number":787,"context_line":"                # Memory usage for the host domain (dom0 in xen) is the"},{"line_number":788,"context_line":"                # reported memory minus available memory"},{"line_number":789,"context_line":"                used +\u003d (dom_mem - self._get_avail_memory_kb())"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_42666853","line":786,"range":{"start_line":786,"start_character":26,"end_line":786,"end_character":29},"in_reply_to":"5f7c97a3_c2f59884","updated":"2018-06-12 16:11:20.000000000","message":"Yes, in that case I would have preferred a constant so we could have made that clear why it\u0027s 0. Also a comment would have been great.","commit_id":"4a0d8d94ce6c891a4f19ae3c0e24c9a798f7b363"}]}
