)]}'
{"dragonflow/db/api_nb.py":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"e0c8aa82ada74afd2ffc4e9f08354f87da71d45a","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @staticmethod"},{"line_number":62,"context_line":"    def get_instance(is_neutron_server\u003dNone):"},{"line_number":63,"context_line":"        \"\"\"This function returns an instance of NbApi (or constructs one on"},{"line_number":64,"context_line":"        first call). The parameter is used only for initial construction of the"},{"line_number":65,"context_line":"        object, so after it was created it can be ommited."},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        global _nb_api"},{"line_number":68,"context_line":"        if _nb_api is None:"},{"line_number":69,"context_line":"            if is_neutron_server is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_ca9d940b","line":66,"range":{"start_line":63,"start_character":0,"end_line":66,"end_character":11},"updated":"2017-01-23 01:13:10.000000000","message":"Is there any usage to this change? How can you make sure the call with parameter comes first?","commit_id":"fa58d162ea5467a4be8914ab7a9e86ef3430587e"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"603206ecb472d329a71db77c8e042bd745895bca","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @staticmethod"},{"line_number":62,"context_line":"    def get_instance(is_neutron_server\u003dNone):"},{"line_number":63,"context_line":"        \"\"\"This function returns an instance of NbApi (or constructs one on"},{"line_number":64,"context_line":"        first call). The parameter is used only for initial construction of the"},{"line_number":65,"context_line":"        object, so after it was created it can be ommited."},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        global _nb_api"},{"line_number":68,"context_line":"        if _nb_api is None:"},{"line_number":69,"context_line":"            if is_neutron_server is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_b04432b7","line":66,"range":{"start_line":63,"start_character":0,"end_line":66,"end_character":11},"in_reply_to":"5a3905b3_ca9d940b","updated":"2017-01-23 08:50:19.000000000","message":"I planned to use this change on L49 here: https://review.openstack.org/#/c/414984/15/dragonflow/db/models2.py\n\nI cannot make sure a call with a parameter comes first, but we construct nb_api quite early.","commit_id":"fa58d162ea5467a4be8914ab7a9e86ef3430587e"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"30dff5286a9dd3b971e662ced27ae46627553bb0","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            self.pub_sub_use_multiproc \u003d cfg.CONF.df.pub_sub_use_multiproc"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @staticmethod"},{"line_number":62,"context_line":"    def get_instance(is_neutron_server\u003dNone):"},{"line_number":63,"context_line":"        \"\"\"This function returns an instance of NbApi (or constructs one on"},{"line_number":64,"context_line":"        first call). The parameter is used only for initial construction of the"},{"line_number":65,"context_line":"        object, so after it was created it can be ommited."},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        global _nb_api"},{"line_number":68,"context_line":"        if _nb_api is None:"},{"line_number":69,"context_line":"            if is_neutron_server is None:"},{"line_number":70,"context_line":"                raise RuntimeError("},{"line_number":71,"context_line":"                    _LE(\u0027NbApi was not initialized yet, cannot get instance\u0027),"},{"line_number":72,"context_line":"                )"},{"line_number":73,"context_line":"            nb_driver \u003d df_utils.load_driver("},{"line_number":74,"context_line":"                cfg.CONF.df.nb_db_class,"},{"line_number":75,"context_line":"                df_utils.DF_NB_DB_DRIVER_NAMESPACE)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a3905b3_cd61e5d4","line":72,"range":{"start_line":62,"start_character":0,"end_line":72,"end_character":17},"updated":"2017-01-24 09:33:35.000000000","message":"I still have some questions:\n\n1) In which case, the parameter can\u0027t be determined? And we need to omit it.\n\n2) Do you mean we will depend on the implicitly order of code execution to make sure we don\u0027t run into error? If so, that is not good to me. This is because \"Explicit is better than implicit.\"\n\n3) In which use case, the RuntimeError should be raised? It looks like this patch create the possibility to raise such exception. And I don\u0027t think that makes sense.","commit_id":"5c49fea85ec2ff0cfac466c5881d8626d8c88f49"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"dab6e9479c2192703fb5e4c4fd6e67fcfaa5bdec","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            self.pub_sub_use_multiproc \u003d cfg.CONF.df.pub_sub_use_multiproc"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @staticmethod"},{"line_number":62,"context_line":"    def get_instance(is_neutron_server\u003dNone):"},{"line_number":63,"context_line":"        \"\"\"This function returns an instance of NbApi (or constructs one on"},{"line_number":64,"context_line":"        first call). The parameter is used only for initial construction of the"},{"line_number":65,"context_line":"        object, so after it was created it can be ommited."},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        global _nb_api"},{"line_number":68,"context_line":"        if _nb_api is None:"},{"line_number":69,"context_line":"            if is_neutron_server is None:"},{"line_number":70,"context_line":"                raise RuntimeError("},{"line_number":71,"context_line":"                    _LE(\u0027NbApi was not initialized yet, cannot get instance\u0027),"},{"line_number":72,"context_line":"                )"},{"line_number":73,"context_line":"            nb_driver \u003d df_utils.load_driver("},{"line_number":74,"context_line":"                cfg.CONF.df.nb_db_class,"},{"line_number":75,"context_line":"                df_utils.DF_NB_DB_DRIVER_NAMESPACE)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a3905b3_f8bbbcc1","line":72,"range":{"start_line":62,"start_character":0,"end_line":72,"end_character":17},"in_reply_to":"5a3905b3_cd61e5d4","updated":"2017-01-24 11:44:47.000000000","message":"1) I\u0027ve linked in PS3 to a use I don\u0027t have direct access to the parameter. Its not only the question of whether it can be determined or not, but whether any code needing nb_api should determine this, especially if that\u0027s not the code responsible for initializing nb_api.\n\n2/3) At the moment df_local_controller does not create a singleton instance but initializes it directly (which I\u0027ll change in upcoming PS). Initializing NbApi is one of the first things done on both service and local controller ends, so if there is code suffering from a RuntimeError it really shouldn\u0027t run that early. And I don\u0027t think its as implicit as you describe, you literally have to make sure its not called in .initialize() section before NbApi construction.\n\nIMO we shouldn\u0027t initialize NbApi in get_instance at all, and leave this to construct_instance(), with the former failing if the latter was not called yet. I don\u0027t mind drafting a patch to change it independently of this patch and the NB refactor patches that rely on it.","commit_id":"5c49fea85ec2ff0cfac466c5881d8626d8c88f49"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"7a09f8af6f1b350f6ba8bbbee2487eefca82d0aa","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            self.pub_sub_use_multiproc \u003d cfg.CONF.df.pub_sub_use_multiproc"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @staticmethod"},{"line_number":62,"context_line":"    def get_instance(is_neutron_server\u003dNone):"},{"line_number":63,"context_line":"        \"\"\"This function returns an instance of NbApi (or constructs one on"},{"line_number":64,"context_line":"        first call). The parameter is used only for initial construction of the"},{"line_number":65,"context_line":"        object, so after it was created it can be ommited."},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        global _nb_api"},{"line_number":68,"context_line":"        if _nb_api is None:"},{"line_number":69,"context_line":"            if is_neutron_server is None:"},{"line_number":70,"context_line":"                raise RuntimeError("},{"line_number":71,"context_line":"                    _LE(\u0027NbApi was not initialized yet, cannot get instance\u0027),"},{"line_number":72,"context_line":"                )"},{"line_number":73,"context_line":"            nb_driver \u003d df_utils.load_driver("},{"line_number":74,"context_line":"                cfg.CONF.df.nb_db_class,"},{"line_number":75,"context_line":"                df_utils.DF_NB_DB_DRIVER_NAMESPACE)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a3905b3_2d289b32","line":72,"range":{"start_line":62,"start_character":0,"end_line":72,"end_character":17},"in_reply_to":"5a3905b3_f8bbbcc1","updated":"2017-01-24 13:55:20.000000000","message":"@dimak, I suggest maybe doing this change independently of the NB refactor, and maybe on top of @rajivk\u0027s change ( https://review.openstack.org/#/c/415997/ ). Then you can also use the construct_instance/get_instance separation idea, and it will be more explicit, since every service must inherit from Service.","commit_id":"5c49fea85ec2ff0cfac466c5881d8626d8c88f49"}],"dragonflow/tests/unit/test_api_nb.py":[{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"3f0f697884f020ac632d42fa629f15b8624e64f6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2015 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":4,"id":"5a3905b3_80816dfd","line":1,"range":{"start_line":1,"start_character":14,"end_line":1,"end_character":20},"updated":"2017-01-24 06:06:24.000000000","message":"2017","commit_id":"5c49fea85ec2ff0cfac466c5881d8626d8c88f49"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"3f0f697884f020ac632d42fa629f15b8624e64f6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2015 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":4,"id":"5a3905b3_e07a3123","line":1,"range":{"start_line":1,"start_character":21,"end_line":1,"end_character":42},"updated":"2017-01-24 06:06:24.000000000","message":"why OS foundation?","commit_id":"5c49fea85ec2ff0cfac466c5881d8626d8c88f49"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"dab6e9479c2192703fb5e4c4fd6e67fcfaa5bdec","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2015 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":4,"id":"5a3905b3_c54ff931","line":1,"range":{"start_line":1,"start_character":21,"end_line":1,"end_character":42},"in_reply_to":"5a3905b3_adad79ea","updated":"2017-01-24 11:44:47.000000000","message":"Will update the year, what should be there in place of Openstack Foundation?","commit_id":"5c49fea85ec2ff0cfac466c5881d8626d8c88f49"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"42886644a3186824dcaddd564eae396df6cbfddf","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2015 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":4,"id":"5a3905b3_fb7e56e2","line":1,"range":{"start_line":1,"start_character":21,"end_line":1,"end_character":42},"in_reply_to":"5a3905b3_c54ff931","updated":"2017-01-24 11:58:49.000000000","message":"you can put Huawei or omit the Copyright, not sure what is more common across dragonflow codebase","commit_id":"5c49fea85ec2ff0cfac466c5881d8626d8c88f49"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"8639411c9cb2f8ea0ee334d6b010ae3051826791","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2015 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":4,"id":"5a3905b3_f9d58b1b","line":1,"range":{"start_line":1,"start_character":21,"end_line":1,"end_character":42},"in_reply_to":"5a3905b3_e07a3123","updated":"2017-01-24 08:09:39.000000000","message":"Just a copy paste, will change if thats an issue","commit_id":"5c49fea85ec2ff0cfac466c5881d8626d8c88f49"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"30dff5286a9dd3b971e662ced27ae46627553bb0","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2015 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":4,"id":"5a3905b3_adad79ea","line":1,"range":{"start_line":1,"start_character":21,"end_line":1,"end_character":42},"in_reply_to":"5a3905b3_f9d58b1b","updated":"2017-01-24 09:33:35.000000000","message":"+1 with irena","commit_id":"5c49fea85ec2ff0cfac466c5881d8626d8c88f49"}]}
