)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"add75ad49ba15a9dd18fc82156547f9870b8e36f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"virt: introduce libosinfo library to set hardware policy"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introducing a new library to retrieve information from libosinfo database."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Libosinfo database provides information about an optimal hardware configuration"},{"line_number":12,"context_line":"for the guest instances, based on their Operating Systems."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"9a41bdd9_01184f83","line":9,"updated":"2015-07-18 12:47:13.000000000","message":"this is libvirt specific so why is the directory not under libvirt (maybe I am missing something here)","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"52b02ec3cb4f128538700c8bf784899dd91285b1","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"virt: introduce libosinfo library to set hardware policy"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introducing a new library to retrieve information from libosinfo database."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Libosinfo database provides information about an optimal hardware configuration"},{"line_number":12,"context_line":"for the guest instances, based on their Operating Systems."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"3a50d1a3_b59c7d6a","line":9,"in_reply_to":"9a41bdd9_01184f83","updated":"2015-07-20 09:06:08.000000000","message":"The libosinfo library has no tie to libvirt, it is possible for other drivers to use it too.","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"}],"nova/exception.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"699dffc106579bca32db6c432d04246cc192bbf4","unresolved":false,"context_lines":[{"line_number":1829,"context_line":"                \"pinned set %(pinned)s\")"},{"line_number":1830,"context_line":""},{"line_number":1831,"context_line":""},{"line_number":1832,"context_line":"class OsInfoNotFound(NotFound):"},{"line_number":1833,"context_line":"    msg_fmt \u003d _(\"No configuration information found for operating system \""},{"line_number":1834,"context_line":"                \"%(os_name)s\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_9319ae7b","line":1832,"updated":"2015-01-23 15:19:24.000000000","message":"why do we need libvirt exceptions here. would it not be better to define this in the libvirt module?","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"}],"nova/tests/unit/virt/libvirt/test_osinfo.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"699dffc106579bca32db6c432d04246cc192bbf4","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Red Hat, Inc"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_d32a567d","line":1,"updated":"2015-01-23 15:19:24.000000000","message":"15?","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"18054a95b2bb4bdda9e2f08bd39facc9df40d172","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Red Hat, Inc"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_6e78d9f2","line":1,"in_reply_to":"1a930d6b_d32a567d","updated":"2015-01-23 15:31:58.000000000","message":":) indeed.","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"699dffc106579bca32db6c432d04246cc192bbf4","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    def test_get_cached_os_info(self):"},{"line_number":30,"context_line":"        self.osinfo_obj.network_model \u003d \u0027virtio_1\u0027"},{"line_number":31,"context_line":"        self.osinfo_obj.disk_bus \u003d \u0027virtio_1\u0027"},{"line_number":32,"context_line":"        with mock.patch.object(osinfo.OsInfoConnection, \u0027get_instance\u0027), \\"},{"line_number":33,"context_line":"             mock.patch.object(osinfo.OsInfo, \u0027get_os_info\u0027) as osinfo_mock:"},{"line_number":34,"context_line":"            osinfo_mock.return_value \u003d self.osinfo_obj"},{"line_number":35,"context_line":"            osinfo_obj \u003d osinfo.get_cached_os_info(\u0027fed22\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_1373feb1","line":32,"updated":"2015-01-23 15:19:24.000000000","message":"please use () instead of the \\","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"699dffc106579bca32db6c432d04246cc192bbf4","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        osinfo.libosinfo \u003d mock.Mock()"},{"line_number":67,"context_line":"        osinfo.libosinfo.Filter.return_value.new.return_value \u003d filter_mock"},{"line_number":68,"context_line":"        osinfo_mock \u003d mock.Mock()"},{"line_number":69,"context_line":"        osinfo_mock.oslist.new_filtered.return_value \\"},{"line_number":70,"context_line":"                          .get_length.return_value \u003d 0"},{"line_number":71,"context_line":"        with mock.patch.object(osinfo.OsInfoConnection,"},{"line_number":72,"context_line":"                               \u0027get_instance\u0027, return_value\u003dosinfo_mock):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_33b0fa42","line":69,"updated":"2015-01-23 15:19:24.000000000","message":"any way of writing this without the \\","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"18054a95b2bb4bdda9e2f08bd39facc9df40d172","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        osinfo.libosinfo \u003d mock.Mock()"},{"line_number":67,"context_line":"        osinfo.libosinfo.Filter.return_value.new.return_value \u003d filter_mock"},{"line_number":68,"context_line":"        osinfo_mock \u003d mock.Mock()"},{"line_number":69,"context_line":"        osinfo_mock.oslist.new_filtered.return_value \\"},{"line_number":70,"context_line":"                          .get_length.return_value \u003d 0"},{"line_number":71,"context_line":"        with mock.patch.object(osinfo.OsInfoConnection,"},{"line_number":72,"context_line":"                               \u0027get_instance\u0027, return_value\u003dosinfo_mock):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_2e6ed12f","line":69,"in_reply_to":"1a930d6b_33b0fa42","updated":"2015-01-23 15:31:58.000000000","message":"Thanks Gary. Actually I didn\u0027t manage to make it work with ().\nFor some reason \"with\" only works when it written\n\nwith A, B:\n    something\n\nWhen I tried it\nwith (A, B):\n    something\n\nit complained about a missing __exit__ method","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"},{"author":{"_account_id":7055,"name":"Tapio Tallgren","username":"tapiotallgren","inactive":true},"change_message_id":"eddebf98939d1c29933191e95df0c0b5ee702801","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        osinfo.libosinfo \u003d mock.Mock()"},{"line_number":59,"context_line":"        osinfo.libosinfo.Filter.return_value.new.return_value \u003d filter_mock"},{"line_number":60,"context_line":"        osinfo_mock \u003d mock.Mock()"},{"line_number":61,"context_line":"        filltered_list \u003d osinfo_mock.new_filtered"},{"line_number":62,"context_line":"        filltered_list.return_value.get_length.return_value \u003d 1"},{"line_number":63,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":64,"context_line":"        os_info_db.oslist \u003d osinfo_mock"}],"source_content_type":"text/x-python","patch_set":6,"id":"dac4157f_4c54fffd","line":61,"updated":"2015-04-22 13:51:45.000000000","message":"Misspelled?","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"80c01cf0fbbb6a6e2f0dba982f5b02d7d61977fe","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        osinfo.libosinfo \u003d mock.Mock()"},{"line_number":59,"context_line":"        osinfo.libosinfo.Filter.return_value.new.return_value \u003d filter_mock"},{"line_number":60,"context_line":"        osinfo_mock \u003d mock.Mock()"},{"line_number":61,"context_line":"        filltered_list \u003d osinfo_mock.new_filtered"},{"line_number":62,"context_line":"        filltered_list.return_value.get_length.return_value \u003d 1"},{"line_number":63,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":64,"context_line":"        os_info_db.oslist \u003d osinfo_mock"}],"source_content_type":"text/x-python","patch_set":6,"id":"dac4157f_5854b9fd","line":61,"in_reply_to":"dac4157f_4c54fffd","updated":"2015-04-22 15:21:38.000000000","message":"Yeah.. :)","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"},{"author":{"_account_id":7055,"name":"Tapio Tallgren","username":"tapiotallgren","inactive":true},"change_message_id":"d3ed20e2c43ee554643abe41bacf220668df9f00","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        osinfo.libosinfo \u003d mock.Mock()"},{"line_number":59,"context_line":"        osinfo.libosinfo.Filter.return_value.new.return_value \u003d filter_mock"},{"line_number":60,"context_line":"        osinfo_mock \u003d mock.Mock()"},{"line_number":61,"context_line":"        filltered_list \u003d osinfo_mock.new_filtered"},{"line_number":62,"context_line":"        filltered_list.return_value.get_length.return_value \u003d 1"},{"line_number":63,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":64,"context_line":"        os_info_db.oslist \u003d osinfo_mock"}],"source_content_type":"text/x-python","patch_set":6,"id":"bab921fb_1658b7f9","line":61,"in_reply_to":"dac4157f_5854b9fd","updated":"2015-04-23 10:27:11.000000000","message":"Done","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"},{"author":{"_account_id":7055,"name":"Tapio Tallgren","username":"tapiotallgren","inactive":true},"change_message_id":"eddebf98939d1c29933191e95df0c0b5ee702801","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":64,"context_line":"        os_info_db.oslist \u003d osinfo_mock"},{"line_number":65,"context_line":"        filter_mock.add_constraint.side_effect \u003d assert_field"},{"line_number":66,"context_line":"        os_info_db._find_os(\u0027test33\u0027)"},{"line_number":67,"context_line":"        self.assertTrue(filltered_list.return_value.get_nth.called)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_find_os_fails(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"dac4157f_4ce4ffdf","line":66,"updated":"2015-04-22 13:51:45.000000000","message":"Why are we trying to find \u0027test33\u0027 since it does not exist in the mock cached db? Is this supposed to be a positive test and the next one the negative test?","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"80c01cf0fbbb6a6e2f0dba982f5b02d7d61977fe","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":64,"context_line":"        os_info_db.oslist \u003d osinfo_mock"},{"line_number":65,"context_line":"        filter_mock.add_constraint.side_effect \u003d assert_field"},{"line_number":66,"context_line":"        os_info_db._find_os(\u0027test33\u0027)"},{"line_number":67,"context_line":"        self.assertTrue(filltered_list.return_value.get_nth.called)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_find_os_fails(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"dac4157f_583ef98c","line":66,"in_reply_to":"dac4157f_4ce4ffdf","updated":"2015-04-22 15:21:38.000000000","message":"Well, this is actually validating that if a non-existing OS name is being searched, we will actually go to the database and get the data from there, as well as, makes sure that the method is working as expected. (Next line)","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"},{"author":{"_account_id":7055,"name":"Tapio Tallgren","username":"tapiotallgren","inactive":true},"change_message_id":"d3ed20e2c43ee554643abe41bacf220668df9f00","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":64,"context_line":"        os_info_db.oslist \u003d osinfo_mock"},{"line_number":65,"context_line":"        filter_mock.add_constraint.side_effect \u003d assert_field"},{"line_number":66,"context_line":"        os_info_db._find_os(\u0027test33\u0027)"},{"line_number":67,"context_line":"        self.assertTrue(filltered_list.return_value.get_nth.called)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_find_os_fails(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"bab921fb_b66fcb91","line":66,"in_reply_to":"dac4157f_583ef98c","updated":"2015-04-23 10:27:11.000000000","message":"Done","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"}],"nova/tests/unit/virt/test_osinfo.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"ddef5f2c8fec75dfa21ff3d97db7adfebec12148","unresolved":false,"context_lines":[{"line_number":32,"context_line":"            mock.patch.object(osinfo.OsInfoOs, \u0027_get_network_model\u0027),"},{"line_number":33,"context_line":"            mock.patch.object(osinfo.OsInfoOs, \u0027_get_disk_model\u0027),"},{"line_number":34,"context_line":"            mock.patch.object(osinfo.OsInfoDatabase, \u0027get_instance\u0027)) as ("},{"line_number":35,"context_line":"            nm_mock, dm_mock, inst_mock):"},{"line_number":36,"context_line":"            # Initialize an empty object and store in cache"},{"line_number":37,"context_line":"            os_obj_mock \u003d osinfo.OsInfoOs()"},{"line_number":38,"context_line":"            os_obj_mock.network_model \u003d \u0027virtio_1\u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"3afb71cf_977af975","line":35,"updated":"2015-06-09 16:54:45.000000000","message":"Can you use\n\n@mock.patch.object(osinfo.OsInfoOs, \"_get_network_model\")\n\ndecorator on the method instead - it avoids having further nest the body. Likewise for the other tests.","commit_id":"57f7c5933dff47b4b55216979cb3fcb9de05bdf1"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"4d81749ab9f32424a193ae86c96f9d040b337a57","unresolved":false,"context_lines":[{"line_number":32,"context_line":"            mock.patch.object(osinfo.OsInfoOs, \u0027_get_network_model\u0027),"},{"line_number":33,"context_line":"            mock.patch.object(osinfo.OsInfoOs, \u0027_get_disk_model\u0027),"},{"line_number":34,"context_line":"            mock.patch.object(osinfo.OsInfoDatabase, \u0027get_instance\u0027)) as ("},{"line_number":35,"context_line":"            nm_mock, dm_mock, inst_mock):"},{"line_number":36,"context_line":"            # Initialize an empty object and store in cache"},{"line_number":37,"context_line":"            os_obj_mock \u003d osinfo.OsInfoOs()"},{"line_number":38,"context_line":"            os_obj_mock.network_model \u003d \u0027virtio_1\u0027"}],"source_content_type":"text/x-python","patch_set":12,"id":"3afb71cf_5e2ec743","line":35,"in_reply_to":"3afb71cf_977af975","updated":"2015-06-10 03:07:39.000000000","message":"Done","commit_id":"57f7c5933dff47b4b55216979cb3fcb9de05bdf1"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"d552f8c5b20064aa5687e5e0d83895e053c4033d","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"# under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import contextlib"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import mock"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3afb71cf_d4d3b302","line":15,"updated":"2015-06-10 06:31:41.000000000","message":"./nova/tests/unit/virt/test_osinfo.py:15:1: F401 \u0027contextlib\u0027 imported but unused - The failure seems to be real. I\u0027m waiting for your update. thanks","commit_id":"87039acaea2d3d0e0945fe4e2bb85682201ecabd"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"33419e9b2bac222fe45386577c329e6dd045717a","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def test_get_os(self):"},{"line_number":29,"context_line":"        def assert_field(cls, key, val):"},{"line_number":30,"context_line":"            self.assertEqual(key, \u0027short-id\u0027)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        filter_mock \u003d mock.Mock()"},{"line_number":33,"context_line":"        osinfo.libosinfo \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_c7ca651a","line":30,"updated":"2015-06-23 06:16:04.000000000","message":"assertEqual should be (expected, actual)","commit_id":"6912b9f421a3097c40478d8829287eeb84875815"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0186b65dd84a416dc614e2b421cf6b75114ad397","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        osinfo.libosinfo \u003d mock.Mock()"},{"line_number":34,"context_line":"        osinfo.libosinfo.Filter.return_value.new.return_value \u003d filter_mock"},{"line_number":35,"context_line":"        osinfo_mock \u003d mock.Mock()"},{"line_number":36,"context_line":"        filltered_list \u003d osinfo_mock.new_filtered"},{"line_number":37,"context_line":"        filltered_list.return_value.get_length.return_value \u003d 1"},{"line_number":38,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":39,"context_line":"        os_info_db.oslist \u003d osinfo_mock"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a41bdd9_a5e09d97","line":36,"updated":"2015-07-17 21:18:34.000000000","message":"s/filltered_list/filtered_list/ please :)","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"8b37097cdd0270432308d69708dea1f8b8a08f7e","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        osinfo.libosinfo \u003d mock.Mock()"},{"line_number":34,"context_line":"        osinfo.libosinfo.Filter.return_value.new.return_value \u003d filter_mock"},{"line_number":35,"context_line":"        osinfo_mock \u003d mock.Mock()"},{"line_number":36,"context_line":"        filltered_list \u003d osinfo_mock.new_filtered"},{"line_number":37,"context_line":"        filltered_list.return_value.get_length.return_value \u003d 1"},{"line_number":38,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":39,"context_line":"        os_info_db.oslist \u003d osinfo_mock"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_6abd5267","line":36,"in_reply_to":"9a41bdd9_a5e09d97","updated":"2015-07-22 19:28:56.000000000","message":"Done, thanks :)","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0186b65dd84a416dc614e2b421cf6b75114ad397","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        filltered_list.return_value.get_length.return_value \u003d 1"},{"line_number":38,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":39,"context_line":"        os_info_db.oslist \u003d osinfo_mock"},{"line_number":40,"context_line":"        filter_mock.add_constraint.side_effect \u003d assert_field"},{"line_number":41,"context_line":"        os_info_db.get_os(\u0027test33\u0027)"},{"line_number":42,"context_line":"        self.assertTrue(filltered_list.return_value.get_nth.called)"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"9a41bdd9_e5ab051d","line":40,"updated":"2015-07-17 21:18:34.000000000","message":"Instead of the overly-complicated use of the side_effect above, you could just do this below line 41:\n\n filter_mock.add_constraint.assert_called_once_with(\u0027short-id\u0027, \u0027test33\u0027)","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"8b37097cdd0270432308d69708dea1f8b8a08f7e","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        filltered_list.return_value.get_length.return_value \u003d 1"},{"line_number":38,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":39,"context_line":"        os_info_db.oslist \u003d osinfo_mock"},{"line_number":40,"context_line":"        filter_mock.add_constraint.side_effect \u003d assert_field"},{"line_number":41,"context_line":"        os_info_db.get_os(\u0027test33\u0027)"},{"line_number":42,"context_line":"        self.assertTrue(filltered_list.return_value.get_nth.called)"},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_ac601a02","line":40,"in_reply_to":"9a41bdd9_e5ab051d","updated":"2015-07-22 19:28:56.000000000","message":"Done","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"2b2c82adc8d72d8dac49d463ac917597bf482fc7","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        filtered_list.return_value.get_length.return_value \u003d 1"},{"line_number":35,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":36,"context_line":"        os_info_db.oslist \u003d osinfo_mock"},{"line_number":37,"context_line":"        os_info_db.get_os(\u0027test33\u0027)"},{"line_number":38,"context_line":"        filter_mock.add_constraint.assert_called_once_with(\u0027short-id\u0027,"},{"line_number":39,"context_line":"                                                           \u0027test33\u0027)"},{"line_number":40,"context_line":"        self.assertTrue(filtered_list.return_value.get_nth.called)"}],"source_content_type":"text/x-python","patch_set":27,"id":"fa69d971_4aee2fee","line":37,"range":{"start_line":37,"start_character":33,"end_line":37,"end_character":35},"updated":"2016-01-11 11:55:32.000000000","message":"We should be asserting something about the returned type / value I think","commit_id":"586cc4bdb1be66297a3697faabc429c5b8047d70"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"dc7f597fe169c74c15e38cc2b1c7220c58e5c54c","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        filtered_list.return_value.get_length.return_value \u003d 1"},{"line_number":35,"context_line":"        os_info_db \u003d osinfo.OsInfoDatabase.get_instance()"},{"line_number":36,"context_line":"        os_info_db.oslist \u003d osinfo_mock"},{"line_number":37,"context_line":"        os_info_db.get_os(\u0027test33\u0027)"},{"line_number":38,"context_line":"        filter_mock.add_constraint.assert_called_once_with(\u0027short-id\u0027,"},{"line_number":39,"context_line":"                                                           \u0027test33\u0027)"},{"line_number":40,"context_line":"        self.assertTrue(filtered_list.return_value.get_nth.called)"}],"source_content_type":"text/x-python","patch_set":27,"id":"fa69d971_3a7a1489","line":37,"range":{"start_line":37,"start_character":33,"end_line":37,"end_character":35},"in_reply_to":"fa69d971_4aee2fee","updated":"2016-01-11 18:38:36.000000000","message":"Yes, just not sure how to deal with it in this case..\nUnless less I\u0027ll create a fake osinfo class with all the filters, the only thing I can check is the input of the filter and the general behaviour of the code.\nWhat do you think?","commit_id":"586cc4bdb1be66297a3697faabc429c5b8047d70"}],"nova/virt/libvirt/osinfo.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"699dffc106579bca32db6c432d04246cc192bbf4","unresolved":false,"context_lines":[{"line_number":17,"context_line":"IS_LIBOSINFO_LOADED \u003d True"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"try:"},{"line_number":20,"context_line":"    from gi.repository import Libosinfo as libosinfo"},{"line_number":21,"context_line":"except ImportError:"},{"line_number":22,"context_line":"    IS_LIBOSINFO_LOADED \u003d False"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_f3f4b2f3","line":20,"updated":"2015-01-23 15:19:24.000000000","message":"do we need requirements updates for this?","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"4c9b6136f65d430837674fbf60c68a685f748b98","unresolved":false,"context_lines":[{"line_number":17,"context_line":"IS_LIBOSINFO_LOADED \u003d True"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"try:"},{"line_number":20,"context_line":"    from gi.repository import Libosinfo as libosinfo"},{"line_number":21,"context_line":"except ImportError:"},{"line_number":22,"context_line":"    IS_LIBOSINFO_LOADED \u003d False"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_4ecddd5c","line":20,"in_reply_to":"1a930d6b_f3f4b2f3","updated":"2015-01-23 15:29:10.000000000","message":"I\u0027m not entirely sure how we\u0027ll handle requirements updates.\n\nThe requirements file can list the \u0027gi.repository\u0027 requirement - part of pygoject3.\n\nThe interesting Libosinfo part though has no actual python library.  The python API is dynamically generated on the fly from metadata provided by the C library installation, so there\u0027s nothing you can list in requirements.txt for the libosinfo part.","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"2c96640286781a74133a0eaace62238c2f7fb147","unresolved":false,"context_lines":[{"line_number":17,"context_line":"IS_LIBOSINFO_LOADED \u003d True"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"try:"},{"line_number":20,"context_line":"    from gi.repository import Libosinfo as libosinfo"},{"line_number":21,"context_line":"except ImportError:"},{"line_number":22,"context_line":"    IS_LIBOSINFO_LOADED \u003d False"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_13113eac","line":20,"in_reply_to":"1a930d6b_f3f4b2f3","updated":"2015-01-23 15:24:14.000000000","message":"Yes, I will do. This is just WIP really.","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"699dffc106579bca32db6c432d04246cc192bbf4","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    IS_LIBOSINFO_LOADED \u003d False"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def memoize(f):"},{"line_number":26,"context_line":"    \"\"\"Memoization decorator to cache OsInfo objects"},{"line_number":27,"context_line":"    \"\"\""},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_33de3a6e","line":25,"updated":"2015-01-23 15:19:24.000000000","message":"i do not recall seeing any tests for this","commit_id":"595d335f1604d64d341b768f6054dc9bf1299d6b"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"846afd03f31a1ac5b901185b40e4092ab4b05f68","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    return OsObjectStore().__getitem__"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class OsInfoConnection(object):"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    _instance \u003d None"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_f5eec3ec","line":42,"updated":"2015-02-13 12:27:16.000000000","message":"Lets just call this  OsInfoDatabase to align with naming","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"362f758c2f32cf438da3f130e162a1a0f56dc8b0","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    return OsObjectStore().__getitem__"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class OsInfoConnection(object):"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    _instance \u003d None"},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6ced46_fd72dd0f","line":42,"in_reply_to":"da86d52c_f5eec3ec","updated":"2015-03-24 12:52:58.000000000","message":"Done","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"846afd03f31a1ac5b901185b40e4092ab4b05f68","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        if cls._instance is None:"},{"line_number":58,"context_line":"            cls._instance \u003d OsInfoConnection()"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        return cls._instance"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class OsInfoObject(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_15a8b776","line":60,"updated":"2015-02-13 12:27:16.000000000","message":"I think the \u0027_find_os\u0027 method from later really belongs here instead.\n\nThen also have the \u0027get_os(self, os_name)\u0027 method here, which calls _find_os and then passes its return value into the OsInfoOs() class.","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"362f758c2f32cf438da3f130e162a1a0f56dc8b0","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        if cls._instance is None:"},{"line_number":58,"context_line":"            cls._instance \u003d OsInfoConnection()"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        return cls._instance"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class OsInfoObject(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6ced46_3d7d55e8","line":60,"in_reply_to":"da86d52c_15a8b776","updated":"2015-03-24 12:52:58.000000000","message":"Done","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"846afd03f31a1ac5b901185b40e4092ab4b05f68","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        return cls._instance"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class OsInfoObject(object):"},{"line_number":64,"context_line":"    \"\"\"Os Information Structure"},{"line_number":65,"context_line":"    \"\"\""},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_b5c7eb45","line":63,"updated":"2015-02-13 12:27:16.000000000","message":"And call this one  OsInfoOs","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"362f758c2f32cf438da3f130e162a1a0f56dc8b0","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        return cls._instance"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class OsInfoObject(object):"},{"line_number":64,"context_line":"    \"\"\"Os Information Structure"},{"line_number":65,"context_line":"    \"\"\""},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6ced46_5d84d1d3","line":63,"in_reply_to":"da86d52c_b5c7eb45","updated":"2015-03-24 12:52:58.000000000","message":"Done","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"846afd03f31a1ac5b901185b40e4092ab4b05f68","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def __init__(self):"},{"line_number":68,"context_line":"        self.network_model \u003d None"},{"line_number":69,"context_line":"        self.disk_bus \u003d None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"class OsInfo(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_35021b73","line":69,"updated":"2015-02-13 12:27:16.000000000","message":"I\u0027d have the  os_obj passed into the constructor, and hjave the _get_network_model \u0026 get_disk_model methods on this class, and call them in the constructor to initialize the fields.","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"362f758c2f32cf438da3f130e162a1a0f56dc8b0","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def __init__(self):"},{"line_number":68,"context_line":"        self.network_model \u003d None"},{"line_number":69,"context_line":"        self.disk_bus \u003d None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"class OsInfo(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6ced46_7d87cdd7","line":69,"in_reply_to":"da86d52c_35021b73","updated":"2015-03-24 12:52:58.000000000","message":"Done","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"846afd03f31a1ac5b901185b40e4092ab4b05f68","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        self.disk_bus \u003d None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"class OsInfo(object):"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __init__(self, os_name):"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_d5f29f9a","line":72,"updated":"2015-02-13 12:27:16.000000000","message":"And then this class can go away leaving just two classes - one for the DB and one for the OS record.","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"362f758c2f32cf438da3f130e162a1a0f56dc8b0","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        self.disk_bus \u003d None"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"class OsInfo(object):"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def __init__(self, os_name):"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6ced46_9d6d6935","line":72,"in_reply_to":"da86d52c_d5f29f9a","updated":"2015-03-24 12:52:58.000000000","message":"Done","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"846afd03f31a1ac5b901185b40e4092ab4b05f68","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    if not os_name:"},{"line_number":134,"context_line":"        raise OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    return OsInfo(os_name).get_os_info()"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_f546c3bf","line":136,"updated":"2015-02-13 12:27:16.000000000","message":"Finally\n\n   OsInfoDatabase.get_instance().get_os(os_name)","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"362f758c2f32cf438da3f130e162a1a0f56dc8b0","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    if not os_name:"},{"line_number":134,"context_line":"        raise OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    return OsInfo(os_name).get_os_info()"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6ced46_dd77e100","line":136,"in_reply_to":"da86d52c_f546c3bf","updated":"2015-03-24 12:52:58.000000000","message":"Done","commit_id":"e30a97853b87ee0a3f0bc6cdc8294e90985eb368"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"ad509cf3073c00229b3a489c2db23c8757a551b0","unresolved":false,"context_lines":[{"line_number":23,"context_line":"    IS_LIBOSINFO_LOADED \u003d False"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class OsInfoNotFound(exception.NotFound):"},{"line_number":27,"context_line":"    msg_fmt \u003d _(\"No configuration information found for operating system \""},{"line_number":28,"context_line":"                \"%(os_name)s\")"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dac4157f_3dc8d7a7","line":26,"updated":"2015-04-22 15:00:36.000000000","message":"This should be in nova/exception.py","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"80c01cf0fbbb6a6e2f0dba982f5b02d7d61977fe","unresolved":false,"context_lines":[{"line_number":23,"context_line":"    IS_LIBOSINFO_LOADED \u003d False"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class OsInfoNotFound(exception.NotFound):"},{"line_number":27,"context_line":"    msg_fmt \u003d _(\"No configuration information found for operating system \""},{"line_number":28,"context_line":"                \"%(os_name)s\")"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dac4157f_d8f8c9c5","line":26,"in_reply_to":"dac4157f_3dc8d7a7","updated":"2015-04-22 15:21:38.000000000","message":"Thanks, however, in one of the previous iterations of this patch, I\u0027ve pointed out that I should keep these messages out from nova/exceptions.py, as I\u0027ve originally placed it there .. :/","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"ad509cf3073c00229b3a489c2db23c8757a551b0","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def __init__(self):"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if not IS_LIBOSINFO_LOADED:"},{"line_number":49,"context_line":"            raise ImportError()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        self.loader \u003d libosinfo.Loader()"},{"line_number":52,"context_line":"        self.loader.process_default_path()"}],"source_content_type":"text/x-python","patch_set":6,"id":"dac4157f_ddd0bbf8","line":49,"updated":"2015-04-22 15:00:36.000000000","message":"A suggestion, we can probably reuse pattern already used in guestfs and host here.\n\n  def __init__(self, ...):\n    global libosinfo\n    if libosinfo is None:\n      try:\n        libosinfo \u003d __import__(\u0027gi.repository.Libosinfo\u0027)\n      except:\n        raise NovaException(\"...\")","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"80c01cf0fbbb6a6e2f0dba982f5b02d7d61977fe","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def __init__(self):"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if not IS_LIBOSINFO_LOADED:"},{"line_number":49,"context_line":"            raise ImportError()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        self.loader \u003d libosinfo.Loader()"},{"line_number":52,"context_line":"        self.loader.process_default_path()"}],"source_content_type":"text/x-python","patch_set":6,"id":"dac4157f_78c9bd25","line":49,"in_reply_to":"dac4157f_ddd0bbf8","updated":"2015-04-22 15:21:38.000000000","message":"Yea, I think you are right.\nI have used IS_LIBOSINFO_LOADED previously, but as things currently are, I guess it\u0027s not necessary.","commit_id":"51fd13a8fa86b7788284f2b087a4b51b5b84802d"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"877a1f0f73d71eef45b34decd2b8e819a9008e86","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        global libosinfo"},{"line_number":47,"context_line":"        if libosinfo is None:"},{"line_number":48,"context_line":"            try:"},{"line_number":49,"context_line":"                libosinfo \u003d __import__(\u0027gi.repository.Libosinfo\u0027)"},{"line_number":50,"context_line":"            except ImportError as exp:"},{"line_number":51,"context_line":"                raise exception.NovaException("},{"line_number":52,"context_line":"                                _(\"Cannot load Libosinfo: (%s)\") % exp)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3acd31a7_fe1743eb","line":49,"updated":"2015-04-30 15:48:06.000000000","message":"You could use one the oslo_utils here, there is a special module importutils with a method import_module.\n\n  importutils.import_module(\u0027libvirt\u0027)\n\nIt\u0027s what we use in libvirt/driver.py and libvirt/host.py","commit_id":"a0dd2c1fb1cb3da65afa13ca01aacdce50e06f86"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"573df432ed24a5d811d5712dd677bfcb440a17c1","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        global libosinfo"},{"line_number":47,"context_line":"        if libosinfo is None:"},{"line_number":48,"context_line":"            try:"},{"line_number":49,"context_line":"                libosinfo \u003d __import__(\u0027gi.repository.Libosinfo\u0027)"},{"line_number":50,"context_line":"            except ImportError as exp:"},{"line_number":51,"context_line":"                raise exception.NovaException("},{"line_number":52,"context_line":"                                _(\"Cannot load Libosinfo: (%s)\") % exp)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3acd31a7_9e828fff","line":49,"in_reply_to":"3acd31a7_fe1743eb","updated":"2015-04-30 15:49:52.000000000","message":"Hum sorry it is not understandable I wanted to say; You could use oslo_utils...","commit_id":"a0dd2c1fb1cb3da65afa13ca01aacdce50e06f86"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"f9d4e4720945a093221325b52e3d6bdfb5fb8d83","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        global libosinfo"},{"line_number":48,"context_line":"        if libosinfo is None:"},{"line_number":49,"context_line":"            try:"},{"line_number":50,"context_line":"                libosinfo \u003d importutils.import_module("},{"line_number":51,"context_line":"                                             \u0027gi.repository.Libosinfo\u0027)"},{"line_number":52,"context_line":"            except ImportError as exp:"},{"line_number":53,"context_line":"                raise exception.NovaException("}],"source_content_type":"text/x-python","patch_set":8,"id":"3acd31a7_5da3a84f","line":50,"updated":"2015-05-04 06:48:02.000000000","message":"Thank you, it was just nit really.","commit_id":"2df7e7b81c262f2b26d5a9e495ee7c2e431a9e43"}],"nova/virt/osinfo.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"1cf7e3f1fe79a77f69238cec803b762c29e486f5","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    \"\"\""},{"line_number":123,"context_line":"    try:"},{"line_number":124,"context_line":"        if not os_name:"},{"line_number":125,"context_line":"            raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":128,"context_line":"    except exception.NovaException as e:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3acd31a7_eb1ba371","line":125,"updated":"2015-05-05 12:21:16.000000000","message":"this is a exception which will be catched later\nso maybe a quick check is enough , no need to try / catch","commit_id":"ac3389d1029eae5f8c198d46b0bbfbf7951a8ef2"},{"author":{"_account_id":7055,"name":"Tapio Tallgren","username":"tapiotallgren","inactive":true},"change_message_id":"cce6efdfe5e073be3027b245b1c424071648a259","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        return os_obj"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"class OsInfoOs(object):"},{"line_number":89,"context_line":"    \"\"\"Os Information Structure"},{"line_number":90,"context_line":"    \"\"\""},{"line_number":91,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a016987_55ab4f75","line":88,"range":{"start_line":88,"start_character":6,"end_line":88,"end_character":14},"updated":"2015-05-20 17:48:46.000000000","message":"What about other properties than network model and disk model that I may want to specify? For instance, different OSs have different expectations about tick policy.","commit_id":"f196231d02ee6946a3f49ba7f32ed6081355a3e5"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"de5bb3c612d3a31d0d7c88bf1391fb36077470b7","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        return os_obj"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"class OsInfoOs(object):"},{"line_number":89,"context_line":"    \"\"\"Os Information Structure"},{"line_number":90,"context_line":"    \"\"\""},{"line_number":91,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a016987_d1718c77","line":88,"in_reply_to":"7a016987_55ab4f75","updated":"2015-05-20 23:36:05.000000000","message":"Yes. Working on it.\nAs a first step we need to introduce this to the libosinfo database itself and then use it in nova.\nI\u0027m working on it, but this is out of scope for this patch.","commit_id":"f196231d02ee6946a3f49ba7f32ed6081355a3e5"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"643be1a68dd510ebc4582a00f2ff908e76ba892a","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        list_len \u003d filttered.get_length()"},{"line_number":79,"context_line":"        if not list_len:"},{"line_number":80,"context_line":"            raise exception.OsInfoNotFound(os_name\u003dos_name)"},{"line_number":81,"context_line":"        return filttered.get_nth(0)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def get_os(self, os_name):"},{"line_number":84,"context_line":"        os_obj \u003d self._find_os(os_name)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3afb71cf_573da1c2","line":81,"updated":"2015-06-09 16:53:27.000000000","message":"There doesn\u0027t seem much point in having this \u0027_find_os\u0027 method anymore - cant it just be all moved into the \u0027get_os\u0027 method","commit_id":"57f7c5933dff47b4b55216979cb3fcb9de05bdf1"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"4d81749ab9f32424a193ae86c96f9d040b337a57","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        list_len \u003d filttered.get_length()"},{"line_number":79,"context_line":"        if not list_len:"},{"line_number":80,"context_line":"            raise exception.OsInfoNotFound(os_name\u003dos_name)"},{"line_number":81,"context_line":"        return filttered.get_nth(0)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def get_os(self, os_name):"},{"line_number":84,"context_line":"        os_obj \u003d self._find_os(os_name)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3afb71cf_7efe23af","line":81,"in_reply_to":"3afb71cf_573da1c2","updated":"2015-06-10 03:07:39.000000000","message":"Right. Done","commit_id":"57f7c5933dff47b4b55216979cb3fcb9de05bdf1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8a52a29f6f5f32d758c12afc8bbfa7cc24ee3bfd","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from nova import exception"},{"line_number":19,"context_line":"from nova.i18n import _"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"libosinfo \u003d None"},{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_af5e5774","line":21,"updated":"2015-06-21 09:26:29.000000000","message":"in general a global var will be in upper case","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"767e638f652669cf9a78bc1b5c9a76e42fb2d2b3","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from nova import exception"},{"line_number":19,"context_line":"from nova.i18n import _"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"libosinfo \u003d None"},{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_c7d7f721","line":21,"in_reply_to":"fa32b979_af5e5774","updated":"2015-06-22 08:42:54.000000000","message":"Not in the case of variables which will contain a module later. Its done like this so the dynamic module loading is transparent to users of the module. There are a few other examples like this in nova already.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8a52a29f6f5f32d758c12afc8bbfa7cc24ee3bfd","unresolved":false,"context_lines":[{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def memoize(f):"},{"line_number":26,"context_line":"    \"\"\"Memoization decorator to cache OsInfo objects"},{"line_number":27,"context_line":"    \"\"\""},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_2f7487fb","line":25,"updated":"2015-06-21 09:26:29.000000000","message":"any reason why we are not using the cache in openstack common?","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"767e638f652669cf9a78bc1b5c9a76e42fb2d2b3","unresolved":false,"context_lines":[{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def memoize(f):"},{"line_number":26,"context_line":"    \"\"\"Memoization decorator to cache OsInfo objects"},{"line_number":27,"context_line":"    \"\"\""},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_67b38b0b","line":25,"in_reply_to":"fa32b979_2f7487fb","updated":"2015-06-22 08:42:54.000000000","message":"My question is more why we\u0027re caching at all -- are these lookups particularly expensive? They\u0027re not very frequent I imagine.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"700e98f78c87a6951cdde4b732d9923b14bd9e8c","unresolved":false,"context_lines":[{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"def memoize(f):"},{"line_number":26,"context_line":"    \"\"\"Memoization decorator to cache OsInfo objects"},{"line_number":27,"context_line":"    \"\"\""},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_bd99a621","line":25,"in_reply_to":"fa32b979_67b38b0b","updated":"2015-06-22 09:21:19.000000000","message":"Yep, see my comment later - we can do away with it.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"767e638f652669cf9a78bc1b5c9a76e42fb2d2b3","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if libosinfo is None:"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                libosinfo \u003d importutils.import_module("},{"line_number":46,"context_line":"                                             \u0027gi.repository.Libosinfo\u0027)"},{"line_number":47,"context_line":"            except ImportError as exp:"},{"line_number":48,"context_line":"                raise exception.NovaException("},{"line_number":49,"context_line":"                                _(\"Cannot load Libosinfo: (%s)\") % exp)"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_2702633f","line":46,"updated":"2015-06-22 08:42:54.000000000","message":"What\u0027s with the bizarre module path for libosinfo? I also don\u0027t immediately see libosinfo packaged on pip at all. Where are we getting this library from? I know its an optional dependancy, so hasn\u0027t gone through requirements.txt, but we need to make sure the distros are given a heads up given libvirt is the defacto hypervisor driver.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"a531785cb93779d550194ff9a2a4634ddd7c9067","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if libosinfo is None:"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                libosinfo \u003d importutils.import_module("},{"line_number":46,"context_line":"                                             \u0027gi.repository.Libosinfo\u0027)"},{"line_number":47,"context_line":"            except ImportError as exp:"},{"line_number":48,"context_line":"                raise exception.NovaException("},{"line_number":49,"context_line":"                                _(\"Cannot load Libosinfo: (%s)\") % exp)"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_aed167fd","line":46,"in_reply_to":"fa32b979_1d68d2b9","updated":"2015-06-22 11:34:05.000000000","message":"What\u0027s the windows story? This is high enough in the tree in Nova that it\u0027s no longer just Linux that it\u0027s running on.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"700e98f78c87a6951cdde4b732d9923b14bd9e8c","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if libosinfo is None:"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                libosinfo \u003d importutils.import_module("},{"line_number":46,"context_line":"                                             \u0027gi.repository.Libosinfo\u0027)"},{"line_number":47,"context_line":"            except ImportError as exp:"},{"line_number":48,"context_line":"                raise exception.NovaException("},{"line_number":49,"context_line":"                                _(\"Cannot load Libosinfo: (%s)\") % exp)"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_1d68d2b9","line":46,"in_reply_to":"fa32b979_2702633f","updated":"2015-06-22 09:21:19.000000000","message":"The libosinfo library is a C library built using GObject. As such there is no need for it to have a manually written python binding, hence nothing is visible for it on PyPI.  GObject provides an introspection framework for C libraries that allows dynamic languages to automagically call into the C library on the fly.\n\nThis \u0027gi.repository.Libosinfo\u0027 import is saying to load the C library \u0027Libosinfo\u0027 from the gobject introspection (GI)  repository.\n\nFor this to work, the libosinfo.so C library must be present on the system, along with its introspection data which is available in (binary form) at /usr/lib64/girepository-1.0/Libosinfo-1.0.typelib. \n\nThe source form (if you wanted to understand the API) is at /usr/share/gir-1.0/Libosinfo-1.0.gir but the python binding only uses the binary form for reasons of speed.\n\nOnline docs for Libosinfo python API are available http://lazka.github.io/pgi-docs/\n\nIn terms of requirements.txt the only thing that could be added would be PyGObject, but that\u0027s not on PyPi. Any distro new enough to have GNOME 3 will have a PyObject version that\u0027s usuable for this\n\nIt would be nice if there was some equiv of requirements.txt for expressing deps on native libraries/programs/packages\n\nSee also\n\nhttps://wiki.gnome.org/action/show/Projects/PyGObject\nhttps://wiki.gnome.org/Projects/GObjectIntrospection\n\nSo there shouldn\u0027t be any work needed by distros in terms of packaging - at most they\u0027d just need to make sure the packages they have for this get pulled into cloud intsalls.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"3517f254d1c834ca27291b558caa99fc868d6215","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if libosinfo is None:"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                libosinfo \u003d importutils.import_module("},{"line_number":46,"context_line":"                                             \u0027gi.repository.Libosinfo\u0027)"},{"line_number":47,"context_line":"            except ImportError as exp:"},{"line_number":48,"context_line":"                raise exception.NovaException("},{"line_number":49,"context_line":"                                _(\"Cannot load Libosinfo: (%s)\") % exp)"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_8239dd43","line":46,"in_reply_to":"fa32b979_2702633f","updated":"2015-06-22 08:56:17.000000000","message":"danpb explained this bit to me on IRC, and is in fact documented in the spec under a heading about dependancies.\n\nlibosinfo is part of the gnome project, and you need to have the C library installed as well as a module to allow introspection in python (the module varies based on python version). Hence the bonkers module path here.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"5a40c129c4fa949de886797fc846b10a00679d40","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if libosinfo is None:"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                libosinfo \u003d importutils.import_module("},{"line_number":46,"context_line":"                                             \u0027gi.repository.Libosinfo\u0027)"},{"line_number":47,"context_line":"            except ImportError as exp:"},{"line_number":48,"context_line":"                raise exception.NovaException("},{"line_number":49,"context_line":"                                _(\"Cannot load Libosinfo: (%s)\") % exp)"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_84c8ff75","line":46,"in_reply_to":"fa32b979_aed167fd","updated":"2015-06-22 13:11:12.000000000","message":"The libosinfo code would probably compile for Windows, but I don\u0027t know of the status of the gobject introspection support for Windows. I don\u0027t really see that as relevant or a show stopper - stuff in the nova/virt/ location has never been required to be cross-portable to every single platform/target Nova deploys on - it merely has to be useful to more than 1 virt driver, which this is - XenAPI could rely on this feature too if desired. The libguestfs code we have here is just one example of this - it doesn\u0027t work on Windows at all, but is usable from multiple hypervisors.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"767e638f652669cf9a78bc1b5c9a76e42fb2d2b3","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                libosinfo \u003d importutils.import_module("},{"line_number":46,"context_line":"                                             \u0027gi.repository.Libosinfo\u0027)"},{"line_number":47,"context_line":"            except ImportError as exp:"},{"line_number":48,"context_line":"                raise exception.NovaException("},{"line_number":49,"context_line":"                                _(\"Cannot load Libosinfo: (%s)\") % exp)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        self.loader \u003d libosinfo.Loader()"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_276d8332","line":48,"updated":"2015-06-22 08:42:54.000000000","message":"I want to confirm that as per the spec this exception isn\u0027t fatal to nova-compute and is caught in the hypervisor driver. That code isn\u0027t in this review, so I\u0027m just commenting here so I remember to check.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"700e98f78c87a6951cdde4b732d9923b14bd9e8c","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                libosinfo \u003d importutils.import_module("},{"line_number":46,"context_line":"                                             \u0027gi.repository.Libosinfo\u0027)"},{"line_number":47,"context_line":"            except ImportError as exp:"},{"line_number":48,"context_line":"                raise exception.NovaException("},{"line_number":49,"context_line":"                                _(\"Cannot load Libosinfo: (%s)\") % exp)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        self.loader \u003d libosinfo.Loader()"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_628299ca","line":48,"in_reply_to":"fa32b979_276d8332","updated":"2015-06-22 09:21:19.000000000","message":"Actually, this is handled later on - look at line 124 in this patch - it catches the NovaException and turns it into a mere log debug message.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"700e98f78c87a6951cdde4b732d9923b14bd9e8c","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        if not os_name:"},{"line_number":121,"context_line":"            raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":124,"context_line":"    except exception.NovaException as e:"},{"line_number":125,"context_line":"        LOG.debug(\"Cannot find os information - Reason: (%s)\", e)"},{"line_number":126,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_fde16e9b","line":123,"updated":"2015-06-22 09:21:19.000000000","message":"I timed 1,000,000 iterations of the code behind get_cached_os_info and it came out at 80 micro-seconds per iteration. This was on ancient hardware too. So I think we can safely do away this the caching of OS lookups.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"11409c47a8d42b132b0aaaa98508fa911d18f83a","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        if not os_name:"},{"line_number":121,"context_line":"            raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":124,"context_line":"    except exception.NovaException as e:"},{"line_number":125,"context_line":"        LOG.debug(\"Cannot find os information - Reason: (%s)\", e)"},{"line_number":126,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_709ed5b9","line":123,"in_reply_to":"fa32b979_b8d45447","updated":"2015-06-22 14:15:37.000000000","message":":-) Ok, I\u0027ll get rig of the caching. This was mostly a preparation/consideration for the future. In case libosinfo will grow and the lookups would get slower. Just didn\u0027t want to create a bottleneck here.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"80c99f3a60cd204c46f04864ad30b4b233330d88","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        if not os_name:"},{"line_number":121,"context_line":"            raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":124,"context_line":"    except exception.NovaException as e:"},{"line_number":125,"context_line":"        LOG.debug(\"Cannot find os information - Reason: (%s)\", e)"},{"line_number":126,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_b8d45447","line":123,"in_reply_to":"fa32b979_fde16e9b","updated":"2015-06-22 09:26:56.000000000","message":"Oh, and for completeness I just checked the lookup of net and disk filters too. These are considerably slower, taking a massive 1.4 milliseconds to complete :-) So still no need for caching.","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8a52a29f6f5f32d758c12afc8bbfa7cc24ee3bfd","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":124,"context_line":"    except exception.NovaException as e:"},{"line_number":125,"context_line":"        LOG.debug(\"Cannot find os information - Reason: (%s)\", e)"},{"line_number":126,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_ef645f4a","line":126,"updated":"2015-06-21 09:26:29.000000000","message":"you do not need the return here","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"11409c47a8d42b132b0aaaa98508fa911d18f83a","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":124,"context_line":"    except exception.NovaException as e:"},{"line_number":125,"context_line":"        LOG.debug(\"Cannot find os information - Reason: (%s)\", e)"},{"line_number":126,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa32b979_fa7ba679","line":126,"in_reply_to":"fa32b979_ef645f4a","updated":"2015-06-22 14:15:37.000000000","message":"Yep. these are leftovers..","commit_id":"d68422862925aa0074ae8a81a7a548cbb108e319"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f765d47502c8a8760e44997efdb9b1fed18f4333","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from nova import exception"},{"line_number":19,"context_line":"from nova.i18n import _"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"libosinfo \u003d None"},{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_4708952d","line":21,"updated":"2015-06-23 06:21:29.000000000","message":"A global variable should be upper case.","commit_id":"6912b9f421a3097c40478d8829287eeb84875815"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"bb6cdb1477f0cf583da99eb05449b97f38f6f94b","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from nova import exception"},{"line_number":19,"context_line":"from nova.i18n import _"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"libosinfo \u003d None"},{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_73d0f853","line":21,"in_reply_to":"fa32b979_4708952d","updated":"2015-06-23 09:01:21.000000000","message":"We don\u0027t follow that convention when the global variable is in fact used as a placeholder for an \u0027import foo.bar as bar\u0027. We always keep the variable name to match the import name we would have used, so I think this is correct as is.","commit_id":"6912b9f421a3097c40478d8829287eeb84875815"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"33419e9b2bac222fe45386577c329e6dd045717a","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"class OsInfoOs(object):"},{"line_number":74,"context_line":"    \"\"\"Os Information Structure"},{"line_number":75,"context_line":"    \"\"\""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def __init__(self, os_name\u003dNone):"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_c77ca5ed","line":74,"updated":"2015-06-23 06:16:04.000000000","message":"s/Os/OS (short for operating system)","commit_id":"6912b9f421a3097c40478d8829287eeb84875815"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f765d47502c8a8760e44997efdb9b1fed18f4333","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _get_os_obj(self, os_name):"},{"line_number":85,"context_line":"        try:"},{"line_number":86,"context_line":"            if not os_name:"},{"line_number":87,"context_line":"                raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"            return OsInfoDatabase.get_instance().get_os(os_name)"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_07028d0b","line":86,"updated":"2015-06-23 06:21:29.000000000","message":"line 86 - 87 do not need to be in the try","commit_id":"6912b9f421a3097c40478d8829287eeb84875815"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"f8676d21761b0b18254a61f30f4786640a6935d2","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _get_os_obj(self, os_name):"},{"line_number":85,"context_line":"        try:"},{"line_number":86,"context_line":"            if not os_name:"},{"line_number":87,"context_line":"                raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"            return OsInfoDatabase.get_instance().get_os(os_name)"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_a173784d","line":86,"in_reply_to":"fa32b979_07028d0b","updated":"2015-06-23 15:11:48.000000000","message":"Why not? I don\u0027t want to raise an exception, in case I couldn\u0027t find the OS, nor if the OS name is empty (it will initialize an empty object), however, I do want to log and return None.\nI\u0027m just a similar behaviour in one place here.. or am I missing something?","commit_id":"6912b9f421a3097c40478d8829287eeb84875815"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"fdf20e94e32732eddcc9a56d50e38493b6f0c452","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _get_os_obj(self, os_name):"},{"line_number":85,"context_line":"        try:"},{"line_number":86,"context_line":"            if not os_name:"},{"line_number":87,"context_line":"                raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"            return OsInfoDatabase.get_instance().get_os(os_name)"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_62b8f211","line":86,"in_reply_to":"fa32b979_15437043","updated":"2015-06-24 03:57:38.000000000","message":"On the other hand, it also handles the exception on line 37, so I will leave it as NovaException","commit_id":"6912b9f421a3097c40478d8829287eeb84875815"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"de41de3d16390e8d29d007ec0abb4a65b2622c13","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _get_os_obj(self, os_name):"},{"line_number":85,"context_line":"        try:"},{"line_number":86,"context_line":"            if not os_name:"},{"line_number":87,"context_line":"                raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"            return OsInfoDatabase.get_instance().get_os(os_name)"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_15437043","line":86,"in_reply_to":"fa32b979_a173784d","updated":"2015-06-23 20:33:46.000000000","message":"It wasn\u0027t an angry \"Why not\", btw :)\nI\u0027ll make it more readable and change the \"exception.NovaException\" on line 90 to capture only exception.OsInfoNotFound. Hope this will make things clearer?","commit_id":"6912b9f421a3097c40478d8829287eeb84875815"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"33419e9b2bac222fe45386577c329e6dd045717a","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"            return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":90,"context_line":"        except exception.NovaException as e:"},{"line_number":91,"context_line":"            LOG.debug(\"Cannot find os information - Reason: (%s)\", e)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def _get_network_model(self):"},{"line_number":94,"context_line":"        fltr \u003d libosinfo.Filter()"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_e7776900","line":91,"updated":"2015-06-23 06:16:04.000000000","message":"s/os/OS","commit_id":"6912b9f421a3097c40478d8829287eeb84875815"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"add75ad49ba15a9dd18fc82156547f9870b8e36f","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from nova import exception"},{"line_number":19,"context_line":"from nova.i18n import _"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"libosinfo \u003d None"},{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"9a41bdd9_e1144b4e","line":21,"updated":"2015-07-18 12:47:13.000000000","message":"please use uppercase for global variables","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"52b02ec3cb4f128538700c8bf784899dd91285b1","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from nova import exception"},{"line_number":19,"context_line":"from nova.i18n import _"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"libosinfo \u003d None"},{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_d5a3499d","line":21,"in_reply_to":"9a41bdd9_e1144b4e","updated":"2015-07-20 09:06:08.000000000","message":"This is a python module name, so using lowercase is correct.","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0186b65dd84a416dc614e2b421cf6b75114ad397","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        list_len \u003d filttered.get_length()"},{"line_number":70,"context_line":"        if not list_len:"},{"line_number":71,"context_line":"            raise exception.OsInfoNotFound(os_name\u003dos_name)"},{"line_number":72,"context_line":"        return filttered.get_nth(0)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"class OsInfoOs(object):"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a41bdd9_0512a962","line":72,"updated":"2015-07-17 21:18:34.000000000","message":"ugh, the libosinfo library interface is ugly... :(","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0186b65dd84a416dc614e2b421cf6b75114ad397","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        return filttered.get_nth(0)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"class OsInfoOs(object):"},{"line_number":76,"context_line":"    \"\"\"OS Information Structure"},{"line_number":77,"context_line":"    \"\"\""},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"9a41bdd9_e9fe7f04","line":75,"updated":"2015-07-17 21:18:34.000000000","message":"I don\u0027t see this used anywhere? If not, please remove it (or place it into the patch that actually uses it)","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"8b37097cdd0270432308d69708dea1f8b8a08f7e","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        return filttered.get_nth(0)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"class OsInfoOs(object):"},{"line_number":76,"context_line":"    \"\"\"OS Information Structure"},{"line_number":77,"context_line":"    \"\"\""},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a50d1a3_8c151ee6","line":75,"in_reply_to":"9a41bdd9_e9fe7f04","updated":"2015-07-22 19:28:56.000000000","message":"This is being used in the following patch.\nI don\u0027t see the rationale for moving it..?\n Here it\u0027s a definition of the class with it\u0027s own tests - I think it\u0027s better to have it in a separate patch..","commit_id":"44fca9ee26dc130418b46236d767a8b26aaf9e78"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"48e778014fac4803013b8a22f0dd578b4b34e240","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"libosinfo \u003d None"},{"line_number":22,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"class OsInfoDatabase(object):"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"da85f559_7db570cb","line":23,"updated":"2015-11-09 15:47:20.000000000","message":"Could you add a \"TODO\" item here, mentioning that the intention is to switch over to parsing the libosinfo XML files directly, or at least use a pure python library. Since we agreed at the summit that use of the libosinfo gobject library would just be short-term solution until libosinfo project declares the XML structure to be a stable ABI.","commit_id":"b8baba538a43991a5761f9396b80fa8cd0758dfe"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"bdde183d87dd04863185cda06b34b20dc5c5e7c2","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        return filttered.get_nth(0)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"class OsInfoOs(object):"},{"line_number":82,"context_line":"    \"\"\"OS Information Structure"},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_ef1ed65d","line":81,"updated":"2015-11-19 23:36:12.000000000","message":"This is a terrible class name. Why not just call it something like SystemInfo? Better yet, rename this module to nova/virt/system.py and call this call Info, so callers would do:\n\n from nova.virt import system\n ...\n sys_info \u003d system.Info()","commit_id":"44f85677617e4dfaa84429b09e95507b72f058a3"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"641bf8fd9896201dc7d05d0cbaceeb238ac6a645","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        return filttered.get_nth(0)"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"class OsInfoOs(object):"},{"line_number":82,"context_line":"    \"\"\"OS Information Structure"},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_c94ab227","line":81,"in_reply_to":"ba8a016a_ef1ed65d","updated":"2015-11-21 04:54:16.000000000","message":"I think this will be pretty misleading as this is really an info about a given OS, rather a virt system info.\nWill it be ok if I\u0027ll just rename it to OsInfo?","commit_id":"44f85677617e4dfaa84429b09e95507b72f058a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"bdde183d87dd04863185cda06b34b20dc5c5e7c2","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def __init__(self, os_name\u003dNone):"},{"line_number":86,"context_line":"        self.network_model \u003d self.disk_bus \u003d None"},{"line_number":87,"context_line":"        self.os_obj \u003d self._get_os_obj(os_name)"},{"line_number":88,"context_line":"        if self.os_obj is not None:"},{"line_number":89,"context_line":"            self.network_model \u003d self._get_network_model()"},{"line_number":90,"context_line":"            self.disk_bus \u003d self._get_disk_model()"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_ef5576f9","line":87,"updated":"2015-11-19 23:36:12.000000000","message":"Make this attribute private please since we definitely do NOT want to expose the osinfo internals outside of this class interface.","commit_id":"44f85677617e4dfaa84429b09e95507b72f058a3"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"641bf8fd9896201dc7d05d0cbaceeb238ac6a645","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def __init__(self, os_name\u003dNone):"},{"line_number":86,"context_line":"        self.network_model \u003d self.disk_bus \u003d None"},{"line_number":87,"context_line":"        self.os_obj \u003d self._get_os_obj(os_name)"},{"line_number":88,"context_line":"        if self.os_obj is not None:"},{"line_number":89,"context_line":"            self.network_model \u003d self._get_network_model()"},{"line_number":90,"context_line":"            self.disk_bus \u003d self._get_disk_model()"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_693b869d","line":87,"in_reply_to":"ba8a016a_ef5576f9","updated":"2015-11-21 04:54:16.000000000","message":"Done","commit_id":"44f85677617e4dfaa84429b09e95507b72f058a3"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"2b2c82adc8d72d8dac49d463ac917597bf482fc7","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                http://microsoft.com/win/xp,"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"           or a short-id, the short name of the OS"},{"line_number":67,"context_line":"           eg fedora21, winxp"},{"line_number":68,"context_line":"        \"\"\""},{"line_number":69,"context_line":"        if not os_name:"},{"line_number":70,"context_line":"            raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"}],"source_content_type":"text/x-python","patch_set":27,"id":"fa69d971_0ad4b71d","line":67,"range":{"start_line":67,"start_character":24,"end_line":67,"end_character":29},"updated":"2016-01-11 11:55:32.000000000","message":"Can you use the formal API documentation syntax - particularly for the parameter and return type","commit_id":"586cc4bdb1be66297a3697faabc429c5b8047d70"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"dc7f597fe169c74c15e38cc2b1c7220c58e5c54c","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                http://microsoft.com/win/xp,"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"           or a short-id, the short name of the OS"},{"line_number":67,"context_line":"           eg fedora21, winxp"},{"line_number":68,"context_line":"        \"\"\""},{"line_number":69,"context_line":"        if not os_name:"},{"line_number":70,"context_line":"            raise exception.OsInfoNotFound(os_name\u003d\u0027Empty\u0027)"}],"source_content_type":"text/x-python","patch_set":27,"id":"fa69d971_4d05db77","line":67,"range":{"start_line":67,"start_character":24,"end_line":67,"end_character":29},"in_reply_to":"fa69d971_0ad4b71d","updated":"2016-01-11 18:38:36.000000000","message":"Done","commit_id":"586cc4bdb1be66297a3697faabc429c5b8047d70"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"2b2c82adc8d72d8dac49d463ac917597bf482fc7","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def __init__(self, os_name\u003dNone):"},{"line_number":86,"context_line":"        self.__os_obj \u003d self.__get_os_obj(os_name)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def __get_os_obj(self, os_name):"},{"line_number":89,"context_line":"        try:"},{"line_number":90,"context_line":"            return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":91,"context_line":"        except exception.NovaException as e:"}],"source_content_type":"text/x-python","patch_set":27,"id":"fa69d971_8afae7bb","line":88,"range":{"start_line":88,"start_character":34,"end_line":88,"end_character":36},"updated":"2016-01-11 11:55:32.000000000","message":"Names with double underscore are usually left for python runtime usage. Application private methods use a single underscore","commit_id":"586cc4bdb1be66297a3697faabc429c5b8047d70"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"dc7f597fe169c74c15e38cc2b1c7220c58e5c54c","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def __init__(self, os_name\u003dNone):"},{"line_number":86,"context_line":"        self.__os_obj \u003d self.__get_os_obj(os_name)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def __get_os_obj(self, os_name):"},{"line_number":89,"context_line":"        try:"},{"line_number":90,"context_line":"            return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":91,"context_line":"        except exception.NovaException as e:"}],"source_content_type":"text/x-python","patch_set":27,"id":"fa69d971_428a8b65","line":88,"range":{"start_line":88,"start_character":34,"end_line":88,"end_character":36},"in_reply_to":"fa69d971_8afae7bb","updated":"2016-01-11 18:38:36.000000000","message":"Done","commit_id":"586cc4bdb1be66297a3697faabc429c5b8047d70"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8a41f5fd94e41c82f644661dc134e1074051b1e9","unresolved":false,"context_lines":[{"line_number":28,"context_line":"# libosinfo project will declare the XML structure to be a stable ABI."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class OsInfoDatabase(object):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    _instance \u003d None"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_a6473f4a","line":31,"updated":"2016-01-19 19:50:30.000000000","message":"I would prefer greatly if we could make this a private class in this module and prefix the class name with _. So... class _OsInfoDb. We don\u0027t want this interface leaking outside of this module.","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"c6f7a59cfe5d80028f17f5053cc56f170c41ee5a","unresolved":false,"context_lines":[{"line_number":28,"context_line":"# libosinfo project will declare the XML structure to be a stable ABI."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class OsInfoDatabase(object):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    _instance \u003d None"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_e65a1750","line":31,"in_reply_to":"ba63e191_a6473f4a","updated":"2016-01-19 21:07:14.000000000","message":"Done","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"beb03e8089cbe428442b468cfbdc39907e508b3d","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                           short-id - the short name of the OS"},{"line_number":68,"context_line":"                           e.g. fedora21, winxp"},{"line_number":69,"context_line":"           :returns:    the operating system object"},{"line_number":70,"context_line":"           :return type:    Libosinfo.Os"},{"line_number":71,"context_line":"           :raise exception.OsInfoNotFound: If os hasn\u0027t been found"},{"line_number":72,"context_line":"        \"\"\""},{"line_number":73,"context_line":"        if not os_name:"}],"source_content_type":"text/x-python","patch_set":29,"id":"da6ed579_40bb02c5","line":70,"updated":"2016-01-12 08:47:56.000000000","message":"Usually we only use \n\n  :returns: The operation system object Libosinfo.Os","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"c6f7a59cfe5d80028f17f5053cc56f170c41ee5a","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                           short-id - the short name of the OS"},{"line_number":68,"context_line":"                           e.g. fedora21, winxp"},{"line_number":69,"context_line":"           :returns:    the operating system object"},{"line_number":70,"context_line":"           :return type:    Libosinfo.Os"},{"line_number":71,"context_line":"           :raise exception.OsInfoNotFound: If os hasn\u0027t been found"},{"line_number":72,"context_line":"        \"\"\""},{"line_number":73,"context_line":"        if not os_name:"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_86079b1b","line":70,"in_reply_to":"da6ed579_40bb02c5","updated":"2016-01-19 21:07:14.000000000","message":"Done","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8a41f5fd94e41c82f644661dc134e1074051b1e9","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    \"\"\"OS Information Structure"},{"line_number":87,"context_line":"    \"\"\""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __init__(self, os_name\u003dNone):"},{"line_number":90,"context_line":"        self._os_obj \u003d self._get_os_obj(os_name)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def _get_os_obj(self, os_name):"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_46752396","line":89,"updated":"2016-01-19 19:50:30.000000000","message":"Why make the os_name parameter default to None if a None value will always raise exception.OsInfoNotFound above? Just make it a non-defaulted argument.","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"c6f7a59cfe5d80028f17f5053cc56f170c41ee5a","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    \"\"\"OS Information Structure"},{"line_number":87,"context_line":"    \"\"\""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __init__(self, os_name\u003dNone):"},{"line_number":90,"context_line":"        self._os_obj \u003d self._get_os_obj(os_name)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def _get_os_obj(self, os_name):"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_414e6d70","line":89,"in_reply_to":"ba63e191_46752396","updated":"2016-01-19 21:07:14.000000000","message":"Done","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8a41f5fd94e41c82f644661dc134e1074051b1e9","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":95,"context_line":"        except exception.NovaException as e:"},{"line_number":96,"context_line":"            LOG.debug(\"Cannot find OS information - Reason: (%s)\", e)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def network_model(self):"},{"line_number":99,"context_line":"        if self._os_obj is not None:"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_66786790","line":96,"updated":"2016-01-19 19:50:30.000000000","message":"This should be LOG.error(). As such, the error message should use _LE().","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"c6f7a59cfe5d80028f17f5053cc56f170c41ee5a","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            return OsInfoDatabase.get_instance().get_os(os_name)"},{"line_number":95,"context_line":"        except exception.NovaException as e:"},{"line_number":96,"context_line":"            LOG.debug(\"Cannot find OS information - Reason: (%s)\", e)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def network_model(self):"},{"line_number":99,"context_line":"        if self._os_obj is not None:"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_c197bd8e","line":96,"in_reply_to":"ba63e191_66786790","updated":"2016-01-19 21:07:14.000000000","message":"Done","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8a41f5fd94e41c82f644661dc134e1074051b1e9","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        except exception.NovaException as e:"},{"line_number":96,"context_line":"            LOG.debug(\"Cannot find OS information - Reason: (%s)\", e)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def network_model(self):"},{"line_number":99,"context_line":"        if self._os_obj is not None:"},{"line_number":100,"context_line":"            fltr \u003d libosinfo.Filter()"},{"line_number":101,"context_line":"            fltr.add_constraint(\"class\", \"net\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_066f2bc6","line":98,"updated":"2016-01-19 19:50:30.000000000","message":"How about decorating this and disk_model with @property?","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"},{"author":{"_account_id":8802,"name":"Vladik Romanovsky","email":"vromanso@redhat.com","username":"vladikr"},"change_message_id":"c6f7a59cfe5d80028f17f5053cc56f170c41ee5a","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        except exception.NovaException as e:"},{"line_number":96,"context_line":"            LOG.debug(\"Cannot find OS information - Reason: (%s)\", e)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def network_model(self):"},{"line_number":99,"context_line":"        if self._os_obj is not None:"},{"line_number":100,"context_line":"            fltr \u003d libosinfo.Filter()"},{"line_number":101,"context_line":"            fltr.add_constraint(\"class\", \"net\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba63e191_e192019f","line":98,"in_reply_to":"ba63e191_066f2bc6","updated":"2016-01-19 21:07:14.000000000","message":"Done","commit_id":"9b361f1fe4018540fd376261f82ec9e8cde0c697"}]}
