)]}'
{"dragonflow/conf/__init__.py":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"a273cb20ed7722745da81538f1ed35a170c5ef04","unresolved":false,"context_lines":[{"line_number":15,"context_line":"from dragonflow.conf import df_common_params"},{"line_number":16,"context_line":"from dragonflow.conf import df_dhcp"},{"line_number":17,"context_line":"from dragonflow.conf import df_dnat"},{"line_number":18,"context_line":"from dragonflow.conf import df_l2_ml2"},{"line_number":19,"context_line":"from dragonflow.conf import df_metadata_service"},{"line_number":20,"context_line":"from dragonflow.conf import df_ryu"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_241e295f","line":18,"range":{"start_line":18,"start_character":0,"end_line":18,"end_character":37},"updated":"2016-12-06 03:57:40.000000000","message":"We are renaming l2_ml2_app to l2_app, and make it to be the only l2_app, maybe you can rename it to df_l2 here, too.\n\n\nhttps://review.openstack.org/#/c/406148/","commit_id":"29fe95a2e357cbaa3afc339283377aada7c30a84"}],"dragonflow/conf/df_l2_ml2.py":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"a273cb20ed7722745da81538f1ed35a170c5ef04","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_84f8ddc4","line":1,"updated":"2016-12-06 03:57:40.000000000","message":"You could rename this file to df_l2_app.py too.","commit_id":"29fe95a2e357cbaa3afc339283377aada7c30a84"}],"dragonflow/conf/opts.py":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"a273cb20ed7722745da81538f1ed35a170c5ef04","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    module_names \u003d _list_module_names()"},{"line_number":42,"context_line":"    imported_modules \u003d _import_modules(module_names)"},{"line_number":43,"context_line":"    _append_config_options(imported_modules, opts)"},{"line_number":44,"context_line":"    return _tupleize(opts)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def _list_module_names():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_a4e319a3","line":44,"range":{"start_line":44,"start_character":0,"end_line":44,"end_character":26},"updated":"2016-12-06 03:57:40.000000000","message":"nit: I think the list comprehension can be applied here, without putting it in a method.","commit_id":"29fe95a2e357cbaa3afc339283377aada7c30a84"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"a273cb20ed7722745da81538f1ed35a170c5ef04","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    module_names \u003d []"},{"line_number":49,"context_line":"    package_path \u003d os.path.dirname(os.path.abspath(__file__))"},{"line_number":50,"context_line":"    for _, modname, ispkg in pkgutil.iter_modules(path\u003d[package_path]):"},{"line_number":51,"context_line":"        if modname \u003d\u003d \"opts\" or ispkg:"},{"line_number":52,"context_line":"            continue"},{"line_number":53,"context_line":"        else:"},{"line_number":54,"context_line":"            module_names.append(modname)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_04c12d54","line":51,"range":{"start_line":51,"start_character":22,"end_line":51,"end_character":28},"updated":"2016-12-06 03:57:40.000000000","message":"You can avoid using hardcode by using __name__.split(\u0027.\u0027)[-1]","commit_id":"29fe95a2e357cbaa3afc339283377aada7c30a84"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"a273cb20ed7722745da81538f1ed35a170c5ef04","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    for _, modname, ispkg in pkgutil.iter_modules(path\u003d[package_path]):"},{"line_number":51,"context_line":"        if modname \u003d\u003d \"opts\" or ispkg:"},{"line_number":52,"context_line":"            continue"},{"line_number":53,"context_line":"        else:"},{"line_number":54,"context_line":"            module_names.append(modname)"},{"line_number":55,"context_line":"    return module_names"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_04192dd7","line":53,"range":{"start_line":53,"start_character":0,"end_line":53,"end_character":13},"updated":"2016-12-06 03:57:40.000000000","message":"nit: else is not necessary","commit_id":"29fe95a2e357cbaa3afc339283377aada7c30a84"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"a273cb20ed7722745da81538f1ed35a170c5ef04","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    return module_names"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def _import_modules(module_names):"},{"line_number":59,"context_line":"    imported_modules \u003d []"},{"line_number":60,"context_line":"    for modname in module_names:"},{"line_number":61,"context_line":"        mod \u003d importlib.import_module(\"dragonflow.conf.\" + modname)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_84253d0a","line":58,"range":{"start_line":58,"start_character":0,"end_line":58,"end_character":34},"updated":"2016-12-06 03:57:40.000000000","message":"Why not just put the code here inside _list_module_names?","commit_id":"29fe95a2e357cbaa3afc339283377aada7c30a84"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"a273cb20ed7722745da81538f1ed35a170c5ef04","unresolved":false,"context_lines":[{"line_number":58,"context_line":"def _import_modules(module_names):"},{"line_number":59,"context_line":"    imported_modules \u003d []"},{"line_number":60,"context_line":"    for modname in module_names:"},{"line_number":61,"context_line":"        mod \u003d importlib.import_module(\"dragonflow.conf.\" + modname)"},{"line_number":62,"context_line":"        if not hasattr(mod, LIST_OPTS_FUNC_NAME):"},{"line_number":63,"context_line":"            msg \u003d (\"The module \u0027dragonflow.conf.%s\u0027 should have a \u0027%s\u0027 \""},{"line_number":64,"context_line":"                  \"function which returns the config options.\" %"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_445de577","line":61,"range":{"start_line":61,"start_character":38,"end_line":61,"end_character":56},"updated":"2016-12-06 03:57:40.000000000","message":"Is there anyway to eliminate the hardcode here? Maybe use imp.load_source(modname, modpath)","commit_id":"29fe95a2e357cbaa3afc339283377aada7c30a84"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"a273cb20ed7722745da81538f1ed35a170c5ef04","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    for modname in module_names:"},{"line_number":61,"context_line":"        mod \u003d importlib.import_module(\"dragonflow.conf.\" + modname)"},{"line_number":62,"context_line":"        if not hasattr(mod, LIST_OPTS_FUNC_NAME):"},{"line_number":63,"context_line":"            msg \u003d (\"The module \u0027dragonflow.conf.%s\u0027 should have a \u0027%s\u0027 \""},{"line_number":64,"context_line":"                  \"function which returns the config options.\" %"},{"line_number":65,"context_line":"                  (modname, LIST_OPTS_FUNC_NAME))"},{"line_number":66,"context_line":"            raise Exception(msg)"},{"line_number":67,"context_line":"        else:"},{"line_number":68,"context_line":"            imported_modules.append(mod)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_8471bd78","line":65,"range":{"start_line":63,"start_character":18,"end_line":65,"end_character":49},"updated":"2016-12-06 03:57:40.000000000","message":"This should use _() as user can see this message.","commit_id":"29fe95a2e357cbaa3afc339283377aada7c30a84"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"423bef486ed61de18bc52b69fb2276ea4aaa9e1d","unresolved":false,"context_lines":[{"line_number":28,"context_line":"import os"},{"line_number":29,"context_line":"import pkgutil"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"from dragonflow._i18n import _ as _i18"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LIST_OPTS_FUNC_NAME \u003d \"list_opts\""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_6713dfb8","line":31,"range":{"start_line":31,"start_character":0,"end_line":31,"end_character":38},"updated":"2016-12-11 23:39:28.000000000","message":"nit: why would you do this rename? It is usually _() being used.","commit_id":"096d38ed04de848478e1e90859a54d23d280d1fb"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"423bef486ed61de18bc52b69fb2276ea4aaa9e1d","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        path \u003d (\u0027%s/%s.py\u0027 % (package_path, modname))"},{"line_number":51,"context_line":"        mod \u003d imp.load_source(modname, path)"},{"line_number":52,"context_line":"        if not hasattr(mod, LIST_OPTS_FUNC_NAME):"},{"line_number":53,"context_line":"            msg \u003d _i18(\"The module \u0027dragonflow.conf.%s\u0027 should have a \u0027%s\u0027 \""},{"line_number":54,"context_line":"                       \"function which returns the config options.\" % (modname,"},{"line_number":55,"context_line":"                       LIST_OPTS_FUNC_NAME))"},{"line_number":56,"context_line":"            raise Exception(msg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_a7097786","line":53,"range":{"start_line":53,"start_character":36,"end_line":53,"end_character":52},"updated":"2016-12-11 23:39:28.000000000","message":"Try to eliminate this hard code.","commit_id":"096d38ed04de848478e1e90859a54d23d280d1fb"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"04b457a9f9c549c331f666126a7bcf88442bc4f6","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        path \u003d (\u0027%s/%s.py\u0027 % (package_path, modname))"},{"line_number":51,"context_line":"        mod \u003d imp.load_source(modname, path)"},{"line_number":52,"context_line":"        if not hasattr(mod, LIST_OPTS_FUNC_NAME):"},{"line_number":53,"context_line":"            msg \u003d _i18(\"The module \u0027dragonflow.conf.%s\u0027 should have a \u0027%s\u0027 \""},{"line_number":54,"context_line":"                       \"function which returns the config options.\" % (modname,"},{"line_number":55,"context_line":"                       LIST_OPTS_FUNC_NAME))"},{"line_number":56,"context_line":"            raise Exception(msg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a6eadb0_dc8b3c1d","line":53,"range":{"start_line":53,"start_character":36,"end_line":53,"end_character":52},"in_reply_to":"3a71b18c_a7097786","updated":"2016-12-18 13:35:19.000000000","message":"+1","commit_id":"096d38ed04de848478e1e90859a54d23d280d1fb"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"c27310180c0de733d48f4776ea10b4477dd60031","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        path \u003d (\u0027%s/%s.py\u0027 % (package_path, modname))"},{"line_number":51,"context_line":"        mod \u003d imp.load_source(modname, path)"},{"line_number":52,"context_line":"        if not hasattr(mod, LIST_OPTS_FUNC_NAME):"},{"line_number":53,"context_line":"            pkg_path \u003d package_path.split(\u0027dragonflow\u0027)[-1]"},{"line_number":54,"context_line":"            end_path \u003d pkg_path.split(\u0027.\u0027)[0].replace(\u0027/\u0027, \u0027.\u0027)"},{"line_number":55,"context_line":"            mod_loc \u003d (\"dragonflow.%s\" % end_path)"},{"line_number":56,"context_line":"            msg \u003d _i18(\"The module \u0027%s.%s\u0027 should have a \u0027%s\u0027 function which \""},{"line_number":57,"context_line":"                       \"returns the config options.\" % (mod_loc, modname,"},{"line_number":58,"context_line":"                       LIST_OPTS_FUNC_NAME))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_c1531e38","line":55,"range":{"start_line":53,"start_character":0,"end_line":55,"end_character":50},"updated":"2016-12-20 01:34:56.000000000","message":"This is another kind of hardcode, maybe you can use the __name__ attribute of module object.","commit_id":"54c6c8c4f24338477d5336284d86ff3913ffaf24"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"b2d32ea0f3dce40952062f9048f014633f38adb9","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        path \u003d (\u0027%s/%s.py\u0027 % (package_path, modname))"},{"line_number":51,"context_line":"        mod \u003d imp.load_source(modname, path)"},{"line_number":52,"context_line":"        if not hasattr(mod, LIST_OPTS_FUNC_NAME):"},{"line_number":53,"context_line":"            pkg_path \u003d package_path.split(\u0027dragonflow\u0027)[-1]"},{"line_number":54,"context_line":"            end_path \u003d pkg_path.split(\u0027.\u0027)[0].replace(\u0027/\u0027, \u0027.\u0027)"},{"line_number":55,"context_line":"            mod_loc \u003d (\"dragonflow.%s\" % end_path)"},{"line_number":56,"context_line":"            msg \u003d _i18(\"The module \u0027%s.%s\u0027 should have a \u0027%s\u0027 function which \""},{"line_number":57,"context_line":"                       \"returns the config options.\" % (mod_loc, modname,"},{"line_number":58,"context_line":"                       LIST_OPTS_FUNC_NAME))"}],"source_content_type":"text/x-python","patch_set":4,"id":"da4df55a_317775d4","line":55,"range":{"start_line":53,"start_character":0,"end_line":55,"end_character":50},"in_reply_to":"1a6eadb0_c1531e38","updated":"2016-12-27 12:02:17.000000000","message":"Xiao\n\nCan you please elaborate more on it? Sorry, I can not get, what you mean?","commit_id":"54c6c8c4f24338477d5336284d86ff3913ffaf24"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"aa9a9b06cd99114c34acca946a8dc87b8d18e2e6","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        path \u003d (\u0027%s/%s.py\u0027 % (package_path, modname))"},{"line_number":51,"context_line":"        mod \u003d imp.load_source(modname, path)"},{"line_number":52,"context_line":"        if not hasattr(mod, LIST_OPTS_FUNC_NAME):"},{"line_number":53,"context_line":"            pkg_path \u003d package_path.split(\u0027dragonflow\u0027)[-1]"},{"line_number":54,"context_line":"            end_path \u003d pkg_path.split(\u0027.\u0027)[0].replace(\u0027/\u0027, \u0027.\u0027)"},{"line_number":55,"context_line":"            mod_loc \u003d (\"dragonflow.%s\" % end_path)"},{"line_number":56,"context_line":"            msg \u003d _i18(\"The module \u0027%s.%s\u0027 should have a \u0027%s\u0027 function which \""},{"line_number":57,"context_line":"                       \"returns the config options.\" % (mod_loc, modname,"},{"line_number":58,"context_line":"                       LIST_OPTS_FUNC_NAME))"}],"source_content_type":"text/x-python","patch_set":4,"id":"da4df55a_49da80e9","line":55,"range":{"start_line":53,"start_character":0,"end_line":55,"end_character":50},"in_reply_to":"da4df55a_317775d4","updated":"2016-12-28 01:01:37.000000000","message":"The __name__ attribute in module will be the fullname of the module(if my memory is correct). In this case, __name__ will be \"dragonflow.conf.opts\". So you can change that string to the name of module you want to log.\n\nThe way you are using now, it is still a bit hardcode. It depends on the path name and the project name, though they are not possible to be changed in a foresee future.","commit_id":"54c6c8c4f24338477d5336284d86ff3913ffaf24"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6b0ffac88e2677062c69067ac29cc533713310a7","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        path \u003d (\u0027%s/%s.py\u0027 % (package_path, modname))"},{"line_number":51,"context_line":"        mod \u003d imp.load_source(modname, path)"},{"line_number":52,"context_line":"        if not hasattr(mod, LIST_OPTS_FUNC_NAME):"},{"line_number":53,"context_line":"            pkg_path \u003d package_path.split(\u0027dragonflow\u0027)[-1]"},{"line_number":54,"context_line":"            end_path \u003d pkg_path.split(\u0027.\u0027)[0].replace(\u0027/\u0027, \u0027.\u0027)"},{"line_number":55,"context_line":"            mod_loc \u003d (\"dragonflow.%s\" % end_path)"},{"line_number":56,"context_line":"            msg \u003d _i18(\"The module \u0027%s.%s\u0027 should have a \u0027%s\u0027 function which \""},{"line_number":57,"context_line":"                       \"returns the config options.\" % (mod_loc, modname,"},{"line_number":58,"context_line":"                       LIST_OPTS_FUNC_NAME))"}],"source_content_type":"text/x-python","patch_set":4,"id":"da4df55a_57ebed77","line":55,"range":{"start_line":53,"start_character":0,"end_line":55,"end_character":50},"in_reply_to":"da4df55a_49da80e9","updated":"2016-12-28 13:11:40.000000000","message":"Thanks Xiao. :)","commit_id":"54c6c8c4f24338477d5336284d86ff3913ffaf24"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"5b84a2cdf632724bc3f060a6d78a29c111a02a44","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        path \u003d (\u0027%s/%s.py\u0027 % (package_path, modname))"},{"line_number":51,"context_line":"        mod \u003d imp.load_source(modname, path)"},{"line_number":52,"context_line":"        if not hasattr(mod, LIST_OPTS_FUNC_NAME):"},{"line_number":53,"context_line":"            msg \u003d _i18(\"The module \u0027%s.%s\u0027 should have a \u0027%s\u0027 function which \""},{"line_number":54,"context_line":"                       \"returns the config options.\" % (mod.__name__,"},{"line_number":55,"context_line":"                       LIST_OPTS_FUNC_NAME))"},{"line_number":56,"context_line":"            raise Exception(msg)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da4df55a_6829e389","line":53,"range":{"start_line":53,"start_character":34,"end_line":53,"end_character":42},"updated":"2016-12-29 01:54:40.000000000","message":"It should be just one placeholder here :)","commit_id":"dce64c1b17e226b8ec7175499ae3147151501a67"}]}
