)]}'
{"networking_odl/ml2/mech_driver_v2.py":[{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"0081695b536e0c5fe3aefa0ff17697e25f6ca762","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    }"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":63,"context_line":"        super(OpenDaylightMechanismDriver, self).__init__(nlib_const.CORE,"},{"line_number":64,"context_line":"                                                          *args, **kwargs)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def initialize(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_430e2433","line":63,"range":{"start_line":63,"start_character":58,"end_line":63,"end_character":73},"updated":"2017-12-13 11:23:37.000000000","message":"better target the keyword argument?","commit_id":"5b5ea7d51e6954119bf43b4eeaae3b44a9296a29"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"2ce5cc7e19990ff88432dedeff950df8704e18a3","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    }"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":63,"context_line":"        super(OpenDaylightMechanismDriver, self).__init__("},{"line_number":64,"context_line":"            plugin_type\u003dnlib_const.CORE,"},{"line_number":65,"context_line":"            *args, **kwargs)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def initialize(self):"},{"line_number":68,"context_line":"        LOG.debug(\"Initializing OpenDaylight ML2 driver\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"df87a7cf_c5b72af5","line":65,"range":{"start_line":63,"start_character":58,"end_line":65,"end_character":27},"updated":"2017-12-18 09:50:08.000000000","message":"Correct order is \n\n*args, plugin_type\u003dnlib_const.CORE, **kwargs","commit_id":"5c3b10a23befd4ff16f32e65dee59b0575807d28"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"53a35920c28b6c8ae573a8f5c8b12216e94b40fd","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"@postcommit.add_postcommit(\u0027network\u0027, \u0027subnet\u0027, \u0027port\u0027)"},{"line_number":44,"context_line":"class OpenDaylightMechanismDriver(base_driver.ResourceBaseDriver,"},{"line_number":45,"context_line":"                                  api.MechanismDriver):"},{"line_number":46,"context_line":"    \"\"\"OpenDaylight Python Driver for Neutron."},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9f6a8fd7_c163d119","line":44,"updated":"2018-04-18 09:39:01.000000000","message":"Because of the MRO I think would feel more comfortable with the classes switched in position, is there a reason why it is first?","commit_id":"c1279f72e9a176645e357cae8434efc2f1e55338"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"718d795a1d86ae6c61f9d07c5d3fbf07fcda6e59","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"@postcommit.add_postcommit(\u0027network\u0027, \u0027subnet\u0027, \u0027port\u0027)"},{"line_number":44,"context_line":"class OpenDaylightMechanismDriver(base_driver.ResourceBaseDriver,"},{"line_number":45,"context_line":"                                  api.MechanismDriver):"},{"line_number":46,"context_line":"    \"\"\"OpenDaylight Python Driver for Neutron."},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9f6a8fd7_be04a14b","line":44,"in_reply_to":"9f6a8fd7_0baa3bd1","updated":"2018-04-19 02:39:32.000000000","message":"seems ok, may be it was not the case.","commit_id":"c1279f72e9a176645e357cae8434efc2f1e55338"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6594feae4edcf2814170e93a2f3d414e14a9a828","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"@postcommit.add_postcommit(\u0027network\u0027, \u0027subnet\u0027, \u0027port\u0027)"},{"line_number":44,"context_line":"class OpenDaylightMechanismDriver(base_driver.ResourceBaseDriver,"},{"line_number":45,"context_line":"                                  api.MechanismDriver):"},{"line_number":46,"context_line":"    \"\"\"OpenDaylight Python Driver for Neutron."},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9f6a8fd7_0baa3bd1","line":44,"in_reply_to":"9f6a8fd7_c163d119","updated":"2018-04-18 16:26:05.000000000","message":"Initially, i did it the same way, but it did not work, i have forgotten the reason. So i will update it and see if something comes up.","commit_id":"c1279f72e9a176645e357cae8434efc2f1e55338"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"d4c3bc347b7cdf64ac7d648ae188ff200d09aa92","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        if cfg.CONF.ml2_odl.enable_dhcp_service:"},{"line_number":72,"context_line":"            self.dhcp_driver \u003d dhcp_driver.OdlDhcpDriver()"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"        full_sync.register(nlib_const.CORE, self.RESOURCES)"},{"line_number":75,"context_line":"        odl_features.init()"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def get_workers(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9f6a8fd7_809997d1","line":74,"range":{"start_line":74,"start_character":27,"end_line":74,"end_character":42},"updated":"2018-04-26 16:05:19.000000000","message":"use self.plugin_type here ?","commit_id":"6e9cb606ec837ec5e380703c895132d7f7df6591"}],"networking_odl/tests/unit/journal/helper.py":[{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"525f4122f2140d459477b943b509c9bbbfaab64b","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        \u0027get_security_groups\u0027: ["},{"line_number":99,"context_line":"            {\u0027description\u0027: u\u0027description\u0027,"},{"line_number":100,"context_line":"             \u0027security_group_rules\u0027: [\u0027security_grp_rules\u0027],"},{"line_number":101,"context_line":"             \u0027id\u0027: \u0027test_uuid\u0027, \u0027name\u0027: u\u0027default\u0027}],"},{"line_number":102,"context_line":"        \u0027get_security_group_rules\u0027: ["},{"line_number":103,"context_line":"            {\u0027direction\u0027: \u0027egress\u0027, \u0027protocol\u0027: None,"},{"line_number":104,"context_line":"             \u0027description\u0027: \u0027description\u0027, \u0027port_range_max\u0027: None,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa0c359_a7260568","line":101,"range":{"start_line":101,"start_character":19,"end_line":101,"end_character":30},"updated":"2018-02-15 19:22:02.000000000","message":"can\u0027t you use type uuid here ? there\u0027s a check in neutron code if anything else is used for id\u0027s instead of uuid\u0027s it complains, so to follow same conventions I\u0027d suggest using uuid here.","commit_id":"ca8e2ffd67fa3fbcae6ccb2bbf46d01de7a533b3"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"0fa6fa830fc18f716d69ea99291be930088d6321","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        \u0027get_security_groups\u0027: ["},{"line_number":99,"context_line":"            {\u0027description\u0027: u\u0027description\u0027,"},{"line_number":100,"context_line":"             \u0027security_group_rules\u0027: [\u0027security_grp_rules\u0027],"},{"line_number":101,"context_line":"             \u0027id\u0027: \u0027test_uuid\u0027, \u0027name\u0027: u\u0027default\u0027}],"},{"line_number":102,"context_line":"        \u0027get_security_group_rules\u0027: ["},{"line_number":103,"context_line":"            {\u0027direction\u0027: \u0027egress\u0027, \u0027protocol\u0027: None,"},{"line_number":104,"context_line":"             \u0027description\u0027: \u0027description\u0027, \u0027port_range_max\u0027: None,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa0c359_a95313e2","line":101,"range":{"start_line":101,"start_character":19,"end_line":101,"end_character":30},"in_reply_to":"3fa0c359_a7260568","updated":"2018-02-18 10:30:43.000000000","message":"Done","commit_id":"ca8e2ffd67fa3fbcae6ccb2bbf46d01de7a533b3"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"525f4122f2140d459477b943b509c9bbbfaab64b","unresolved":false,"context_lines":[{"line_number":128,"context_line":"    directory.add_plugin(nlib_const.CORE, plugin)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"def modify_networks(t_networks):"},{"line_number":132,"context_line":"    networks \u003d copy.deepcopy(t_networks)"},{"line_number":133,"context_line":"    networks.append(copy.deepcopy(networks[0]))"},{"line_number":134,"context_line":"    networks[1][\u0027id\u0027] \u003d \u0027test_uuid2\u0027"},{"line_number":135,"context_line":"    return networks"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"def add_side_effect_for_multiple_networks():"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa0c359_27d99521","line":135,"range":{"start_line":131,"start_character":4,"end_line":135,"end_character":19},"updated":"2018-02-15 19:22:02.000000000","message":"this is actually adding an another network to sideeffect, not modifying existing network. may be want to name it correctly","commit_id":"ca8e2ffd67fa3fbcae6ccb2bbf46d01de7a533b3"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"0fa6fa830fc18f716d69ea99291be930088d6321","unresolved":false,"context_lines":[{"line_number":128,"context_line":"    directory.add_plugin(nlib_const.CORE, plugin)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"def modify_networks(t_networks):"},{"line_number":132,"context_line":"    networks \u003d copy.deepcopy(t_networks)"},{"line_number":133,"context_line":"    networks.append(copy.deepcopy(networks[0]))"},{"line_number":134,"context_line":"    networks[1][\u0027id\u0027] \u003d \u0027test_uuid2\u0027"},{"line_number":135,"context_line":"    return networks"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"def add_side_effect_for_multiple_networks():"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa0c359_c94e9f37","line":135,"range":{"start_line":131,"start_character":4,"end_line":135,"end_character":19},"in_reply_to":"3fa0c359_27d99521","updated":"2018-02-18 10:30:43.000000000","message":"Done","commit_id":"ca8e2ffd67fa3fbcae6ccb2bbf46d01de7a533b3"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    driver \u003d type(driver_name,"},{"line_number":61,"context_line":"                  (base_driver.ResourceBaseDriver,) + base_classes,"},{"line_number":62,"context_line":"                  {\u0027RESOURCES\u0027: actual_driver.RESOURCES,"},{"line_number":63,"context_line":"                      \u0027plugin_type\u0027: plugin_type})"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":66,"context_line":"        super(driver, self).__init__(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_b6efb51b","line":63,"range":{"start_line":63,"start_character":48,"end_line":63,"end_character":50},"updated":"2018-02-20 23:17:01.000000000","message":"\u0027__init__\u0027: __init__","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    driver \u003d type(driver_name,"},{"line_number":61,"context_line":"                  (base_driver.ResourceBaseDriver,) + base_classes,"},{"line_number":62,"context_line":"                  {\u0027RESOURCES\u0027: actual_driver.RESOURCES,"},{"line_number":63,"context_line":"                      \u0027plugin_type\u0027: plugin_type})"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":66,"context_line":"        super(driver, self).__init__(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_08fd1a6d","line":63,"range":{"start_line":63,"start_character":48,"end_line":63,"end_character":50},"in_reply_to":"3fa0c359_b6efb51b","updated":"2018-02-21 16:06:48.000000000","message":"Done","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":66,"context_line":"        super(driver, self).__init__(*args, **kwargs)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    driver.__init__ \u003d __init__"},{"line_number":69,"context_line":"    if \u0027get_resources_for_full_sync\u0027 in driver.__dict__:"},{"line_number":70,"context_line":"        driver.get_resources_for_full_sync \u003d \\"},{"line_number":71,"context_line":"            actual_driver.get_resources_for_full_sync"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_f6e9bd19","line":68,"range":{"start_line":68,"start_character":4,"end_line":68,"end_character":30},"updated":"2018-02-20 23:17:01.000000000","message":"this can be merged into the dict of line 62-63.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":66,"context_line":"        super(driver, self).__init__(*args, **kwargs)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    driver.__init__ \u003d __init__"},{"line_number":69,"context_line":"    if \u0027get_resources_for_full_sync\u0027 in driver.__dict__:"},{"line_number":70,"context_line":"        driver.get_resources_for_full_sync \u003d \\"},{"line_number":71,"context_line":"            actual_driver.get_resources_for_full_sync"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_c8fad273","line":68,"range":{"start_line":68,"start_character":4,"end_line":68,"end_character":30},"in_reply_to":"3fa0c359_f6e9bd19","updated":"2018-02-21 16:06:48.000000000","message":"Done","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        super(driver, self).__init__(*args, **kwargs)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    driver.__init__ \u003d __init__"},{"line_number":69,"context_line":"    if \u0027get_resources_for_full_sync\u0027 in driver.__dict__:"},{"line_number":70,"context_line":"        driver.get_resources_for_full_sync \u003d \\"},{"line_number":71,"context_line":"            actual_driver.get_resources_for_full_sync"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_963959d8","line":69,"range":{"start_line":69,"start_character":7,"end_line":69,"end_character":56},"updated":"2018-02-20 23:17:01.000000000","message":"hasatter(driver, \u0027get_resource_for_full_sync\u0027:","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        super(driver, self).__init__(*args, **kwargs)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    driver.__init__ \u003d __init__"},{"line_number":69,"context_line":"    if \u0027get_resources_for_full_sync\u0027 in driver.__dict__:"},{"line_number":70,"context_line":"        driver.get_resources_for_full_sync \u003d \\"},{"line_number":71,"context_line":"            actual_driver.get_resources_for_full_sync"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_4896c2f2","line":69,"range":{"start_line":69,"start_character":7,"end_line":69,"end_character":56},"in_reply_to":"3fa0c359_963959d8","updated":"2018-02-21 16:06:48.000000000","message":"hasattr will always find it in base[inheritance search], just to avoid it and let actual inheritance take place, I did it. Which is more closer to our driver.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    driver.__init__ \u003d __init__"},{"line_number":69,"context_line":"    if \u0027get_resources_for_full_sync\u0027 in driver.__dict__:"},{"line_number":70,"context_line":"        driver.get_resources_for_full_sync \u003d \\"},{"line_number":71,"context_line":"            actual_driver.get_resources_for_full_sync"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    return driver"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_f6145da2","line":71,"range":{"start_line":70,"start_character":0,"end_line":71,"end_character":53},"updated":"2018-02-20 23:17:01.000000000","message":"This is also set as dict at line 62-63.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    driver.__init__ \u003d __init__"},{"line_number":69,"context_line":"    if \u0027get_resources_for_full_sync\u0027 in driver.__dict__:"},{"line_number":70,"context_line":"        driver.get_resources_for_full_sync \u003d \\"},{"line_number":71,"context_line":"            actual_driver.get_resources_for_full_sync"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    return driver"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_28d336d7","line":71,"range":{"start_line":70,"start_character":0,"end_line":71,"end_character":53},"in_reply_to":"3fa0c359_f6145da2","updated":"2018-02-21 16:06:48.000000000","message":"this is done on condition basis, if it is moved to 62-63 then It will fetch default implementation from the Base, so inheritance searching could not be tested that way.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    return driver"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"def get_genric_method_accept_1_arg_return(value):"},{"line_number":77,"context_line":"    return lambda x: value"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_76d04d20","line":76,"range":{"start_line":76,"start_character":8,"end_line":76,"end_character":14},"updated":"2018-02-20 23:17:01.000000000","message":"typo: genric -\u003e generic.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    return lambda x: value"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"def get_genric_method_accept_2_arg_return(value):"},{"line_number":81,"context_line":"    def generic_method(self, id_):"},{"line_number":82,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":83,"context_line":"        t_value[\u0027id\u0027] \u003d id_"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_96cdd986","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":14},"updated":"2018-02-20 23:17:01.000000000","message":"generic","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    return lambda x: value"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"def get_genric_method_accept_2_arg_return(value):"},{"line_number":81,"context_line":"    def generic_method(self, id_):"},{"line_number":82,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":83,"context_line":"        t_value[\u0027id\u0027] \u003d id_"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_68529e3d","line":80,"range":{"start_line":80,"start_character":8,"end_line":80,"end_character":14},"in_reply_to":"3fa0c359_96cdd986","updated":"2018-02-21 16:06:48.000000000","message":"Done","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def create_plugin(plugin, method_details):"},{"line_number":90,"context_line":"    for name, value in method_details.items():"},{"line_number":91,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":92,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":93,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_36c6456a","line":91,"range":{"start_line":91,"start_character":30,"end_line":91,"end_character":73},"updated":"2018-02-20 23:17:01.000000000","message":"Is get_generic_method_accept_1_arg_return used elsewhere?\nIf no, just we can open code here as \"lambda x: value\"","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def create_plugin(plugin, method_details):"},{"line_number":90,"context_line":"    for name, value in method_details.items():"},{"line_number":91,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":92,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":93,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_e80b0e27","line":91,"range":{"start_line":91,"start_character":30,"end_line":91,"end_character":73},"in_reply_to":"3fa0c359_36c6456a","updated":"2018-02-21 16:06:48.000000000","message":"I tried to do it this way only, but program suffered from following issue\n\n\u003e\u003e\u003e f \u003d []\n\u003e\u003e\u003e for x in range(10):\n...   f.append(lambda y: x)\n... \n\u003e\u003e\u003e [func(2) for func in f]\n[9, 9, 9, 9, 9, 9, 9, 9, 9, 9]\n\u003e\u003e\u003e","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"20f6b1b0d6724021886050943a356668ab9d226a","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"def create_plugin(plugin, method_details):"},{"line_number":90,"context_line":"    for name, value in method_details.items():"},{"line_number":91,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":92,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":93,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_df003b05","line":91,"range":{"start_line":91,"start_character":30,"end_line":91,"end_character":73},"in_reply_to":"3fa0c359_e80b0e27","updated":"2018-02-21 23:06:51.000000000","message":"Oh, it\u0027s late binding.\nIn this case, we can code it as\nlambda x, value\u003dvalue: return value\nto create new binding in lambda scope.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    for name, value in method_details.items():"},{"line_number":91,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":92,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":93,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def get_method_details():"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_16a789bf","line":93,"range":{"start_line":93,"start_character":16,"end_line":93,"end_character":61},"updated":"2018-02-20 23:17:01.000000000","message":"is get_genric_method_accept_2_arg_return used elsewhere?\nif no, we can just open code \"def generic_method(self, id_):...\nin this method.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    for name, value in method_details.items():"},{"line_number":91,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":92,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":93,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def get_method_details():"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_a8018608","line":93,"range":{"start_line":93,"start_character":16,"end_line":93,"end_character":61},"in_reply_to":"3fa0c359_16a789bf","updated":"2018-02-21 16:06:48.000000000","message":"same as above","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"20f6b1b0d6724021886050943a356668ab9d226a","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    for name, value in method_details.items():"},{"line_number":91,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":92,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":93,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def get_method_details():"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_4a1eab5f","line":93,"range":{"start_line":93,"start_character":16,"end_line":93,"end_character":61},"in_reply_to":"3fa0c359_a8018608","updated":"2018-02-21 23:06:51.000000000","message":"def generic_method(self, id_, value\u003dvalue):\n    t_value \u003d copy.deepcopy(value[0])\n    t_value[\u0027id\u0027] \u003d id_\n    return t_value  \nsetattr(plugin, name{:-1], generic_method)","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def get_method_details():"},{"line_number":97,"context_line":"    return {"},{"line_number":98,"context_line":"        \u0027get_security_groups\u0027: ["},{"line_number":99,"context_line":"            {\u0027description\u0027: u\u0027description\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_767e0d1a","line":96,"range":{"start_line":96,"start_character":0,"end_line":96,"end_character":25},"updated":"2018-02-20 23:17:01.000000000","message":"do we need method?\ncan\u0027t we just define constant of dict?\nsomething like\nMETHOD_DETAILS \u003d { ... }\n\nGiven the usage this method, the following method would be better.\n\ndef get_resource(resource):\n    return _METHOD_DETAILS[\u0027get_%ss\u0027 % resource]","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"20f6b1b0d6724021886050943a356668ab9d226a","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def get_method_details():"},{"line_number":97,"context_line":"    return {"},{"line_number":98,"context_line":"        \u0027get_security_groups\u0027: ["},{"line_number":99,"context_line":"            {\u0027description\u0027: u\u0027description\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_ca315bef","line":96,"range":{"start_line":96,"start_character":0,"end_line":96,"end_character":25},"in_reply_to":"3fa0c359_3bd4de1f","updated":"2018-02-21 23:06:51.000000000","message":"Oh gotcha.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def get_method_details():"},{"line_number":97,"context_line":"    return {"},{"line_number":98,"context_line":"        \u0027get_security_groups\u0027: ["},{"line_number":99,"context_line":"            {\u0027description\u0027: u\u0027description\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_3bd4de1f","line":96,"range":{"start_line":96,"start_character":0,"end_line":96,"end_character":25},"in_reply_to":"3fa0c359_767e0d1a","updated":"2018-02-21 16:06:48.000000000","message":"I used it this way because, it is a dictionary and can be mutated by some of the tests and it might affect other test cases later on. This way, this method always returns the same dictionary.\n\nBecause currently no one modify it, i will change it as per your comment.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                  nlib_const.CORE)()"},{"line_number":125,"context_line":"    plugin \u003d mock.Mock()"},{"line_number":126,"context_line":"    method_details \u003d get_method_details()"},{"line_number":127,"context_line":"    create_plugin(plugin, method_details)"},{"line_number":128,"context_line":"    directory.add_plugin(nlib_const.CORE, plugin)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_76284de1","line":127,"range":{"start_line":127,"start_character":18,"end_line":127,"end_character":24},"updated":"2018-02-20 23:17:01.000000000","message":"is always mock used?\nIf so, line 125 can be pushed down into create_plugin.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                  nlib_const.CORE)()"},{"line_number":125,"context_line":"    plugin \u003d mock.Mock()"},{"line_number":126,"context_line":"    method_details \u003d get_method_details()"},{"line_number":127,"context_line":"    create_plugin(plugin, method_details)"},{"line_number":128,"context_line":"    directory.add_plugin(nlib_const.CORE, plugin)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_bb41ce3b","line":127,"range":{"start_line":127,"start_character":18,"end_line":127,"end_character":24},"in_reply_to":"3fa0c359_76284de1","updated":"2018-02-21 16:06:48.000000000","message":"this plugin is being used at line 128 therefore it is kept in separate variable.","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"e91c3e4a69d51031990a1273e05f258e1bd4b8fb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"3fa0c359_fcc5f35c","updated":"2018-02-22 14:43:22.000000000","message":"Is it just me or the test helpers are unclear in nature? I feel like this will complicated to maintain going forward.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"380a88584aed2c027928bfc4d4147738a48bc9ee","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"3fa0c359_744e9a6f","in_reply_to":"3fa0c359_633eed8b","updated":"2018-02-26 14:41:43.000000000","message":"You are mocking quite a lot and recreating exact conditions that are tightly coupled to the implementation. This in it on itself might complicate maintainability.\n\nAnd it\u0027s unclear because it\u0027s not self explanatory why you are doing the things you are in the way you are.\n\nForget about your knowledge on this and your \"marriage\" to the code decisions you took. For example, if you read `create_driver`, does that code make sense to you?","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"ef6bf0e31d10b109bb9b88080763ca69781daaac","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"3fa0c359_44840d0b","in_reply_to":"3fa0c359_744e9a6f","updated":"2018-02-26 17:31:22.000000000","message":"\u003e You are mocking quite a lot and recreating exact conditions that are tightly coupled to the implementation. This in it on itself might complicate maintainability.\n\nyes, i am mocking a lot of things, because full sync interacts with lot of outside things, which has to be mocked. I would like to hear ideas to avoid mocking.\n\n\u003e Forget about your knowledge on this and your \"marriage\" to the code decisions you took.\n\nSure, i would like to forget my knowledge. But i must understand the problem with existing knowledge to save my future effort.\n\n\u003e For example, if you read `create_driver`, does that code make sense to you.\n\u003e And it\u0027s unclear because it\u0027s not self explanatory why you are doing the things you are in the way you are.\n\nI agree specifically on \"create_driver\" part, because if i don\u0027t do that way and use actual ML2 driver to keep it self explanatory then i have to mock or add fixture for\n1. opendaylight fixture\n2. opendaylight journal\n3. pseudo agent \n\nand more. It will go on for the remaining drivers as well.\n\nWhich will add to complexity and in turn maintainability.\nI chose to keep driver simple and avoiding lot of mocking. \n\nOf course changing method name to something like \"create_dummy_driver\" and adding enough comments could be considered.\n\nOf course, as usual, i am always open for new ideas and discussions.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"77a725ab6bf20d9d13b02cc21875a779a35d3225","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"3fa0c359_633eed8b","in_reply_to":"3fa0c359_fcc5f35c","updated":"2018-02-26 11:20:22.000000000","message":"Is it just me or the test helpers are unclear in nature?\n\n\u003e Could you please elaborate on this, what is unclear?\n\nI feel like this will complicated to maintain going forward.\n\n\u003e Could you please elaborate on this, how it will complicate things?","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"e91c3e4a69d51031990a1273e05f258e1bd4b8fb","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    return driver"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"def get_genric_method_accept_1_arg_return(value):"},{"line_number":105,"context_line":"    return lambda x: value"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_bc376bb0","line":104,"range":{"start_line":104,"start_character":8,"end_line":104,"end_character":14},"updated":"2018-02-22 14:43:22.000000000","message":"nit: missing an \u0027e\u0027","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"77a725ab6bf20d9d13b02cc21875a779a35d3225","unresolved":false,"context_lines":[{"line_number":101,"context_line":"    return driver"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"def get_genric_method_accept_1_arg_return(value):"},{"line_number":105,"context_line":"    return lambda x: value"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_c364a1bb","line":104,"range":{"start_line":104,"start_character":8,"end_line":104,"end_character":14},"in_reply_to":"3fa0c359_bc376bb0","updated":"2018-02-26 11:20:22.000000000","message":"Done","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"e91c3e4a69d51031990a1273e05f258e1bd4b8fb","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    return lambda x: value"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"def get_genric_method_accept_2_arg_return(value):"},{"line_number":109,"context_line":"    def generic_method(self, id_):"},{"line_number":110,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":111,"context_line":"        t_value[\u0027id\u0027] \u003d id_"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_fc5093d7","line":108,"range":{"start_line":108,"start_character":8,"end_line":108,"end_character":14},"updated":"2018-02-22 14:43:22.000000000","message":"nit: missing an \u0027e\u0027","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"77a725ab6bf20d9d13b02cc21875a779a35d3225","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    return lambda x: value"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"def get_genric_method_accept_2_arg_return(value):"},{"line_number":109,"context_line":"    def generic_method(self, id_):"},{"line_number":110,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":111,"context_line":"        t_value[\u0027id\u0027] \u003d id_"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_034da939","line":108,"range":{"start_line":108,"start_character":8,"end_line":108,"end_character":14},"in_reply_to":"3fa0c359_fc5093d7","updated":"2018-02-26 11:20:22.000000000","message":"Done","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"eb10ce858ed5b8ff332a1b785b9cc2765775a5b5","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    return lambda x: value"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"def get_genric_method_accept_2_arg_return(value):"},{"line_number":109,"context_line":"    def generic_method(self, id_):"},{"line_number":110,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":111,"context_line":"        t_value[\u0027id\u0027] \u003d id_"},{"line_number":112,"context_line":"        return t_value"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    return generic_method"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def create_plugin(plugin):"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_8a6033a7","line":114,"range":{"start_line":108,"start_character":0,"end_line":114,"end_character":25},"updated":"2018-02-21 23:25:58.000000000","message":"It\u0027s a matter of preference to use function or default argument.\n\nPlease use one of line 108 or 117. and remove other.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"9726eb904c5b4e223c6afd12e86988fe6c5f04a3","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    return lambda x: value"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"def get_genric_method_accept_2_arg_return(value):"},{"line_number":109,"context_line":"    def generic_method(self, id_):"},{"line_number":110,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":111,"context_line":"        t_value[\u0027id\u0027] \u003d id_"},{"line_number":112,"context_line":"        return t_value"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    return generic_method"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def create_plugin(plugin):"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_3a6e0a00","line":114,"range":{"start_line":108,"start_character":0,"end_line":114,"end_character":25},"in_reply_to":"3fa0c359_8a6033a7","updated":"2018-02-22 14:00:28.000000000","message":"Done","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"eb10ce858ed5b8ff332a1b785b9cc2765775a5b5","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def create_plugin(plugin):"},{"line_number":118,"context_line":"    def generic_method(self, id_):"},{"line_number":119,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":120,"context_line":"        t_value[\u0027id\u0027] \u003d id_"},{"line_number":121,"context_line":"        return t_value"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_cabb9b0c","line":118,"range":{"start_line":118,"start_character":4,"end_line":118,"end_character":34},"updated":"2018-02-21 23:25:58.000000000","message":"def generic_method(self, id_, value\u003dvalue):\nand move this into line 125.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"9726eb904c5b4e223c6afd12e86988fe6c5f04a3","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def create_plugin(plugin):"},{"line_number":118,"context_line":"    def generic_method(self, id_):"},{"line_number":119,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":120,"context_line":"        t_value[\u0027id\u0027] \u003d id_"},{"line_number":121,"context_line":"        return t_value"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_1a69cef6","line":118,"range":{"start_line":118,"start_character":4,"end_line":118,"end_character":34},"in_reply_to":"3fa0c359_cabb9b0c","updated":"2018-02-22 14:00:28.000000000","message":"Then signature of this method will differ from the method we are mocking, it might mask some of the errors.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"e91c3e4a69d51031990a1273e05f258e1bd4b8fb","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def create_plugin(plugin):"},{"line_number":118,"context_line":"    def generic_method(self, id_):"},{"line_number":119,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":120,"context_line":"        t_value[\u0027id\u0027] \u003d id_"},{"line_number":121,"context_line":"        return t_value"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    for name, value in _METHOD_DETAILS.items():"},{"line_number":124,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_7c248360","line":121,"range":{"start_line":118,"start_character":4,"end_line":121,"end_character":22},"updated":"2018-02-22 14:43:22.000000000","message":"Why repeating same code as L109?","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"77a725ab6bf20d9d13b02cc21875a779a35d3225","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"def create_plugin(plugin):"},{"line_number":118,"context_line":"    def generic_method(self, id_):"},{"line_number":119,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":120,"context_line":"        t_value[\u0027id\u0027] \u003d id_"},{"line_number":121,"context_line":"        return t_value"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    for name, value in _METHOD_DETAILS.items():"},{"line_number":124,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_e3519dda","line":121,"range":{"start_line":118,"start_character":4,"end_line":121,"end_character":22},"in_reply_to":"3fa0c359_7c248360","updated":"2018-02-26 11:20:22.000000000","message":"Done","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"eb10ce858ed5b8ff332a1b785b9cc2765775a5b5","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        return t_value"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    for name, value in _METHOD_DETAILS.items():"},{"line_number":124,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":125,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":126,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_aa65efb6","line":124,"range":{"start_line":124,"start_character":30,"end_line":124,"end_character":74},"updated":"2018-02-21 23:25:58.000000000","message":"lambda x, value\u003dvalue: value","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"9726eb904c5b4e223c6afd12e86988fe6c5f04a3","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        return t_value"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    for name, value in _METHOD_DETAILS.items():"},{"line_number":124,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":125,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":126,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_5a63d61a","line":124,"range":{"start_line":124,"start_character":30,"end_line":124,"end_character":74},"in_reply_to":"3fa0c359_aa65efb6","updated":"2018-02-22 14:00:28.000000000","message":"Then signature of this method will differ from the method we are mocking, it might mask some of the errors.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"eb10ce858ed5b8ff332a1b785b9cc2765775a5b5","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    create_driver(\u0027FakeML2Driver\u0027, (),"},{"line_number":131,"context_line":"                  mech_driver_v2.OpenDaylightMechanismDriver,"},{"line_number":132,"context_line":"                  nlib_const.CORE)()"},{"line_number":133,"context_line":"    plugin \u003d mock.Mock()"},{"line_number":134,"context_line":"    create_plugin(plugin)"},{"line_number":135,"context_line":"    directory.add_plugin(nlib_const.CORE, plugin)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_eafbf7ba","line":134,"range":{"start_line":133,"start_character":0,"end_line":134,"end_character":25},"updated":"2018-02-21 23:25:58.000000000","message":"Is plugin argument always mock?\nif so,\ndef create_plugin():\n   plugin \u003d mock.Mock()\n   ...\n   return plugin\n\nand\n\nplugin \u003d create_plugin()","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"9726eb904c5b4e223c6afd12e86988fe6c5f04a3","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    create_driver(\u0027FakeML2Driver\u0027, (),"},{"line_number":131,"context_line":"                  mech_driver_v2.OpenDaylightMechanismDriver,"},{"line_number":132,"context_line":"                  nlib_const.CORE)()"},{"line_number":133,"context_line":"    plugin \u003d mock.Mock()"},{"line_number":134,"context_line":"    create_plugin(plugin)"},{"line_number":135,"context_line":"    directory.add_plugin(nlib_const.CORE, plugin)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_4d76c2a6","line":134,"range":{"start_line":133,"start_character":0,"end_line":134,"end_character":25},"in_reply_to":"3fa0c359_eafbf7ba","updated":"2018-02-22 14:00:28.000000000","message":"okay will do it.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"eb10ce858ed5b8ff332a1b785b9cc2765775a5b5","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def add_side_effect_for_ml2():"},{"line_number":130,"context_line":"    create_driver(\u0027FakeML2Driver\u0027, (),"},{"line_number":131,"context_line":"                  mech_driver_v2.OpenDaylightMechanismDriver,"},{"line_number":132,"context_line":"                  nlib_const.CORE)()"},{"line_number":133,"context_line":"    plugin \u003d mock.Mock()"},{"line_number":134,"context_line":"    create_plugin(plugin)"},{"line_number":135,"context_line":"    directory.add_plugin(nlib_const.CORE, plugin)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"def add_network(t_networks):"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_2a923f58","line":135,"range":{"start_line":129,"start_character":0,"end_line":135,"end_character":49},"updated":"2018-02-21 23:25:58.000000000","message":"In order to not forget cleanup, how about\ndef add_side_effect_for_ml2(testcase):\n    ...\n    testcase.addCleanup(cleanup_side_effect)","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"d6232a450d4c2c892dcd666e456e9affcd43c7d0","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        super(TestDriver, self).__init__()"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def get_resource(resource):"},{"line_number":84,"context_line":"    return _METHOD_DETAILS[METHOD_NAME_STR % resource]"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def create_driver(driver_name, base_classes, actual_driver, plugin_type):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3fa0c359_24cea12c","line":84,"range":{"start_line":83,"start_character":0,"end_line":84,"end_character":54},"updated":"2018-02-26 19:12:10.000000000","message":"this one liner can be avoided, is less of help and adds more complexity.","commit_id":"03d0ba75c121ccbabe41cc9e01213ade7f256961"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"32b99643c3fc34e2a0927b1cf5a461193866cdbf","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        super(TestDriver, self).__init__()"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def get_resource(resource):"},{"line_number":84,"context_line":"    return _METHOD_DETAILS[METHOD_NAME_STR % resource]"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def create_driver(driver_name, base_classes, actual_driver, plugin_type):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3fa0c359_cb74a86a","line":84,"range":{"start_line":83,"start_character":0,"end_line":84,"end_character":54},"in_reply_to":"3fa0c359_24cea12c","updated":"2018-02-27 02:57:27.000000000","message":"It has been used multiple times, it makes sense to divide it into separate method. Please go through previous patch comments for the discussion.","commit_id":"03d0ba75c121ccbabe41cc9e01213ade7f256961"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"53a35920c28b6c8ae573a8f5c8b12216e94b40fd","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":89,"context_line":"        super(driver, self).__init__(*args, **kwargs)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    driver \u003d type(driver_name,"},{"line_number":92,"context_line":"                  (base_driver.ResourceBaseDriver,) + base_classes,"},{"line_number":93,"context_line":"                  {\u0027RESOURCES\u0027: actual_driver.RESOURCES,"},{"line_number":94,"context_line":"                      \u0027plugin_type\u0027: plugin_type,"}],"source_content_type":"text/x-python","patch_set":12,"id":"bf659307_74d4b6e9","line":91,"updated":"2018-04-18 09:39:01.000000000","message":"As far as I see there is no need to use type, when you are only using create_driver in one place (L128) and you are anyways calling it with base_classes\u003d()","commit_id":"03d0ba75c121ccbabe41cc9e01213ade7f256961"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"d6232a450d4c2c892dcd666e456e9affcd43c7d0","unresolved":false,"context_lines":[{"line_number":108,"context_line":"def get_genric_method_accept_2_arg_return(value):"},{"line_number":109,"context_line":"    def generic_method(self, id_):"},{"line_number":110,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":111,"context_line":"        t_value[\u0027id\u0027] \u003d id_"},{"line_number":112,"context_line":"        return t_value"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    return generic_method"}],"source_content_type":"text/x-python","patch_set":12,"id":"3fa0c359_b7142142","line":111,"range":{"start_line":111,"start_character":6,"end_line":111,"end_character":27},"updated":"2018-02-26 19:12:10.000000000","message":"what\u0027s the point of overwriting id in a copied value ?","commit_id":"03d0ba75c121ccbabe41cc9e01213ade7f256961"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"32b99643c3fc34e2a0927b1cf5a461193866cdbf","unresolved":false,"context_lines":[{"line_number":108,"context_line":"def get_genric_method_accept_2_arg_return(value):"},{"line_number":109,"context_line":"    def generic_method(self, id_):"},{"line_number":110,"context_line":"        t_value \u003d copy.deepcopy(value[0])"},{"line_number":111,"context_line":"        t_value[\u0027id\u0027] \u003d id_"},{"line_number":112,"context_line":"        return t_value"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    return generic_method"}],"source_content_type":"text/x-python","patch_set":12,"id":"3fa0c359_2b418c0a","line":111,"range":{"start_line":111,"start_character":6,"end_line":111,"end_character":27},"in_reply_to":"3fa0c359_b7142142","updated":"2018-02-27 02:57:27.000000000","message":"Because this method returns a resource based on the id. I have passed sample resource through enclosing scope[which might not have the same id, while fetching through this method later]. If a method returns a resource using id then returned resource must have the same id. That\u0027s why it is being copied.","commit_id":"03d0ba75c121ccbabe41cc9e01213ade7f256961"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"d6232a450d4c2c892dcd666e456e9affcd43c7d0","unresolved":false,"context_lines":[{"line_number":117,"context_line":"def create_plugin():"},{"line_number":118,"context_line":"    plugin \u003d mock.Mock()"},{"line_number":119,"context_line":"    for name, value in _METHOD_DETAILS.items():"},{"line_number":120,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":121,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":122,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3fa0c359_e42519c3","line":120,"range":{"start_line":120,"start_character":30,"end_line":120,"end_character":74},"updated":"2018-02-26 19:12:10.000000000","message":"tbh, one liner is not making much sense, why not directly have lambda x: value here ?","commit_id":"03d0ba75c121ccbabe41cc9e01213ade7f256961"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"32b99643c3fc34e2a0927b1cf5a461193866cdbf","unresolved":false,"context_lines":[{"line_number":117,"context_line":"def create_plugin():"},{"line_number":118,"context_line":"    plugin \u003d mock.Mock()"},{"line_number":119,"context_line":"    for name, value in _METHOD_DETAILS.items():"},{"line_number":120,"context_line":"        setattr(plugin, name, get_genric_method_accept_1_arg_return(value))"},{"line_number":121,"context_line":"        setattr(plugin, name[:-1],"},{"line_number":122,"context_line":"                get_genric_method_accept_2_arg_return(value))"},{"line_number":123,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3fa0c359_ebd8847f","line":120,"range":{"start_line":120,"start_character":30,"end_line":120,"end_character":74},"in_reply_to":"3fa0c359_e42519c3","updated":"2018-02-27 02:57:27.000000000","message":"Lambda suffers from late binding issue here. It will take the last \"value\".","commit_id":"03d0ba75c121ccbabe41cc9e01213ade7f256961"}],"networking_odl/tests/unit/journal/test_full_sync.py":[{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"525f4122f2140d459477b943b509c9bbbfaab64b","unresolved":false,"context_lines":[{"line_number":501,"context_line":"                                   network[\u0027id\u0027],"},{"line_number":502,"context_line":"                                   odl_const.ODL_CREATE, network))"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"        mock_record.assert_has_calls(calls)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa0c359_a70cc594","line":504,"range":{"start_line":504,"start_character":8,"end_line":504,"end_character":43},"updated":"2018-02-15 19:22:02.000000000","message":"additionally as modify_network adds a another network to list of one hard code network, here call count can also be asserted\n\nassertEqual(2, mock_record.call_count) ?","commit_id":"ca8e2ffd67fa3fbcae6ccb2bbf46d01de7a533b3"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"0fa6fa830fc18f716d69ea99291be930088d6321","unresolved":false,"context_lines":[{"line_number":501,"context_line":"                                   network[\u0027id\u0027],"},{"line_number":502,"context_line":"                                   odl_const.ODL_CREATE, network))"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"        mock_record.assert_has_calls(calls)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa0c359_09456715","line":504,"range":{"start_line":504,"start_character":8,"end_line":504,"end_character":43},"in_reply_to":"3fa0c359_a70cc594","updated":"2018-02-18 10:30:43.000000000","message":"Done","commit_id":"ca8e2ffd67fa3fbcae6ccb2bbf46d01de7a533b3"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9ebbf9f512632a731b8399ae891315965dacae3b","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        helper.add_side_effect_for_multiple_networks()"},{"line_number":493,"context_line":"        self.addCleanup(helper.cleanup_side_effect)"},{"line_number":494,"context_line":"        full_sync.sync_resources(self.db_context, odl_const.ODL_NETWORK)"},{"line_number":495,"context_line":"        networks \u003d helper.get_method_details()[\u0027get_networks\u0027]"},{"line_number":496,"context_line":"        networks \u003d helper.add_network(networks)"},{"line_number":497,"context_line":"        calls \u003d []"},{"line_number":498,"context_line":"        for network in networks:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_d6360152","line":495,"range":{"start_line":495,"start_character":26,"end_line":495,"end_character":62},"updated":"2018-02-20 23:17:01.000000000","message":"get_method_details() and [] is used as paired.\nso the following method would be better for modularity.\n\ndef helper.get_resource(resource):\n   return _DICT_METHOD_DETAILS[_METHOD_NAME_STR % resource]","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6815c51db0735b147b4171e6e3271142b823345d","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        helper.add_side_effect_for_multiple_networks()"},{"line_number":493,"context_line":"        self.addCleanup(helper.cleanup_side_effect)"},{"line_number":494,"context_line":"        full_sync.sync_resources(self.db_context, odl_const.ODL_NETWORK)"},{"line_number":495,"context_line":"        networks \u003d helper.get_method_details()[\u0027get_networks\u0027]"},{"line_number":496,"context_line":"        networks \u003d helper.add_network(networks)"},{"line_number":497,"context_line":"        calls \u003d []"},{"line_number":498,"context_line":"        for network in networks:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3fa0c359_db7b7a25","line":495,"range":{"start_line":495,"start_character":26,"end_line":495,"end_character":62},"in_reply_to":"3fa0c359_d6360152","updated":"2018-02-21 16:06:48.000000000","message":"Done","commit_id":"47997139ae88758595de6e48aeec0606b622a89c"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"e91c3e4a69d51031990a1273e05f258e1bd4b8fb","unresolved":false,"context_lines":[{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    @mock.patch.object(journal, \u0027record\u0027)"},{"line_number":477,"context_line":"    def test_full_sync_ml2(self, mock_record):"},{"line_number":478,"context_line":"        helper.add_side_effect_for_ml2()"},{"line_number":479,"context_line":"        self.addCleanup(helper.cleanup_side_effect)"},{"line_number":480,"context_line":"        for resource in mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES:"},{"line_number":481,"context_line":"            full_sync.sync_resources(self.db_context, resource)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_1c71bf44","line":478,"range":{"start_line":478,"start_character":8,"end_line":478,"end_character":40},"updated":"2018-02-22 14:43:22.000000000","message":"Perhaps this would be nice if it was a context or a decorator","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"77a725ab6bf20d9d13b02cc21875a779a35d3225","unresolved":false,"context_lines":[{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    @mock.patch.object(journal, \u0027record\u0027)"},{"line_number":477,"context_line":"    def test_full_sync_ml2(self, mock_record):"},{"line_number":478,"context_line":"        helper.add_side_effect_for_ml2()"},{"line_number":479,"context_line":"        self.addCleanup(helper.cleanup_side_effect)"},{"line_number":480,"context_line":"        for resource in mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES:"},{"line_number":481,"context_line":"            full_sync.sync_resources(self.db_context, resource)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_5dd149cb","line":478,"range":{"start_line":478,"start_character":8,"end_line":478,"end_character":40},"in_reply_to":"3fa0c359_1c71bf44","updated":"2018-02-26 11:20:22.000000000","message":"What is the problem with current approach? Why should we add extra thing(mostly confusing to ppls), if could be done simply?","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"380a88584aed2c027928bfc4d4147738a48bc9ee","unresolved":false,"context_lines":[{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    @mock.patch.object(journal, \u0027record\u0027)"},{"line_number":477,"context_line":"    def test_full_sync_ml2(self, mock_record):"},{"line_number":478,"context_line":"        helper.add_side_effect_for_ml2()"},{"line_number":479,"context_line":"        self.addCleanup(helper.cleanup_side_effect)"},{"line_number":480,"context_line":"        for resource in mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES:"},{"line_number":481,"context_line":"            full_sync.sync_resources(self.db_context, resource)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_e98977c9","line":478,"range":{"start_line":478,"start_character":8,"end_line":478,"end_character":40},"in_reply_to":"3fa0c359_5dd149cb","updated":"2018-02-26 14:41:43.000000000","message":"Because you need to add a cleanup every time -which you might forget (and you even did once). That\u0027s exactly what a context or a decorator can do in a nice way.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"ef6bf0e31d10b109bb9b88080763ca69781daaac","unresolved":false,"context_lines":[{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    @mock.patch.object(journal, \u0027record\u0027)"},{"line_number":477,"context_line":"    def test_full_sync_ml2(self, mock_record):"},{"line_number":478,"context_line":"        helper.add_side_effect_for_ml2()"},{"line_number":479,"context_line":"        self.addCleanup(helper.cleanup_side_effect)"},{"line_number":480,"context_line":"        for resource in mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES:"},{"line_number":481,"context_line":"            full_sync.sync_resources(self.db_context, resource)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_a46071d0","line":478,"range":{"start_line":478,"start_character":8,"end_line":478,"end_character":40},"in_reply_to":"3fa0c359_e98977c9","updated":"2018-02-26 17:31:22.000000000","message":"In patch set 12, i already added cleanup function call in side effect. So forget things will be taken care of.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"e91c3e4a69d51031990a1273e05f258e1bd4b8fb","unresolved":false,"context_lines":[{"line_number":488,"context_line":""},{"line_number":489,"context_line":"    @mock.patch.object(journal, \u0027record\u0027)"},{"line_number":490,"context_line":"    def test_full_sync_multiple_networks(self, mock_record):"},{"line_number":491,"context_line":"        helper.add_side_effect_for_multiple_networks()"},{"line_number":492,"context_line":"        self.addCleanup(helper.cleanup_side_effect)"},{"line_number":493,"context_line":"        full_sync.sync_resources(self.db_context, odl_const.ODL_NETWORK)"},{"line_number":494,"context_line":"        networks \u003d helper.get_resource(odl_const.ODL_NETWORK)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_3ca35ba0","line":491,"updated":"2018-02-22 14:43:22.000000000","message":"Perhaps this would be nice if it was a context or a decorator","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"}],"networking_odl/tests/unit/journal/test_recovery.py":[{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"de57f3629d9f17473dcc19ec9b2beabee6b4ecb5","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.assertEqual(mock_resource, resource)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @mock.patch.object(directory, \u0027get_plugin\u0027)"},{"line_number":65,"context_line":"    def test__get_latest_resource_l2(self, plugin_mock):"},{"line_number":66,"context_line":"        resources \u003d mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES"},{"line_number":67,"context_line":"        for resource_type in resources:"},{"line_number":68,"context_line":"            plugin \u003d plugin_mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_f2d8681f","line":65,"range":{"start_line":65,"start_character":4,"end_line":65,"end_character":56},"updated":"2017-12-13 09:52:06.000000000","message":"could you check that this test is actually testing something? If I understand correctly L68 will return a mock and therefore it will continue with all mocks... I think it won\u0027t test nothing at all...\n\nI didn\u0027t pay too much attention to it though, I might be wrong.","commit_id":"5b5ea7d51e6954119bf43b4eeaae3b44a9296a29"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"2ce5cc7e19990ff88432dedeff950df8704e18a3","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.assertEqual(mock_resource, resource)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @mock.patch.object(directory, \u0027get_plugin\u0027)"},{"line_number":65,"context_line":"    def test__get_latest_resource_l2(self, plugin_mock):"},{"line_number":66,"context_line":"        resources \u003d mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES"},{"line_number":67,"context_line":"        for resource_type in resources:"},{"line_number":68,"context_line":"            plugin \u003d plugin_mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_05343292","line":65,"range":{"start_line":65,"start_character":4,"end_line":65,"end_character":56},"in_reply_to":"df87a7cf_1a8e282e","updated":"2017-12-18 09:50:08.000000000","message":"It\u0027s unrelated to the change in the sense that the function exists already, still you are using this to test it and if it doesn\u0027t test anything then it\u0027s an incorrect test and that would affect your change.","commit_id":"5b5ea7d51e6954119bf43b4eeaae3b44a9296a29"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"d847f3a1b0dd8c06906a3d1d4a275683fb8365f5","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.assertEqual(mock_resource, resource)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    @mock.patch.object(directory, \u0027get_plugin\u0027)"},{"line_number":65,"context_line":"    def test__get_latest_resource_l2(self, plugin_mock):"},{"line_number":66,"context_line":"        resources \u003d mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES"},{"line_number":67,"context_line":"        for resource_type in resources:"},{"line_number":68,"context_line":"            plugin \u003d plugin_mock.return_value"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_1a8e282e","line":65,"range":{"start_line":65,"start_character":4,"end_line":65,"end_character":56},"in_reply_to":"df87a7cf_f2d8681f","updated":"2017-12-15 05:45:50.000000000","message":"hmm, it is actually assigning return values to mocked plugin method(also assigned at L47) for resources at L48. Seems to be ok, however these test cases, can be improved. Anyways these are not related to this change.","commit_id":"5b5ea7d51e6954119bf43b4eeaae3b44a9296a29"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"525f4122f2140d459477b943b509c9bbbfaab64b","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        helper.add_side_effect_for_ml2()"},{"line_number":241,"context_line":"        resources \u003d mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES"},{"line_number":242,"context_line":"        for resource_type in resources:"},{"line_number":243,"context_line":"            driver \u003d base_driver.get_driver(resource_type)"},{"line_number":244,"context_line":"            actual_object \u003d helper.get_method_details()"},{"line_number":245,"context_line":"            actual_object \u003d actual_object["},{"line_number":246,"context_line":"                helper.METHOD_NAME_STR % resource_type][0]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa0c359_0767b927","line":243,"range":{"start_line":243,"start_character":12,"end_line":243,"end_character":58},"updated":"2018-02-15 19:22:02.000000000","message":"tbh, registering of driver should be re considered, as all L2 resources will have same driver why its should register driver only once for all L2 resources, registering same driver for multiple resources is inefficient. by doing so just call get_driver once for all l2 resources. not each time for each resource.\n\nNote: this can be done later on if agreed, this comment doesn\u0027t count to vote in this review","commit_id":"ca8e2ffd67fa3fbcae6ccb2bbf46d01de7a533b3"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"0fa6fa830fc18f716d69ea99291be930088d6321","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        helper.add_side_effect_for_ml2()"},{"line_number":241,"context_line":"        resources \u003d mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES"},{"line_number":242,"context_line":"        for resource_type in resources:"},{"line_number":243,"context_line":"            driver \u003d base_driver.get_driver(resource_type)"},{"line_number":244,"context_line":"            actual_object \u003d helper.get_method_details()"},{"line_number":245,"context_line":"            actual_object \u003d actual_object["},{"line_number":246,"context_line":"                helper.METHOD_NAME_STR % resource_type][0]"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa0c359_695f4be5","line":243,"range":{"start_line":243,"start_character":12,"end_line":243,"end_character":58},"in_reply_to":"3fa0c359_0767b927","updated":"2018-02-18 10:30:43.000000000","message":"Done","commit_id":"ca8e2ffd67fa3fbcae6ccb2bbf46d01de7a533b3"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"eb10ce858ed5b8ff332a1b785b9cc2765775a5b5","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                          self.db_context, row)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def test_recovery_for_resources(self):"},{"line_number":240,"context_line":"        helper.add_side_effect_for_ml2()"},{"line_number":241,"context_line":"        resources \u003d mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES"},{"line_number":242,"context_line":"        driver \u003d base_driver.get_driver(odl_const.ODL_NETWORK)"},{"line_number":243,"context_line":"        for resource_type in resources:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_caecfbf5","line":240,"range":{"start_line":240,"start_character":8,"end_line":240,"end_character":40},"updated":"2018-02-21 23:25:58.000000000","message":"addCleanup() is missing.","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"e91c3e4a69d51031990a1273e05f258e1bd4b8fb","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                          self.db_context, row)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def test_recovery_for_resources(self):"},{"line_number":240,"context_line":"        helper.add_side_effect_for_ml2()"},{"line_number":241,"context_line":"        resources \u003d mech_driver_v2.OpenDaylightMechanismDriver.RESOURCES"},{"line_number":242,"context_line":"        driver \u003d base_driver.get_driver(odl_const.ODL_NETWORK)"},{"line_number":243,"context_line":"        for resource_type in resources:"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa0c359_17bf58aa","line":240,"range":{"start_line":240,"start_character":8,"end_line":240,"end_character":40},"in_reply_to":"3fa0c359_caecfbf5","updated":"2018-02-22 14:43:22.000000000","message":"since the cleanup is always needed it should be part of the helper... or as I said in the other comment either context manager or decorator...","commit_id":"83b77e0c3e8f5a5a17865d3ecb227268c284fb60"}],"networking_odl/tests/unit/ml2/test_mechanism_odl_v2.py":[{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"de57f3629d9f17473dcc19ec9b2beabee6b4ecb5","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        super(OpenDaylightMechanismDriverTestCase, self).setUp()"},{"line_number":167,"context_line":"        self.mech \u003d mech_driver_v2.OpenDaylightMechanismDriver()"},{"line_number":168,"context_line":"        self.mech.initialize()"},{"line_number":169,"context_line":"        self.addCleanup(base_driver.ALL_RESOURCES.clear)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def test_registered_plugin_type(self):"},{"line_number":172,"context_line":"        self.assertEqual(self.mech.plugin_type, n_constants.CORE)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_1244ecb6","line":169,"range":{"start_line":169,"start_character":8,"end_line":169,"end_character":56},"updated":"2017-12-13 09:52:06.000000000","message":"Perhaps it makes more sense to add this to the setUp of the \"highest\" parent?\n\nBecause if a testcase forgots to add this then we might end up with a dirty state for the rest of the tests","commit_id":"5b5ea7d51e6954119bf43b4eeaae3b44a9296a29"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"d847f3a1b0dd8c06906a3d1d4a275683fb8365f5","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        super(OpenDaylightMechanismDriverTestCase, self).setUp()"},{"line_number":167,"context_line":"        self.mech \u003d mech_driver_v2.OpenDaylightMechanismDriver()"},{"line_number":168,"context_line":"        self.mech.initialize()"},{"line_number":169,"context_line":"        self.addCleanup(base_driver.ALL_RESOURCES.clear)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def test_registered_plugin_type(self):"},{"line_number":172,"context_line":"        self.assertEqual(self.mech.plugin_type, n_constants.CORE)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_da9c405f","line":169,"range":{"start_line":169,"start_character":8,"end_line":169,"end_character":56},"in_reply_to":"df87a7cf_1244ecb6","updated":"2017-12-15 05:45:50.000000000","message":"Done","commit_id":"5b5ea7d51e6954119bf43b4eeaae3b44a9296a29"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"de57f3629d9f17473dcc19ec9b2beabee6b4ecb5","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    def test_registered_plugin_type(self):"},{"line_number":172,"context_line":"        self.assertEqual(self.mech.plugin_type, n_constants.CORE)"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def test_registered_resources(self):"},{"line_number":175,"context_line":"        for resource in self.mech.RESOURCES:"},{"line_number":176,"context_line":"            self.assertIn(resource, base_driver.ALL_RESOURCES)"},{"line_number":177,"context_line":"            self.assertEqual(base_driver.ALL_RESOURCES[resource], self.mech)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_52683420","line":174,"range":{"start_line":174,"start_character":4,"end_line":174,"end_character":40},"updated":"2017-12-13 09:52:06.000000000","message":"this is too bound to implementation, it\u0027s not really testing the behavior.","commit_id":"5b5ea7d51e6954119bf43b4eeaae3b44a9296a29"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"2ce5cc7e19990ff88432dedeff950df8704e18a3","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    def test_registered_plugin_type(self):"},{"line_number":172,"context_line":"        self.assertEqual(self.mech.plugin_type, n_constants.CORE)"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def test_registered_resources(self):"},{"line_number":175,"context_line":"        for resource in self.mech.RESOURCES:"},{"line_number":176,"context_line":"            self.assertIn(resource, base_driver.ALL_RESOURCES)"},{"line_number":177,"context_line":"            self.assertEqual(base_driver.ALL_RESOURCES[resource], self.mech)"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_e5b82ec9","line":174,"range":{"start_line":174,"start_character":4,"end_line":174,"end_character":40},"in_reply_to":"df87a7cf_52683420","updated":"2017-12-18 09:50:08.000000000","message":"^^","commit_id":"5b5ea7d51e6954119bf43b4eeaae3b44a9296a29"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"4099bc33d9523266ec261872fd680cf5b10067fe","unresolved":false,"context_lines":[{"line_number":171,"context_line":"    def test_registered_plugin_type(self):"},{"line_number":172,"context_line":"        self.assertEqual(self.mech.plugin_type, n_constants.CORE)"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def test_registered_resources(self):"},{"line_number":175,"context_line":"        for resource in self.mech.RESOURCES:"},{"line_number":176,"context_line":"            self.assertIn(resource, base_driver.ALL_RESOURCES)"},{"line_number":177,"context_line":"            self.assertEqual(base_driver.ALL_RESOURCES[resource], self.mech)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_45c9bea9","line":174,"range":{"start_line":174,"start_character":4,"end_line":174,"end_character":40},"in_reply_to":"df87a7cf_e5b82ec9","updated":"2018-01-31 04:48:12.000000000","message":"Could you elaborate more on it? AFAIK, It checks whether registration of resource is successful or not. Should not this unit of code be tested?","commit_id":"5b5ea7d51e6954119bf43b4eeaae3b44a9296a29"},{"author":{"_account_id":26507,"name":"Michel Peterson","email":"michel@redhat.com","username":"mpeterson"},"change_message_id":"53a35920c28b6c8ae573a8f5c8b12216e94b40fd","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        super(OpenDaylightMechanismDriverTestCase, self).setUp()"},{"line_number":177,"context_line":"        self.mech \u003d mech_driver_v2.OpenDaylightMechanismDriver()"},{"line_number":178,"context_line":"        self.mech.initialize()"},{"line_number":179,"context_line":"        self.addCleanup(base_driver.ALL_RESOURCES.clear)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def test_registered_plugin_type(self):"},{"line_number":182,"context_line":"        self.assertEqual(self.mech.plugin_type, n_constants.CORE)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f6a8fd7_e14ff58f","line":179,"updated":"2018-04-18 09:39:01.000000000","message":"Isn\u0027t this in the base already? no need to have it here","commit_id":"c1279f72e9a176645e357cae8434efc2f1e55338"},{"author":{"_account_id":13912,"name":"rajiv","email":"thenakliman@gmail.com","username":"rajiv.kumar"},"change_message_id":"6594feae4edcf2814170e93a2f3d414e14a9a828","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        super(OpenDaylightMechanismDriverTestCase, self).setUp()"},{"line_number":177,"context_line":"        self.mech \u003d mech_driver_v2.OpenDaylightMechanismDriver()"},{"line_number":178,"context_line":"        self.mech.initialize()"},{"line_number":179,"context_line":"        self.addCleanup(base_driver.ALL_RESOURCES.clear)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def test_registered_plugin_type(self):"},{"line_number":182,"context_line":"        self.assertEqual(self.mech.plugin_type, n_constants.CORE)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f6a8fd7_66768ea7","line":179,"in_reply_to":"9f6a8fd7_e14ff58f","updated":"2018-04-18 16:26:05.000000000","message":"Done","commit_id":"c1279f72e9a176645e357cae8434efc2f1e55338"}]}
