)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"79ec0ee35bd7d6518e34ff4726f9122ffdc948b2","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Import all neutron modules in autogenerate"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"For autogenerate is needed db schema containing all db models. This can"},{"line_number":10,"context_line":"be achieved by importing all neutron modules. This patch goes through"},{"line_number":11,"context_line":"all packages and modules within neutron package tree and imports them."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1abeadc6_acce572c","line":9,"updated":"2014-08-20 14:38:39.000000000","message":"nit: \"For autogenerate db schema containing all db models is needed\" ?","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"136bf24c551a9d2913c85a831b3c386484251ba7","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Import all neutron modules in autogenerate"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"For autogenerate is needed db schema containing all db models. This can"},{"line_number":10,"context_line":"be achieved by importing all neutron modules. This patch goes through"},{"line_number":11,"context_line":"all packages and modules within neutron package tree and imports them."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1abeadc6_73d4f7bc","line":9,"in_reply_to":"1abeadc6_acce572c","updated":"2014-08-21 11:44:52.000000000","message":"Thanks, will change when I find the reason of why other unittests started to fail.","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"}],"neutron/db/__init__.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2ad76ccc0ef194ee45b645880b4b6a263264f8c5","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"def import_all_modules(exclude_pattern\u003dEXCLUDE_PATTERN):"},{"line_number":30,"context_line":"    skip_pattern \u003d re.compile(exclude_pattern)"},{"line_number":31,"context_line":"    for importer, module, ispkg in pkgutil.walk_packages("},{"line_number":32,"context_line":"            neutron.__path__, neutron.__name__ + \u0027.\u0027):"},{"line_number":33,"context_line":"        if not skip_pattern.match(module):"},{"line_number":34,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_822e9641","line":31,"updated":"2014-08-21 15:45:04.000000000","message":"pkgutil.walk_packages actually imports every package it encounters. Use pkgutil.iter_modules instead.","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"6ae5e081b552759e07ebd84201ce2640b32a2f23","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"def import_all_modules(exclude_pattern\u003dEXCLUDE_PATTERN):"},{"line_number":30,"context_line":"    skip_pattern \u003d re.compile(exclude_pattern)"},{"line_number":31,"context_line":"    for importer, module, ispkg in pkgutil.walk_packages("},{"line_number":32,"context_line":"            neutron.__path__, neutron.__name__ + \u0027.\u0027):"},{"line_number":33,"context_line":"        if not skip_pattern.match(module):"},{"line_number":34,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_317c25b5","line":31,"in_reply_to":"1abeadc6_822e9641","updated":"2014-08-21 20:57:22.000000000","message":"Please ignore my comment. I misunderstood what pkgutils are doing.","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"2ad76ccc0ef194ee45b645880b4b6a263264f8c5","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    skip_pattern \u003d re.compile(exclude_pattern)"},{"line_number":31,"context_line":"    for importer, module, ispkg in pkgutil.walk_packages("},{"line_number":32,"context_line":"            neutron.__path__, neutron.__name__ + \u0027.\u0027):"},{"line_number":33,"context_line":"        if not skip_pattern.match(module):"},{"line_number":34,"context_line":"            try:"},{"line_number":35,"context_line":"                __import__(module)"},{"line_number":36,"context_line":"            except ImportError:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_c2b24e05","line":33,"updated":"2014-08-21 15:45:04.000000000","message":"You want to also skip packages since they should never contain models (I hope). So check ispkg.","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"6ae5e081b552759e07ebd84201ce2640b32a2f23","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    skip_pattern \u003d re.compile(exclude_pattern)"},{"line_number":31,"context_line":"    for importer, module, ispkg in pkgutil.walk_packages("},{"line_number":32,"context_line":"            neutron.__path__, neutron.__name__ + \u0027.\u0027):"},{"line_number":33,"context_line":"        if not skip_pattern.match(module):"},{"line_number":34,"context_line":"            try:"},{"line_number":35,"context_line":"                __import__(module)"},{"line_number":36,"context_line":"            except ImportError:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_3153453a","line":33,"in_reply_to":"1abeadc6_c2b24e05","updated":"2014-08-21 20:57:22.000000000","message":"Please ignore this too. I don\u0027t know what I was thinking.","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"1f82f0168782021efc4da1ecb830ee57f2b1b06b","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            try:"},{"line_number":35,"context_line":"                __import__(module)"},{"line_number":36,"context_line":"            except ImportError:"},{"line_number":37,"context_line":"                LOG.exception(_(\"Cannot load module %s\"), module)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def get_metadata():"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_60f7db8b","line":37,"updated":"2014-08-20 18:02:05.000000000","message":"I am seeing several several modules not loaded because of trying to import things not in requirements.","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dca82d353dd8c5792d43aa0aa05d1f29985a418d","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            try:"},{"line_number":35,"context_line":"                __import__(module)"},{"line_number":36,"context_line":"            except ImportError:"},{"line_number":37,"context_line":"                LOG.exception(_(\"Cannot load module %s\"), module)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def get_metadata():"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_6305e012","line":37,"in_reply_to":"1abeadc6_0e0c6393","updated":"2014-08-22 11:01:20.000000000","message":"What do you mean? This line logs the fact it can\u0027t be imported. To see also from which module it came from I call exception(). If you think it\u0027s better to do warning(), I\u0027m ok to change. But I find the backtrace useful in this case.","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"136bf24c551a9d2913c85a831b3c386484251ba7","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            try:"},{"line_number":35,"context_line":"                __import__(module)"},{"line_number":36,"context_line":"            except ImportError:"},{"line_number":37,"context_line":"                LOG.exception(_(\"Cannot load module %s\"), module)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def get_metadata():"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_934c3344","line":37,"in_reply_to":"1abeadc6_60f7db8b","updated":"2014-08-21 11:44:52.000000000","message":"That\u0027s why we catch it so we can continue. We discussed that on team meeting and agreed that such modules with specific 3rd party dependency shouldn\u0027t contain models (and currently it doesn\u0027t).","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c52a46c98679c32a107a513da66e473c17e371be","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            try:"},{"line_number":35,"context_line":"                __import__(module)"},{"line_number":36,"context_line":"            except ImportError:"},{"line_number":37,"context_line":"                LOG.exception(_(\"Cannot load module %s\"), module)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def get_metadata():"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_0e0c6393","line":37,"in_reply_to":"1abeadc6_934c3344","updated":"2014-08-21 22:51:21.000000000","message":"Do we need to log anything?","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"856601d673d4510f3be2dd3f9e9187603078a13f","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"def import_all_modules(exclude_pattern\u003dEXCLUDE_PATTERN):"},{"line_number":30,"context_line":"    skip_pattern \u003d re.compile(exclude_pattern)"},{"line_number":31,"context_line":"    for importer, module, ispkg in pkgutil.walk_packages("},{"line_number":32,"context_line":"            neutron.__path__, neutron.__name__ + \u0027.\u0027):"},{"line_number":33,"context_line":"        if not skip_pattern.match(module):"},{"line_number":34,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1abeadc6_c3c76b43","line":31,"updated":"2014-08-24 06:14:54.000000000","message":"I printed all the modules yielded by this, and then I used find to list all .py modules in neutron. It seems that the following modules are never yielded by walk_packages:\n\n  neutron.plugins.embrane.plugins.embrane_fake_plugin\n  neutron.plugins.embrane.plugins.embrane_ovs_plugin\n  neutron.plugins.embrane.base_plugin\n  neutron.plugins.embrane.common.constants\n  neutron.plugins.embrane.common.utils\n  neutron.plugins.embrane.agent.dispatcher\n  neutron.plugins.embrane.agent.operations.router_operations\n  neutron.plugins.embrane.l2base.openvswitch.openvswitch_support\n  neutron.plugins.embrane.l2base.fake.fakeplugin_support\n  neutron.plugins.midonet.midonet_lib\n  neutron.plugins.midonet.plugin\n  neutron.plugins.ryu.agent.ryu_neutron_agent\n  neutron.plugins.ryu.ryu_neutron_plugin\n  neutron.plugins.plumgrid.drivers.plumlib\n  neutron.plugins.ml2.drivers.brocade.nos.nosdriver\n  neutron.plugins.cisco.nexus.cisco_nexus_network_driver_v2\n  neutron.plugins.cisco.cfg_agent.device_drivers.csr1kv.csr1kv_routing_driver\n  neutron.plugins.ofagent.agent.arp_lib\n  neutron.plugins.ofagent.agent.main\n  neutron.plugins.ofagent.agent.ofa_neutron_agent\n  neutron.plugins.brocade.nos.nosdriver\n  neutron.plugins.brocade.tests.nostest\n  neutron.plugins.brocade.tests.noscli\n  neutron.openstack.common.fixture.moxstubout\n\nI could not figure out why. Now it turns out none of these skipped modules contain models, but what if some of them did?","commit_id":"ddc56ce25447b009a975b61be371f9247436820c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"6163d8704c32b8b4489eddc344966c44366c00e7","unresolved":false,"context_lines":[{"line_number":29,"context_line":"def import_all_modules(exclude_pattern\u003dEXCLUDE_PATTERN):"},{"line_number":30,"context_line":"    skip_pattern \u003d re.compile(exclude_pattern)"},{"line_number":31,"context_line":"    for importer, module, ispkg in pkgutil.walk_packages("},{"line_number":32,"context_line":"            neutron.__path__, neutron.__name__ + \u0027.\u0027):"},{"line_number":33,"context_line":"        if not skip_pattern.match(module):"},{"line_number":34,"context_line":"            try:"},{"line_number":35,"context_line":"                __import__(module)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1abeadc6_a598a06b","line":32,"updated":"2014-08-25 11:18:23.000000000","message":"I suggest using oneerror parameter to check if there any errors during package walk. Perhaps these modules are raising import errors because of circular references.\n\nI\u0027m just thinking aloud I\u0027ve not checked anything.","commit_id":"ddc56ce25447b009a975b61be371f9247436820c"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"856601d673d4510f3be2dd3f9e9187603078a13f","unresolved":false,"context_lines":[{"line_number":34,"context_line":"            try:"},{"line_number":35,"context_line":"                __import__(module)"},{"line_number":36,"context_line":"            except ImportError:"},{"line_number":37,"context_line":"                LOG.exception(_(\"Cannot load module %s\"), module)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def get_metadata():"}],"source_content_type":"text/x-python","patch_set":5,"id":"1abeadc6_3acdbe66","line":37,"updated":"2014-08-24 06:14:54.000000000","message":"I am seeing this when running unit tests:\n\n  No handlers could be found for logger \"neutron.db\"\n\nI think this is because of calling LOG.exception during import, which is before logging has been set up.","commit_id":"ddc56ce25447b009a975b61be371f9247436820c"}],"neutron/tests/unit/testlib_api.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"1f82f0168782021efc4da1ecb830ee57f2b1b06b","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron import wsgi"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"db.import_all_modules()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExpectedException(testtools.ExpectedException):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_a0bf33a9","line":26,"updated":"2014-08-20 18:02:05.000000000","message":"Hmmm. It might be better to import this only for DB test cases? Maybe in SqlTestCase.setUp()?","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c52a46c98679c32a107a513da66e473c17e371be","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron import wsgi"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"db.import_all_modules()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExpectedException(testtools.ExpectedException):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_eb3719fd","line":26,"in_reply_to":"1abeadc6_13c90326","updated":"2014-08-21 22:51:21.000000000","message":"I tried this and it fixed the unit tests:\n\n with mock.patch(\"neutron.openstack.common.gettextutils.install\"):\n     db.import_all_modules()","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"136bf24c551a9d2913c85a831b3c386484251ba7","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron import wsgi"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"db.import_all_modules()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExpectedException(testtools.ExpectedException):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_13c90326","line":26,"in_reply_to":"1abeadc6_a0bf33a9","updated":"2014-08-21 11:44:52.000000000","message":"That would collect all models before executing every particular test. I don\u0027t know what\u0027s the policy of using setUpClass(cls) classmethod. I haven\u0027t seen it anywhere yet but this would probably be the best place where to use it.","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dca82d353dd8c5792d43aa0aa05d1f29985a418d","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron import wsgi"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"db.import_all_modules()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExpectedException(testtools.ExpectedException):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1abeadc6_46db927b","line":26,"in_reply_to":"1abeadc6_eb3719fd","updated":"2014-08-22 11:01:20.000000000","message":"Awesome! Thanks a lot!","commit_id":"18ce94889791402df481756eaa21a2a53ea1a7f8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"856601d673d4510f3be2dd3f9e9187603078a13f","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# We don\u0027t want localization to be set"},{"line_number":28,"context_line":"with mock.patch(\"neutron.openstack.common.gettextutils.install\"):"},{"line_number":29,"context_line":"    db.import_all_modules()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class ExpectedException(testtools.ExpectedException):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1abeadc6_e37547fa","line":29,"updated":"2014-08-24 06:14:54.000000000","message":"When running the full unit test suite the following messages appear to come from this:\n\n\"Exception TypeError: \"\u0027NoneType\u0027 object is not callable\" in \u003cbound method _SocketDuckForFd.__del__ of _SocketDuckForFd:6\u003e ignored\"\n\nThis is something to do with eventlet (eventlet.greenio._SocketDuckForFd) but I couldn\u0027t figure out what needs to be mocked for it.\n\nHow can we be sure there are not other unseen unwanted things that happen at import of all the modules in neutron?","commit_id":"ddc56ce25447b009a975b61be371f9247436820c"}]}
