)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4dec1663d4a714a8c5bcbe04d62ed84001b9e516","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Guan Qiang \u003chzguanqiang@corp.netease.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-12-11 03:31:23 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix nova-compute starting failure bug"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When starting nova-compute on compute node with lxc hypervisor,"},{"line_number":10,"context_line":"a valueError exception will be raised because a libvirt usage bug"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F9ers%3D","line":7,"updated":"2013-12-11 03:36:24.000000000","message":"You should put libvirt or lxc in the commit title to distinguish it.","commit_id":"10a2a709eb28d117aad4893ab473b9246a583ca2"},{"author":{"_account_id":6463,"name":"Jackie","email":"guanqiang85@gmail.com","username":"hzguanqiang"},"change_message_id":"0a02b9b601f80951243883952b1c5c6775c788c5","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Guan Qiang \u003chzguanqiang@corp.netease.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-12-11 03:31:23 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix nova-compute starting failure bug"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When starting nova-compute on compute node with lxc hypervisor,"},{"line_number":10,"context_line":"a valueError exception will be raised because a libvirt usage bug"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F9ep4%3D","line":7,"in_reply_to":"AAAATn%2F9ers%3D","updated":"2013-12-11 03:44:32.000000000","message":"ACK","commit_id":"10a2a709eb28d117aad4893ab473b9246a583ca2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4dec1663d4a714a8c5bcbe04d62ed84001b9e516","unresolved":false,"context_lines":[{"line_number":14,"context_line":"returned if basecpu info is None, not None or something else."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch is to fix this problem by correcting this libvirt usage"},{"line_number":17,"context_line":"mistacke."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I5e4cb4a8d09b660edc4f6c6a4ad4bfe58a4dd5cb"},{"line_number":20,"context_line":"Closes-bug: #1259796"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F9erg%3D","line":17,"updated":"2013-12-11 03:36:24.000000000","message":"s/mistacke/mistake/","commit_id":"10a2a709eb28d117aad4893ab473b9246a583ca2"},{"author":{"_account_id":6463,"name":"Jackie","email":"guanqiang85@gmail.com","username":"hzguanqiang"},"change_message_id":"0a02b9b601f80951243883952b1c5c6775c788c5","unresolved":false,"context_lines":[{"line_number":14,"context_line":"returned if basecpu info is None, not None or something else."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch is to fix this problem by correcting this libvirt usage"},{"line_number":17,"context_line":"mistacke."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I5e4cb4a8d09b660edc4f6c6a4ad4bfe58a4dd5cb"},{"line_number":20,"context_line":"Closes-bug: #1259796"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F9ep0%3D","line":17,"in_reply_to":"AAAATn%2F9erg%3D","updated":"2013-12-11 03:44:32.000000000","message":"ACK","commit_id":"10a2a709eb28d117aad4893ab473b9246a583ca2"}],"nova/tests/virt/libvirt/test_libvirt.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"963cb6affb47e4a8b45ab45b35e282f4f774eacf","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        # Test new verion of libvirt, should find the `aes\u0027 feature"},{"line_number":742,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":743,"context_line":"        caps \u003d conn.get_host_capabilities()"},{"line_number":744,"context_line":"        self.assertIn(\u0027aes\u0027, [x.name for x in caps.host.cpu.features])"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    def test_get_guest_config(self):"},{"line_number":747,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9bVY%3D","line":744,"updated":"2013-12-11 16:40:57.000000000","message":"Looks like Jenkins is failing on this because of what you removed.","commit_id":"112c9a5eec95fa9261d39804966471c191469e63"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"28815a1622918beb82d5da50fa6a50e4e3dcf39f","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        # Test new verion of libvirt, should find the `aes\u0027 feature"},{"line_number":742,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":743,"context_line":"        caps \u003d conn.get_host_capabilities()"},{"line_number":744,"context_line":"        self.assertIn(\u0027aes\u0027, [x.name for x in caps.host.cpu.features])"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    def test_get_guest_config(self):"},{"line_number":747,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9V%2FE%3D","line":744,"in_reply_to":"AAAATn%2F9XAk%3D","updated":"2013-12-12 13:30:10.000000000","message":"Note that in the community CI there are some libvirt test classes which don\u0027t run with a live connection, so those have to be mocked out.  They\u0027ll work locally but not in the community CI for that reason.","commit_id":"112c9a5eec95fa9261d39804966471c191469e63"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"725e9d6dd911a178e9e4e55604f87a338fad2907","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        # Test new verion of libvirt, should find the `aes\u0027 feature"},{"line_number":742,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":743,"context_line":"        caps \u003d conn.get_host_capabilities()"},{"line_number":744,"context_line":"        self.assertIn(\u0027aes\u0027, [x.name for x in caps.host.cpu.features])"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    def test_get_guest_config(self):"},{"line_number":747,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9XAk%3D","line":744,"in_reply_to":"AAAATn%2F9bVY%3D","updated":"2013-12-12 09:24:27.000000000","message":"I have no idea, but this test is passed in my local env.","commit_id":"112c9a5eec95fa9261d39804966471c191469e63"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"963cb6affb47e4a8b45ab45b35e282f4f774eacf","unresolved":false,"context_lines":[{"line_number":5329,"context_line":"    def test_lxc_get_host_capabilities_failed(self):"},{"line_number":5330,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":5331,"context_line":""},{"line_number":5332,"context_line":"        self.mox.StubOutWithMock(conn._conn, \u0027baselineCPU\u0027)"},{"line_number":5333,"context_line":"        conn._conn.baselineCPU(mox.IgnoreArg(), mox.IgnoreArg()).AndReturn(-1)"},{"line_number":5334,"context_line":"        self.mox.ReplayAll()"},{"line_number":5335,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9bVw%3D","line":5332,"updated":"2013-12-11 16:40:57.000000000","message":"Use mock for new tests, see the ML thread here:\n\nhttp://lists.openstack.org/pipermail/openstack-dev/2013-December/021148.html","commit_id":"112c9a5eec95fa9261d39804966471c191469e63"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"725e9d6dd911a178e9e4e55604f87a338fad2907","unresolved":false,"context_lines":[{"line_number":5329,"context_line":"    def test_lxc_get_host_capabilities_failed(self):"},{"line_number":5330,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":5331,"context_line":""},{"line_number":5332,"context_line":"        self.mox.StubOutWithMock(conn._conn, \u0027baselineCPU\u0027)"},{"line_number":5333,"context_line":"        conn._conn.baselineCPU(mox.IgnoreArg(), mox.IgnoreArg()).AndReturn(-1)"},{"line_number":5334,"context_line":"        self.mox.ReplayAll()"},{"line_number":5335,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9XAQ%3D","line":5332,"in_reply_to":"AAAATn%2F9bVw%3D","updated":"2013-12-12 09:24:27.000000000","message":"OK, I\u0027ll change it.","commit_id":"112c9a5eec95fa9261d39804966471c191469e63"},{"author":{"_account_id":1981,"name":"Don Dugger","email":"n0ano@n0ano.com","username":"n0ano"},"change_message_id":"dfe269b8edfea1d204fc4f3bc990ae11cf34dd0e","unresolved":false,"context_lines":[{"line_number":744,"context_line":"    def test_cpu_features_bug_1217630(self):"},{"line_number":745,"context_line":"        # Only test the attr \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027 exists"},{"line_number":746,"context_line":"        # case, to avoid the race condition between tests which"},{"line_number":747,"context_line":"        # delete this attr and use it."},{"line_number":748,"context_line":""},{"line_number":749,"context_line":"        # Test new verion of libvirt, should find the `aes\u0027 feature"},{"line_number":750,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9UDs%3D","line":747,"updated":"2013-12-12 18:48:43.000000000","message":"This also removes an important test that makes sure the code works with older versions of libvirt.  If there is a race condition we should fix the race rather than delete the test.","commit_id":"0c93a4a93e956e24be8952c7c668bd121f760a07"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d01791418b51fa2fb0ff45fa4321faf30c2098cb","unresolved":false,"context_lines":[{"line_number":5382,"context_line":"    def test_lxc_get_host_capabilities_failed(self):"},{"line_number":5383,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":5384,"context_line":""},{"line_number":5385,"context_line":"        with contextlib.nested("},{"line_number":5386,"context_line":"                mock.patch.object(conn._conn, \u0027baselineCPU\u0027, return_value\u003d-1)"},{"line_number":5387,"context_line":"        ) as baselineCPU:"},{"line_number":5388,"context_line":"            got \u003d conn.get_host_capabilities()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9V94%3D","line":5385,"updated":"2013-12-12 13:32:14.000000000","message":"nit: you only have one mocked object here so you don\u0027t need the nested context, you could just do:\n\nwith mock.patch.object(conn._conn, \u0027baselineCPU\u0027, return_value\u003d-1):","commit_id":"0c93a4a93e956e24be8952c7c668bd121f760a07"},{"author":{"_account_id":1981,"name":"Don Dugger","email":"n0ano@n0ano.com","username":"n0ano"},"change_message_id":"54c08b9d9e7b1256934b4ebca21de5fa14ac8b51","unresolved":false,"context_lines":[{"line_number":746,"context_line":"        if not hasattr(libvirt_driver.libvirt,"},{"line_number":747,"context_line":"                \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027):"},{"line_number":748,"context_line":"            setattr(libvirt_driver.libvirt,"},{"line_number":749,"context_line":"                    \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        # Test old version of libvirt, it shouldn\u0027t see the `aes\u0027 feature"},{"line_number":752,"context_line":"        with mock.patch.object(conn, \u0027has_min_version\u0027, return_value\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9NVs%3D","line":749,"updated":"2013-12-14 02:33:07.000000000","message":"There\u0027s no need to check that VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES doesn\u0027t exist, doing a setattr on an existing name doesn\u0027t cause a problem.  (One of my programming mantras is `never use an if statement when it\u0027s not needed, it just makes the code more complex\u0027.)","commit_id":"46e27935d73d49eaadca758642570df502422591"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"49b8c489da2de57ebf2653f5f567b198a7d96f3b","unresolved":false,"context_lines":[{"line_number":743,"context_line":""},{"line_number":744,"context_line":"    def test_cpu_features_bug_1217630(self):"},{"line_number":745,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":746,"context_line":"        instance_ref \u003d db.instance_create(self.context, self.test_instance)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"        # Test old version of libvirt, it shouldn\u0027t see the `aes\u0027 feature"},{"line_number":749,"context_line":"        caps \u003d conn.get_host_capabilities()"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F86vU%3D","side":"PARENT","line":746,"updated":"2013-12-18 20:16:54.000000000","message":"This must have just been vestigial?  The variable isn\u0027t used here.","commit_id":"6b95e4f226d73f599f12a8c21990cfa9717e9a83"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"00af7518a0aef0c333c0924cdd0e07023ad54a69","unresolved":false,"context_lines":[{"line_number":743,"context_line":""},{"line_number":744,"context_line":"    def test_cpu_features_bug_1217630(self):"},{"line_number":745,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"},{"line_number":746,"context_line":"        instance_ref \u003d db.instance_create(self.context, self.test_instance)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"        # Test old version of libvirt, it shouldn\u0027t see the `aes\u0027 feature"},{"line_number":749,"context_line":"        caps \u003d conn.get_host_capabilities()"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F85jQ%3D","side":"PARENT","line":746,"in_reply_to":"AAAATn%2F86vU%3D","updated":"2013-12-19 01:33:36.000000000","message":"right, so I removed it.","commit_id":"6b95e4f226d73f599f12a8c21990cfa9717e9a83"},{"author":{"_account_id":6593,"name":"Dirk Mueller","email":"dirk@dmllr.de","username":"dmllr"},"change_message_id":"4d53b7270431c0eff7eac42a9e5f9251dc3974f7","unresolved":false,"context_lines":[{"line_number":762,"context_line":"        with mock.patch.object(conn._conn, \u0027baselineCPU\u0027, return_value\u003d-1):"},{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F8vb8%3D","line":765,"updated":"2013-12-20 20:10:30.000000000","message":"This is modifying the global libvirt object, which is not fully mocked, so it has influence on latter tests. I\u0027ve just spent a few hours on fixing it here https://review.openstack.org/#/c/63159/","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"c893e79424edcd47439090b2d34e649421d5fb4c","unresolved":false,"context_lines":[{"line_number":762,"context_line":"        with mock.patch.object(conn._conn, \u0027baselineCPU\u0027, return_value\u003d-1):"},{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F8oX4%3D","line":765,"in_reply_to":"AAAATn%2F8vb8%3D","updated":"2013-12-24 01:48:04.000000000","message":"Yes, I like your change, I will +1 following Matt.","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"49b8c489da2de57ebf2653f5f567b198a7d96f3b","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F86t4%3D","line":766,"updated":"2013-12-18 20:16:54.000000000","message":"This isn\u0027t really testing what happens when baselineCPU returns -1 right?  I mean, isn\u0027t caps coming back from get_host_capabilities() going to always be a LibvirtConfigCaps object?  The thing to check is that caps.host.cpu is not set, right?","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"89616d7e886a004382e74ee059e19bb7fbbfca0f","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F8z%2B4%3D","line":766,"in_reply_to":"AAAATn%2F821E%3D","updated":"2013-12-20 02:37:12.000000000","message":"I think if this self.assertFalse(hasattr(caps.host, \u0027cpu\u0027)) assertion is added, this test case will go to failed, you can check the self._caps.parse_str(xmlstr) process and the fake method of getCapabilities(), the faked getCapabilities() method will return a host info includes cpu info like \u0027\u0027\u0027\u003chost\u003e\u003ccpu\u003e\u003carch\u003ex86_64\u003c/arch\u003e\u003c/cpu\u003e\u003c/host\u003e\u0027\u0027\u0027, and parse_str(xmlstr) will parse this capability includes host\u0026cpu info, the processes are in virt/libvirt/config.py,  sequentially run the parse_dom() methods in LibvirtConfigObject-\u003eLibvirtConfigCaps-\u003eLibvirtConfigCapsHost-\u003eLibvirtConfigCPU, then the caps.host.cpu is added, and it has arch, features, vendor, and other attributes. So your assertion is failed eventually.\nIf I\u0027m wrong, welcome to correct me.","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"82356b8231697e361f2618c7a0f5f7faf64b785e","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F821E%3D","line":766,"in_reply_to":"AAAATn%2F85KU%3D","updated":"2013-12-19 14:39:18.000000000","message":"Yes, I completely understand that.  My point is that on line 2741 of the driver code the caps object is created a vconfig.LibvirtConfigCaps type so as long as you get that far, this test is always going to pass because all you\u0027re checking is the type of the caps variable.  That is a weak test since it\u0027s not testing what you just described, which is that caps wouldn\u0027t have host.cpu set because you\u0027re returning -1 for conn.baselineCPU.\n\nIn other words, change your assertion to this:\n\nself.assertFalse(hasattr(caps.host, \u0027cpu\u0027))","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"ab4b7af84543912fcc02267febaa7e45f17c8f42","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F85KU%3D","line":766,"in_reply_to":"AAAATn%2F85Pc%3D","updated":"2013-12-19 03:40:08.000000000","message":"parse_str() method only supports string type, so we should make sure features !\u003d -1, and if feature \u003d\u003d -1, it means that no baseline cpu info is returned, the parsing cpu features code should not be called, otherwise a ValueError will be raised and the compute process will exits unexpected. this change fixes the bug by ignoring the parse_str(-1) sitituation occurs, and the test is also make sure the sitituation does not occur and the get_host_cap() method runs correctly with LibvirtConfigCaps type value returned.\nIn other words, self._caps.host.cpu.parse_str(features) should not be called if baselineCPU() return -1 or None.","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e0105d755ac673f83133abb4d3e75dc2a0b84f29","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F85Pc%3D","line":766,"in_reply_to":"AAAATn%2F85hs%3D","updated":"2013-12-19 03:08:02.000000000","message":"If it returns -1 your condition fails and the code never calls:\n\nself._caps.host.cpu.parse_str(features)\n\nSo no, I don\u0027t think the test is valid, unless I\u0027m still not understanding this.","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"00af7518a0aef0c333c0924cdd0e07023ad54a69","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F85hs%3D","line":766,"in_reply_to":"AAAATn%2F86t4%3D","updated":"2013-12-19 01:33:36.000000000","message":"if  baselineCPU returns -1, the parse_str(features) will raise an ValueError exception, not a LibvirtConfigCaps type value unless the -1 checking is added, isn\u0027t it? so I believe this test is valid.","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"c893e79424edcd47439090b2d34e649421d5fb4c","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F8oXs%3D","line":766,"in_reply_to":"AAAATn%2F8qpI%3D","updated":"2013-12-24 01:48:04.000000000","message":"Ok, we understand now, I will change it, thanks for your example codes.","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"994b2cb5498f1b595f5ce82ddc96f724806072e5","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F8qpI%3D","line":766,"in_reply_to":"AAAATn%2F8sk8%3D","updated":"2013-12-23 13:57:01.000000000","message":"Now I see that when it\u0027s parsing the original xml before feature expansion it sets the host.cpu so my test wouldn\u0027t work, but this does:\n\nhttp://paste.openstack.org/show/56356/\n\nBasically it\u0027s just checking that the fake \u0027aes\u0027 feature isn\u0027t set since baselineCPU returns -1, which is the reverse of the test just before it.","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":6463,"name":"Jackie","email":"guanqiang85@gmail.com","username":"hzguanqiang"},"change_message_id":"245400ecc7315efd82d40d8af23ade96d59a6617","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F8sk8%3D","line":766,"in_reply_to":"AAAATn%2F8w6Y%3D","updated":"2013-12-23 02:37:52.000000000","message":"Hi, Matt. We\u0027ve tried what you suggested. Simply changing the assertion to \"self.assertFalse(hasattr(caps.host, \u0027cpu\u0027))\" will certainly be failed from code logical. I wonder if you mean to mox the getCapability return value with no cpuinfo at all? If I misunderstand your meaning, Can you add some test codes for example? Thanks.","commit_id":"3afa01611923168da349aa542a2b39301840c414"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1718d49694aed4393cfc9de9c4ecfbfd74269854","unresolved":false,"context_lines":[{"line_number":763,"context_line":"            setattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027, 1)"},{"line_number":764,"context_line":"            caps \u003d conn.get_host_capabilities()"},{"line_number":765,"context_line":"            delattr(libvirt, \u0027VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES\u0027)"},{"line_number":766,"context_line":"            self.assertEqual(vconfig.LibvirtConfigCaps, type(caps))"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def test_get_guest_config(self):"},{"line_number":769,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F8w6Y%3D","line":766,"in_reply_to":"AAAATn%2F8z%2B4%3D","updated":"2013-12-20 15:09:02.000000000","message":"Did you even try what I suggested?  I don\u0027t know why we are going back and forth on this so much, please try what I suggested.  Right now this is a weak test.  I don\u0027t know why you keep bringing up the call to the parse_str method because given your mock to return -1 from baselineCPU and the condition in the driver code, parse_str should never be called.  If that\u0027s not the case and there is something preventing that with how the tests are setup, that seems extremely counter-intuitive and fragile to me.  In fact, since you\u0027re adding the -1 condition to prevent parse_str(-1) from being called, if it does get called and the assertion fails, the test is catching exactly the case we are fixing here and is a good test - it avoids regression.","commit_id":"3afa01611923168da349aa542a2b39301840c414"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4dec1663d4a714a8c5bcbe04d62ed84001b9e516","unresolved":false,"context_lines":[{"line_number":2734,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2735,"context_line":"                        [self._caps.host.cpu.to_xml()],"},{"line_number":2736,"context_line":"                        libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)"},{"line_number":2737,"context_line":"                    if features and features !\u003d -1:"},{"line_number":2738,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2739,"context_line":"                        self._caps.host.cpu.parse_str(features)"},{"line_number":2740,"context_line":"                except libvirt.VIR_ERR_NO_SUPPORT:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9erw%3D","line":2737,"updated":"2013-12-11 03:36:24.000000000","message":"Is it a string or an int?  Line 2739 suggests it\u0027s a string.","commit_id":"10a2a709eb28d117aad4893ab473b9246a583ca2"},{"author":{"_account_id":6463,"name":"Jackie","email":"guanqiang85@gmail.com","username":"hzguanqiang"},"change_message_id":"0a02b9b601f80951243883952b1c5c6775c788c5","unresolved":false,"context_lines":[{"line_number":2734,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2735,"context_line":"                        [self._caps.host.cpu.to_xml()],"},{"line_number":2736,"context_line":"                        libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)"},{"line_number":2737,"context_line":"                    if features and features !\u003d -1:"},{"line_number":2738,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2739,"context_line":"                        self._caps.host.cpu.parse_str(features)"},{"line_number":2740,"context_line":"                except libvirt.VIR_ERR_NO_SUPPORT:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9eqA%3D","line":2737,"in_reply_to":"AAAATn%2F9erw%3D","updated":"2013-12-11 03:44:32.000000000","message":"I read code in libvirt python library, It will return -1 in this case.\nFunction Details:\nstatic PyObject *                                                                   \nlibvirt_virConnectBaselineCPU(PyObject *self ATTRIBUTE_UNUSED,                      \n                              PyObject *args) {                                     \n    PyObject *pyobj_conn;                                                           \n    PyObject *list;                                                                 \n    virConnectPtr conn;                                                             \n    unsigned int flags;                                                             \n    const char **xmlcpus \u003d NULL;                                                    \n    int ncpus \u003d 0;                                                                  \n    char *base_cpu;                                                                 \n    PyObject *pybase_cpu;                                                           \n                                                                                    \n    if (!PyArg_ParseTuple(args, (char *)\"OOi:virConnectBaselineCPU\",                \n                          \u0026pyobj_conn, \u0026list, \u0026flags))                              \n        return NULL;                                                                \n    conn \u003d (virConnectPtr) PyvirConnect_Get(pyobj_conn);                            \n                                                                                    \n    if (PyList_Check(list)) {                                                       \n        size_t i;                                                                   \n                                                                                    \n        ncpus \u003d PyList_Size(list);                                                  \n        if (VIR_ALLOC_N_QUIET(xmlcpus, ncpus) \u003c 0)                                  \n            return VIR_PY_INT_FAIL;                                                 \n                                                                                    \n        for (i \u003d 0; i \u003c ncpus; i++) {                                               \n            xmlcpus[i] \u003d PyString_AsString(PyList_GetItem(list, i));                \n            if (xmlcpus[i] \u003d\u003d NULL) {                                               \n                VIR_FREE(xmlcpus);                                                  \n                return VIR_PY_INT_FAIL;                                             \n            }                                                                       \n        }                                                                           \n    }                                                                               \n                                                                                    \n    LIBVIRT_BEGIN_ALLOW_THREADS;                                                    \n    base_cpu \u003d virConnectBaselineCPU(conn, xmlcpus, ncpus, flags);                  \n    LIBVIRT_END_ALLOW_THREADS;                                                      \n                                                                                    \n    VIR_FREE(xmlcpus);                                                              \n                                                                                    \n    if (base_cpu \u003d\u003d NULL)                                                           \n        return VIR_PY_INT_FAIL;                                                     \n                                                                                    \n    pybase_cpu \u003d PyString_FromString(base_cpu);                                     \n    VIR_FREE(base_cpu);                                                             \n                                                                                    \n    if (pybase_cpu \u003d\u003d NULL)                                                         \n        return VIR_PY_INT_FAIL;                                                     \n                                                                                    \n    return pybase_cpu;                                                              \n\n#define VIR_PY_INT_FAIL (libvirt_intWrap(-1))","commit_id":"10a2a709eb28d117aad4893ab473b9246a583ca2"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"eb91e1781797a462c3a4d5e2efb56873deb0d19f","unresolved":false,"context_lines":[{"line_number":2738,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2739,"context_line":"                        [self._caps.host.cpu.to_xml()],"},{"line_number":2740,"context_line":"                        libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)"},{"line_number":2741,"context_line":"                    if features and isinstance(features, str):"},{"line_number":2742,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2743,"context_line":"                        self._caps.host.cpu.parse_str(features)"},{"line_number":2744,"context_line":"                except libvirt.VIR_ERR_NO_SUPPORT:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9dh8%3D","line":2741,"updated":"2013-12-11 09:21:52.000000000","message":"we should use six.string_types for compatibility of py3","commit_id":"87365130329eac7cfa05dbe804b5238eba2948fe"},{"author":{"_account_id":1981,"name":"Don Dugger","email":"n0ano@n0ano.com","username":"n0ano"},"change_message_id":"0f23f2df4ecfc2758083d790746934b4a99d0c9c","unresolved":false,"context_lines":[{"line_number":2739,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2740,"context_line":"                        [self._caps.host.cpu.to_xml()],"},{"line_number":2741,"context_line":"                        libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)"},{"line_number":2742,"context_line":"                    if features and isinstance(features, six.string_types):"},{"line_number":2743,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2744,"context_line":"                        self._caps.host.cpu.parse_str(features)"},{"line_number":2745,"context_line":"                except libvirt.VIR_ERR_NO_SUPPORT:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9bMc%3D","line":2742,"updated":"2013-12-11 16:59:42.000000000","message":"Assuming we decide to check for this issue wouldn\u0027t it be simpler to just use:\n\n    if features and (features !\u003d -1):","commit_id":"112c9a5eec95fa9261d39804966471c191469e63"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"138480a3cfd33a7c24e221e31e29af1b7974b9e4","unresolved":false,"context_lines":[{"line_number":2739,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2740,"context_line":"                        [self._caps.host.cpu.to_xml()],"},{"line_number":2741,"context_line":"                        libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)"},{"line_number":2742,"context_line":"                    if features and isinstance(features, six.string_types):"},{"line_number":2743,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2744,"context_line":"                        self._caps.host.cpu.parse_str(features)"},{"line_number":2745,"context_line":"                except libvirt.VIR_ERR_NO_SUPPORT:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F9XF8%3D","line":2742,"in_reply_to":"AAAATn%2F9bMc%3D","updated":"2013-12-12 09:13:56.000000000","message":"I think make sure the `feature` is string type may be better, because the parse_str() only supports parsing string type.","commit_id":"112c9a5eec95fa9261d39804966471c191469e63"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7b339ea3635776aaf8aa26edf8d4c918d00d0a6a","unresolved":false,"context_lines":[{"line_number":2729,"context_line":"                try:"},{"line_number":2730,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2731,"context_line":"                        [self._caps.host.cpu.to_xml()],"},{"line_number":2732,"context_line":"                        libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)"},{"line_number":2733,"context_line":"                    if features and isinstance(features, six.string_types):"},{"line_number":2734,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2735,"context_line":"                        self._caps.host.cpu.parse_str(features)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9V7g%3D","line":2732,"updated":"2013-12-12 13:35:47.000000000","message":"Another thought / compromise here is we add a TODO in the code here that says remove the string type check once nova requires at least libvirt version 1.2.0?  Then someone can clean this up later when we\u0027re using a version with the fix in it.","commit_id":"0c93a4a93e956e24be8952c7c668bd121f760a07"},{"author":{"_account_id":1981,"name":"Don Dugger","email":"n0ano@n0ano.com","username":"n0ano"},"change_message_id":"dfe269b8edfea1d204fc4f3bc990ae11cf34dd0e","unresolved":false,"context_lines":[{"line_number":2729,"context_line":"                try:"},{"line_number":2730,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2731,"context_line":"                        [self._caps.host.cpu.to_xml()],"},{"line_number":2732,"context_line":"                        libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)"},{"line_number":2733,"context_line":"                    if features and isinstance(features, six.string_types):"},{"line_number":2734,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2735,"context_line":"                        self._caps.host.cpu.parse_str(features)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9UEs%3D","line":2732,"in_reply_to":"AAAATn%2F9V7g%3D","updated":"2013-12-12 18:48:43.000000000","message":"Not happy with this (I predict the code cleanup will never happen and import will remain behind as an orphan) but if we must address the problem in OpenStack I guess this is the best we can do.","commit_id":"0c93a4a93e956e24be8952c7c668bd121f760a07"},{"author":{"_account_id":1981,"name":"Don Dugger","email":"n0ano@n0ano.com","username":"n0ano"},"change_message_id":"dfe269b8edfea1d204fc4f3bc990ae11cf34dd0e","unresolved":false,"context_lines":[{"line_number":2730,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2731,"context_line":"                        [self._caps.host.cpu.to_xml()],"},{"line_number":2732,"context_line":"                        libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)"},{"line_number":2733,"context_line":"                    if features and isinstance(features, six.string_types):"},{"line_number":2734,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2735,"context_line":"                        self._caps.host.cpu.parse_str(features)"},{"line_number":2736,"context_line":"                except libvirt.VIR_ERR_NO_SUPPORT:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9UEY%3D","line":2733,"updated":"2013-12-12 18:48:43.000000000","message":"Agan, why not just check for -1 (obviating the need for the import)","commit_id":"0c93a4a93e956e24be8952c7c668bd121f760a07"},{"author":{"_account_id":1981,"name":"Don Dugger","email":"n0ano@n0ano.com","username":"n0ano"},"change_message_id":"54c08b9d9e7b1256934b4ebca21de5fa14ac8b51","unresolved":false,"context_lines":[{"line_number":333,"context_line":"# BlockJobInfo management requirement"},{"line_number":334,"context_line":"MIN_LIBVIRT_BLOCKJOBINFO_VERSION \u003d (1, 1, 1)"},{"line_number":335,"context_line":"# VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES flag requirement"},{"line_number":336,"context_line":"MIN_LIBVIRT_BASELINECPU_EXPAND_FEATURES_VERSION \u003d (1, 1, 2)"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"def libvirt_error_handler(context, err):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9NXo%3D","line":336,"updated":"2013-12-14 02:33:07.000000000","message":"Just make the minimum version 1.2.0 and then there is no need to check for a -1 return code from libvirt","commit_id":"46e27935d73d49eaadca758642570df502422591"},{"author":{"_account_id":1981,"name":"Don Dugger","email":"n0ano@n0ano.com","username":"n0ano"},"change_message_id":"54c08b9d9e7b1256934b4ebca21de5fa14ac8b51","unresolved":false,"context_lines":[{"line_number":2732,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2733,"context_line":"                        [self._caps.host.cpu.to_xml()],"},{"line_number":2734,"context_line":"                        libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)"},{"line_number":2735,"context_line":"                    if features and features !\u003d -1:"},{"line_number":2736,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2737,"context_line":"                        self._caps.host.cpu.parse_str(features)"},{"line_number":2738,"context_line":"                except libvirt.VIR_ERR_NO_SUPPORT:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9NXg%3D","line":2735,"updated":"2013-12-14 02:33:07.000000000","message":"With the appropriate minimum version there\u0027s no need for this change.","commit_id":"46e27935d73d49eaadca758642570df502422591"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"2c0b791ebb1fb437ec42b641478c55213ec9c6d9","unresolved":false,"context_lines":[{"line_number":2743,"context_line":"            self._caps \u003d vconfig.LibvirtConfigCaps()"},{"line_number":2744,"context_line":"            self._caps.parse_str(xmlstr)"},{"line_number":2745,"context_line":"            if self.has_min_version("},{"line_number":2746,"context_line":"                        MIN_LIBVIRT_BASELINECPU_EXPAND_FEATURES_VERSION):"},{"line_number":2747,"context_line":"                try:"},{"line_number":2748,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2749,"context_line":"                        [self._caps.host.cpu.to_xml()],"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F9Jgo%3D","line":2746,"updated":"2013-12-16 10:08:53.000000000","message":"This is bad practice. We only aim to use version number checks if we can\u0027t do a functional change. Checking for the constant existing is a preferable approach here. In addition your version number earlier is wrong - this constant appeared in v1.1.2. We are perfectly well able to work with this version of libvirt so should not mandate 1.2.0 just so we can be lazy in handling the error later.\n\nPlease put this check back to using hasattr(), and handle the \u0027-1\u0027 features return value as you had in earlier patches.","commit_id":"2f7feca34f4c4b5389a80c8a239f972d05ed33e4"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"7f4a1d621f14d991ced22602c64b377082d06664","unresolved":false,"context_lines":[{"line_number":2743,"context_line":"            self._caps \u003d vconfig.LibvirtConfigCaps()"},{"line_number":2744,"context_line":"            self._caps.parse_str(xmlstr)"},{"line_number":2745,"context_line":"            if self.has_min_version("},{"line_number":2746,"context_line":"                        MIN_LIBVIRT_BASELINECPU_EXPAND_FEATURES_VERSION):"},{"line_number":2747,"context_line":"                try:"},{"line_number":2748,"context_line":"                    features \u003d self._conn.baselineCPU("},{"line_number":2749,"context_line":"                        [self._caps.host.cpu.to_xml()],"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAATn%2F9Ezk%3D","line":2746,"in_reply_to":"AAAATn%2F9Jgo%3D","updated":"2013-12-17 01:58:02.000000000","message":"yes, I agree with you, I will change it.","commit_id":"2f7feca34f4c4b5389a80c8a239f972d05ed33e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f429cf6677f862943ba3d8a477f6c302ac717d23","unresolved":false,"context_lines":[{"line_number":2757,"context_line":"                    if features and features !\u003d -1:"},{"line_number":2758,"context_line":"                        self._caps.host.cpu \u003d vconfig.LibvirtConfigCPU()"},{"line_number":2759,"context_line":"                        self._caps.host.cpu.parse_str(features)"},{"line_number":2760,"context_line":"                except libvirt.VIR_ERR_NO_SUPPORT:"},{"line_number":2761,"context_line":"                    # Note(yjiang5): ignore if libvirt has no support"},{"line_number":2762,"context_line":"                    pass"},{"line_number":2763,"context_line":"        return self._caps"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAT3%2F%2FvPM%3D","line":2760,"updated":"2014-01-02 16:39:50.000000000","message":"So is Dirk\u0027s patch going to be used to catch libvirt.libvirtError here?","commit_id":"5228d01bcde531cc2c141f38a150dbb2daef1c07"}]}
