)]}'
{"dragonflow/db/drivers/etcd_db_driver.py":[{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"f192d27c4251b2e6801c54acbc840786adf5268b","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_53edf523","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"updated":"2016-09-24 02:39:37.000000000","message":"if I pass the empty string arg: \"\", this func will have         IndexError: list index out of range exception","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"5ca9a6c2dd70cb4d91d3fe747e4d04ac39e9f456","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_9f0dbc40","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"in_reply_to":"5a8bc5a2_1f27ecb6","updated":"2016-09-24 11:29:33.000000000","message":"I mean if the remote_db_hosts is a string type and it does not contain \":\", the code will raise a exception, maybe we should do some judgement or protection:)","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"87f26954d487669ba570e91106d2900a639b1a41","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_f3dfbd66","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"in_reply_to":"5a8bc5a2_2a9b6d73","updated":"2016-09-26 10:09:56.000000000","message":"It could be a follow-up patch if someone can update ramcloud/redis.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"9a4d7f87c9b22c7b2e17c301e0d1542f621ec707","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_2a9b6d73","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"in_reply_to":"5a8bc5a2_3a7d96e7","updated":"2016-09-26 07:52:02.000000000","message":"I think ramcloud\\redis\\etcd db driver could reuse this method, zookeeper is just a exception :)","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"1b781d9eebeba080168cc9af1f3f064402d4397a","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_1f27ecb6","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"in_reply_to":"5a8bc5a2_442a897f","updated":"2016-09-24 08:59:07.000000000","message":"it will be translated to [\"\"] as the type of the option is list. And it will be passed to etcd.Client object and an etcd exception will be raised..\n\ndo you think this behavior is not appropriate? what\u0027s your opinion?","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"f5c11699816f839099bcb26d0acb2599fde7c2ed","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_c9d792bd","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"in_reply_to":"5a8bc5a2_53edf523","updated":"2016-09-24 06:58:26.000000000","message":"https://github.com/openstack/dragonflow/blob/master/dragonflow/common/common_params.py#L19-L27\n\nYou have no chance to pass that value.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"7769d4920902ee0070e0dec460ec2e36b8998d82","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_fa8c0e81","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"in_reply_to":"5a8bc5a2_5a0a6222","updated":"2016-09-24 11:52:58.000000000","message":"I think it\u0027s better to move this func into public field, so that multi db drivers could reuse it:)","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"2f526ef4f45682cdd9f9c6a606567e76979093fe","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_5a0a6222","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"in_reply_to":"5a8bc5a2_9f0dbc40","updated":"2016-09-24 11:31:29.000000000","message":"Yes, you are right. I will fix it asap.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"ac6e84aa32a7d120d4398b9fd757dc80d7db89b3","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_442a897f","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"in_reply_to":"5a8bc5a2_c9d792bd","updated":"2016-09-24 07:29:22.000000000","message":"if I have such a config in the config file:\nremote_db_hosts \u003d \"\"\nthe default value is meaningless.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"a16dd309545ecfc7a69f24f16074e4dc95182986","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_3a7d96e7","line":91,"range":{"start_line":91,"start_character":0,"end_line":91,"end_character":24},"in_reply_to":"5a8bc5a2_fa8c0e81","updated":"2016-09-24 12:57:06.000000000","message":"The implementation of this method depends on each driver\u0027s sdk. For example, the logic of zookeeper driver is totally different.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"750196ecd05782c40d7ff52caee959dda2fc478e","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        self.notify_callback \u003d None"},{"line_number":115,"context_line":"        self.pool \u003d eventlet.GreenPool(size\u003d1)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def initialize(self, db_ip, db_port, **args):"},{"line_number":118,"context_line":"        hosts \u003d _parse_hosts(args[\u0027config\u0027].remote_db_hosts)"},{"line_number":119,"context_line":"        self.client \u003d etcd.Client(host\u003dhosts, allow_reconnect\u003dTrue)"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_2ccf4d80","line":117,"range":{"start_line":117,"start_character":24,"end_line":117,"end_character":39},"updated":"2016-09-23 10:54:42.000000000","message":"I think it is better to still use these 2 parameters, for backward compatibility.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"f5c11699816f839099bcb26d0acb2599fde7c2ed","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        self.notify_callback \u003d None"},{"line_number":115,"context_line":"        self.pool \u003d eventlet.GreenPool(size\u003d1)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def initialize(self, db_ip, db_port, **args):"},{"line_number":118,"context_line":"        hosts \u003d _parse_hosts(args[\u0027config\u0027].remote_db_hosts)"},{"line_number":119,"context_line":"        self.client \u003d etcd.Client(host\u003dhosts, allow_reconnect\u003dTrue)"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_89ecaa90","line":117,"range":{"start_line":117,"start_character":24,"end_line":117,"end_character":39},"in_reply_to":"5a8bc5a2_2ccf4d80","updated":"2016-09-24 06:58:26.000000000","message":"This initialize function is not user-faced. So there is no backward compatibility issue.\n\nBy the way, I can also consider the following code as the solution of backward compatibility.\nhttps://github.com/openstack/dragonflow/blob/master/dragonflow/common/common_params.py#L19-L27","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"f192d27c4251b2e6801c54acbc840786adf5268b","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        self.notify_callback \u003d None"},{"line_number":115,"context_line":"        self.pool \u003d eventlet.GreenPool(size\u003d1)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def initialize(self, db_ip, db_port, **args):"},{"line_number":118,"context_line":"        hosts \u003d _parse_hosts(args[\u0027config\u0027].remote_db_hosts)"},{"line_number":119,"context_line":"        self.client \u003d etcd.Client(host\u003dhosts, allow_reconnect\u003dTrue)"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_73a67111","line":117,"range":{"start_line":117,"start_character":24,"end_line":117,"end_character":39},"in_reply_to":"5a8bc5a2_2ccf4d80","updated":"2016-09-24 02:39:37.000000000","message":"why not just keep one manner to connect to df db, use ip:port or args, therefore we could have less configuration.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"ac6e84aa32a7d120d4398b9fd757dc80d7db89b3","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        self.notify_callback \u003d None"},{"line_number":115,"context_line":"        self.pool \u003d eventlet.GreenPool(size\u003d1)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def initialize(self, db_ip, db_port, **args):"},{"line_number":118,"context_line":"        hosts \u003d _parse_hosts(args[\u0027config\u0027].remote_db_hosts)"},{"line_number":119,"context_line":"        self.client \u003d etcd.Client(host\u003dhosts, allow_reconnect\u003dTrue)"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_c43db9bc","line":117,"range":{"start_line":117,"start_character":24,"end_line":117,"end_character":39},"in_reply_to":"5a8bc5a2_69a03e44","updated":"2016-09-24 07:29:22.000000000","message":"I think the remote_db_hosts option is enough to contain all the necessary db connection info(no matter you config the whole cluster node info or just config the entry point single node info), different db drivers could parse and get the info that it want and connect to db successfully.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"f5c11699816f839099bcb26d0acb2599fde7c2ed","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        self.notify_callback \u003d None"},{"line_number":115,"context_line":"        self.pool \u003d eventlet.GreenPool(size\u003d1)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def initialize(self, db_ip, db_port, **args):"},{"line_number":118,"context_line":"        hosts \u003d _parse_hosts(args[\u0027config\u0027].remote_db_hosts)"},{"line_number":119,"context_line":"        self.client \u003d etcd.Client(host\u003dhosts, allow_reconnect\u003dTrue)"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_69a03e44","line":117,"range":{"start_line":117,"start_character":24,"end_line":117,"end_character":39},"in_reply_to":"5a8bc5a2_73a67111","updated":"2016-09-24 06:58:26.000000000","message":"The configuration of cluster is consistent among all the db backends, but it varies from db client library for connection. We need to parse the df configuration in different ways.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"1b781d9eebeba080168cc9af1f3f064402d4397a","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        self.notify_callback \u003d None"},{"line_number":115,"context_line":"        self.pool \u003d eventlet.GreenPool(size\u003d1)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def initialize(self, db_ip, db_port, **args):"},{"line_number":118,"context_line":"        hosts \u003d _parse_hosts(args[\u0027config\u0027].remote_db_hosts)"},{"line_number":119,"context_line":"        self.client \u003d etcd.Client(host\u003dhosts, allow_reconnect\u003dTrue)"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a8bc5a2_3f2ae87e","line":117,"range":{"start_line":117,"start_character":24,"end_line":117,"end_character":39},"in_reply_to":"5a8bc5a2_c43db9bc","updated":"2016-09-24 08:59:07.000000000","message":"got it. I need to wait others\u0027 opinions on removing db-ip and db-port options.","commit_id":"e31110653902fa171eab937d524296e74fa251c6"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"d7fa33fe3e0eb359a6e1864fb9a8df7f4a730a71","unresolved":false,"context_lines":[{"line_number":88,"context_line":"urllib3.HTTPResponse._error_catcher \u003d _error_catcher"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _parse_hosts(hosts):"},{"line_number":92,"context_line":"    if isinstance(hosts, six.string_types):"},{"line_number":93,"context_line":"        host_port \u003d hosts.strip().split(\u0027:\u0027)"},{"line_number":94,"context_line":"        return ((host_port[0], int(host_port[1])))"},{"line_number":95,"context_line":"    if isinstance(hosts, (dict)):"},{"line_number":96,"context_line":"        host_ports \u003d []"},{"line_number":97,"context_line":"        for (h, p) in six.iteritems(hosts):"},{"line_number":98,"context_line":"            host_ports.append((h, int(p)))"},{"line_number":99,"context_line":"        return tuple(host_ports)"},{"line_number":100,"context_line":"    if isinstance(hosts, (list, set, tuple)):"},{"line_number":101,"context_line":"        host_ports \u003d []"},{"line_number":102,"context_line":"        for host_str in hosts:"},{"line_number":103,"context_line":"            host_port \u003d host_str.strip().split(\u0027:\u0027)"},{"line_number":104,"context_line":"            host_ports.append((host_port[0], int(host_port[1])))"},{"line_number":105,"context_line":"        return tuple(host_ports)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"class EtcdDbDriver(db_api.DbApi):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a8bc5a2_84a9f1e1","line":105,"range":{"start_line":91,"start_character":0,"end_line":105,"end_character":32},"updated":"2016-09-24 07:28:58.000000000","message":"I think it\u0027s better to move this func into public field, so that multi db drivers could reuse it:)","commit_id":"4236d7f41a85d69d66307719594f8aef5739a28f"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"6dd5e79b3f31828bf0aa81ce10b6711f588e656f","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        self.pool \u003d eventlet.GreenPool(size\u003d1)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def initialize(self, db_ip, db_port, **args):"},{"line_number":134,"context_line":"        hosts \u003d _parse_hosts(args[\u0027config\u0027].remote_db_hosts)"},{"line_number":135,"context_line":"        if hosts:"},{"line_number":136,"context_line":"            self.client \u003d etcd.Client(host\u003dhosts, allow_reconnect\u003dTrue)"},{"line_number":137,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_95fdf870","line":134,"range":{"start_line":134,"start_character":44,"end_line":134,"end_character":59},"updated":"2016-09-28 09:57:49.000000000","message":"If it is from ListOpt, is there possible to be other types than list of strings?\n\nI see you write a complex _parse_hosts above to cover all the cases. And I doubt its necessity","commit_id":"1fbcd408152c8c7d6e028681cc5a2a5dff1b4266"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"526adee3116c2b29feb758c3ebafc397a3ce66e5","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        self.pool \u003d eventlet.GreenPool(size\u003d1)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def initialize(self, db_ip, db_port, **args):"},{"line_number":134,"context_line":"        hosts \u003d _parse_hosts(args[\u0027config\u0027].remote_db_hosts)"},{"line_number":135,"context_line":"        if hosts:"},{"line_number":136,"context_line":"            self.client \u003d etcd.Client(host\u003dhosts, allow_reconnect\u003dTrue)"},{"line_number":137,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a98d1f4_2a8f5c24","line":134,"range":{"start_line":134,"start_character":44,"end_line":134,"end_character":59},"in_reply_to":"5a8bc5a2_95fdf870","updated":"2016-09-29 02:23:03.000000000","message":"Yes, I copied from somewhere. I\u0027ll fix it soon.","commit_id":"1fbcd408152c8c7d6e028681cc5a2a5dff1b4266"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"bb3c73ee56245da6e10140505074c9c0fb88f81d","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _check_valid_host(host_str):"},{"line_number":92,"context_line":"    return True if \u0027:\u0027 in host_str and host_str[-1] !\u003d \u0027:\u0027 else False"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"def _parse_hosts(hosts):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a98d1f4_2f075c1d","line":92,"updated":"2016-09-29 10:19:18.000000000","message":"nit: Why not just:\nreturn \u0027:\u0027 in host_str and host_str[-1] !\u003d \u0027:\u0027 ?","commit_id":"2b3f0c9be7f2b378c4d835ca4578955f2e8cc836"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"655a8ffa7082d4042a7f50949aa2e61d321da7c1","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def _check_valid_host(host_str):"},{"line_number":92,"context_line":"    return True if \u0027:\u0027 in host_str and host_str[-1] !\u003d \u0027:\u0027 else False"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"def _parse_hosts(hosts):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a98d1f4_702aea7f","line":92,"in_reply_to":"3a98d1f4_2f075c1d","updated":"2016-09-30 05:52:27.000000000","message":"Done","commit_id":"2b3f0c9be7f2b378c4d835ca4578955f2e8cc836"}],"dragonflow/tests/unit/test_l3_router_plugin.py":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"6dd5e79b3f31828bf0aa81ce10b6711f588e656f","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def setUp(self):"},{"line_number":43,"context_line":"        lock_db \u003d mock.patch(\u0027dragonflow.db.neutron.lockedobjects_db\u0027).start()"},{"line_number":44,"context_line":"        lock_db.wrap_db_lock \u003d empty_wrapper"},{"line_number":45,"context_line":"        nbapi_instance \u003d mock.patch(\u0027dragonflow.db.api_nb.NbApi\u0027).start()"},{"line_number":46,"context_line":"        nbapi_instance.get_instance.return_value \u003d mock.MagicMock()"},{"line_number":47,"context_line":"        super(DFL3RouterPluginBase, self).setUp()"},{"line_number":48,"context_line":"        self.l3p \u003d (manager.NeutronManager."},{"line_number":49,"context_line":"                    get_service_plugins()[\u0027L3_ROUTER_NAT\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_75c06ce1","line":46,"range":{"start_line":45,"start_character":0,"end_line":46,"end_character":67},"updated":"2016-09-28 09:57:49.000000000","message":"This is not necessary as nb_api has been faked at line 50.","commit_id":"1fbcd408152c8c7d6e028681cc5a2a5dff1b4266"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"526adee3116c2b29feb758c3ebafc397a3ce66e5","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    def setUp(self):"},{"line_number":43,"context_line":"        lock_db \u003d mock.patch(\u0027dragonflow.db.neutron.lockedobjects_db\u0027).start()"},{"line_number":44,"context_line":"        lock_db.wrap_db_lock \u003d empty_wrapper"},{"line_number":45,"context_line":"        nbapi_instance \u003d mock.patch(\u0027dragonflow.db.api_nb.NbApi\u0027).start()"},{"line_number":46,"context_line":"        nbapi_instance.get_instance.return_value \u003d mock.MagicMock()"},{"line_number":47,"context_line":"        super(DFL3RouterPluginBase, self).setUp()"},{"line_number":48,"context_line":"        self.l3p \u003d (manager.NeutronManager."},{"line_number":49,"context_line":"                    get_service_plugins()[\u0027L3_ROUTER_NAT\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a98d1f4_4abf48d0","line":46,"range":{"start_line":45,"start_character":0,"end_line":46,"end_character":67},"in_reply_to":"5a8bc5a2_75c06ce1","updated":"2016-09-29 02:23:03.000000000","message":"Line 48 initializes the nb_api object first, so line 50 just gets the initialized object from nb_api class.","commit_id":"1fbcd408152c8c7d6e028681cc5a2a5dff1b4266"}],"dragonflow/tests/unit/test_mech_driver.py":[{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"46c3e8a956c308d57ef2d9cae9c785e2672442ab","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def setUp(self):"},{"line_number":45,"context_line":"        super(TestDFMechDriver, self).setUp()"},{"line_number":46,"context_line":"        self.driver \u003d mech_driver.DFMechDriver()"},{"line_number":47,"context_line":"        self.driver.nb_api \u003d mock.Mock()"},{"line_number":48,"context_line":"        self.dbversion \u003d 0"},{"line_number":49,"context_line":"        version_db._create_db_version_row \u003d mock.Mock("}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_d77f08de","line":46,"updated":"2016-09-26 11:34:37.000000000","message":"Could you please help me understand why did you removed this line? Mocking the path of nb_api afterwards wasn\u0027t good enough?","commit_id":"1fbcd408152c8c7d6e028681cc5a2a5dff1b4266"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"e766948379b2e92c72a416705c74fc28b41f2fc2","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def setUp(self):"},{"line_number":45,"context_line":"        super(TestDFMechDriver, self).setUp()"},{"line_number":46,"context_line":"        self.driver \u003d mech_driver.DFMechDriver()"},{"line_number":47,"context_line":"        self.driver.nb_api \u003d mock.Mock()"},{"line_number":48,"context_line":"        self.dbversion \u003d 0"},{"line_number":49,"context_line":"        version_db._create_db_version_row \u003d mock.Mock("}],"source_content_type":"text/x-python","patch_set":4,"id":"5a8bc5a2_e1ac038e","line":46,"in_reply_to":"5a8bc5a2_d77f08de","updated":"2016-09-27 09:10:45.000000000","message":"Firstly, this line is useless in this test case. The initialize function in mech driver will do the nb_api instance initialization which will raise errors.\n\nThe simplest method is to remove this line. And another way is to mock nb_api before the mech driver class is initialized.","commit_id":"1fbcd408152c8c7d6e028681cc5a2a5dff1b4266"}]}
