)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3c5d7edcca34c204ee781a954fce2069ea474806","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"You can view/verify current datapath-id via"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"[root@centos7 ~]# ovs-vsctl get Bridge br-vlan datapath-id"},{"line_number":30,"context_line":"\"00006ea5a4b38a4a\""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"(please note that other-config is needed in the set, but not get)"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_b73ff784","line":29,"range":{"start_line":29,"start_character":0,"end_line":29,"end_character":16},"updated":"2018-10-09 05:07:42.000000000","message":"This is not necessary, make consistent with the above command.","commit_id":"eeb89cef379f71f8e5ed22d08bb598cc4965da66"}],"neutron/agent/common/ovs_lib.py":[{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"3aa40eb456c467eb87b5702aec459ecb49ca2f48","unresolved":false,"context_lines":[{"line_number":921,"context_line":"            \u0027controller_burst_limit\u0027, controller_burst_limit)"},{"line_number":922,"context_line":""},{"line_number":923,"context_line":"    def set_datapath_id(self, datapath_id):"},{"line_number":924,"context_line":"        br_other_config\u003d self.db_get_val(\u0027Bridge\u0027, self.br_name, \u0027other_config\u0027)"},{"line_number":925,"context_line":"        datapath_id_cfg \u003d { \u0027datapath-id\u0027 : datapath_id }"},{"line_number":926,"context_line":"        br_other_config.update(datapath_id_cfg)"},{"line_number":927,"context_line":"        self.set_db_attribute(\u0027Bridge\u0027, self.br_name, \u0027other_config\u0027, br_other_config,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_62b12445","line":924,"updated":"2018-07-31 13:58:28.000000000","message":"set_db_attribute should just update dicts instead of replacing them ( https://github.com/openstack/ovsdbapp/blob/f15d014fc7cb4111c132e7e2b3b3f35e0dbf5e82/ovsdbapp/backend/ovs_idl/command.py#L117 ), so I think this whole function should just be a wrapper to set_db_attribute.","commit_id":"1d64712bceb1ec1e67d6ed264fb31a64d3f9aab4"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"b5de619e395ff1e658190ffadb7fdd0d814bf40e","unresolved":false,"context_lines":[{"line_number":923,"context_line":""},{"line_number":924,"context_line":"    def set_datapath_id(self, datapath_id):"},{"line_number":925,"context_line":"        dpid_cfg \u003d {\u0027datapath-id\u0027: datapath_id}"},{"line_number":926,"context_line":"        self.set_db_attribute(\u0027Bridge\u0027, self.br_name, \u0027other_config\u0027, dpid_cfg,"},{"line_number":927,"context_line":"                              check_error\u003dTrue)"},{"line_number":928,"context_line":""},{"line_number":929,"context_line":"    def __enter__(self):"},{"line_number":930,"context_line":"        self.create()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_35629142","line":927,"range":{"start_line":926,"start_character":8,"end_line":927,"end_character":47},"updated":"2018-12-07 19:04:48.000000000","message":"Be careful: with this command you are overwriting the parameter \"other_config\". This is not going to update the dictionary, but erasing everything else.\n\nPlease, check https://github.com/openstack/neutron/blob/master/neutron/agent/linux/openvswitch_firewall/iptables.py#L94-L100","commit_id":"98e931be4754685a889d56af359fd50eb3a8f8d4"}],"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"8afbe6c0eedac22b87970daf68a8774e7bd9d33e","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"            # Bottom 48 bits auto-derived from MAC of NIC. Upper 12 bits free,"},{"line_number":1152,"context_line":"            # so we OR it with (bridge # \u003c\u003c 48) to create a unique ID"},{"line_number":1153,"context_line":"            # It must be exactly 64 bits, else OVS will reject it - zfill"},{"line_number":1154,"context_line":"            dpid \u003d br.get_datapath_id()"},{"line_number":1155,"context_line":"            LOG.info(\"Bridge %s datapath-id \u003d 0x%s\", br.br_name, dpid)"},{"line_number":1156,"context_line":"            if dpid not in datapath_ids_set:"},{"line_number":1157,"context_line":"                datapath_ids_set.add(dpid)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_73c75348","line":1154,"range":{"start_line":1154,"start_character":12,"end_line":1154,"end_character":39},"updated":"2018-09-25 10:54:21.000000000","message":"At this point, the bridge is not created yet, so you can\u0027t retrieve the datapath_id from the ovs database (please, correct me if I\u0027m wrong).\n\nIMO, what you can do is:\n- In native.ovs_bridge.OVSAgentBridge override create function.\n- Create the bridge and retrieve the bridge datapath_id\n- Implement a function to retrieve all datapath_ids\n- If the bridge dpid is duplicated, overwrite it in \"other-configs\"","commit_id":"1d64712bceb1ec1e67d6ed264fb31a64d3f9aab4"},{"author":{"_account_id":21907,"name":"Arjun Baindur","email":"xagent@gmail.com","username":"arjunbaindur"},"change_message_id":"9c696982aaa23ba814982043deda509d66fc353a","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"            # Bottom 48 bits auto-derived from MAC of NIC. Upper 12 bits free,"},{"line_number":1152,"context_line":"            # so we OR it with (bridge # \u003c\u003c 48) to create a unique ID"},{"line_number":1153,"context_line":"            # It must be exactly 64 bits, else OVS will reject it - zfill"},{"line_number":1154,"context_line":"            dpid \u003d br.get_datapath_id()"},{"line_number":1155,"context_line":"            LOG.info(\"Bridge %s datapath-id \u003d 0x%s\", br.br_name, dpid)"},{"line_number":1156,"context_line":"            if dpid not in datapath_ids_set:"},{"line_number":1157,"context_line":"                datapath_ids_set.add(dpid)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_1b9ef168","line":1154,"range":{"start_line":1154,"start_character":12,"end_line":1154,"end_character":39},"in_reply_to":"3f79a3b5_73c75348","updated":"2018-09-27 21:54:58.000000000","message":"These bridges are the user-created physical bridges, the ones supplied in the bridge mappings. They are pre-created. OVS/neutron does not ever create these bridges, it only creates br-int and br-tun. OVS agent will error out if the physical bridges specified do not exist.","commit_id":"1d64712bceb1ec1e67d6ed264fb31a64d3f9aab4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"cf15dc067eb2e3a7f798139e786fb077aee92e07","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"            # so we OR it with (bridge # \u003c\u003c 48) to create a unique ID"},{"line_number":1153,"context_line":"            # It must be exactly 64 bits, else OVS will reject it - zfill"},{"line_number":1154,"context_line":"            dpid \u003d br.get_datapath_id()"},{"line_number":1155,"context_line":"            LOG.info(\"Bridge %s datapath-id \u003d 0x%s\", br.br_name, dpid)"},{"line_number":1156,"context_line":"            if dpid not in datapath_ids_set:"},{"line_number":1157,"context_line":"                datapath_ids_set.add(dpid)"},{"line_number":1158,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_56b86dc5","line":1155,"updated":"2018-07-31 15:24:46.000000000","message":"Do we actually need this log message?","commit_id":"1d64712bceb1ec1e67d6ed264fb31a64d3f9aab4"},{"author":{"_account_id":21907,"name":"Arjun Baindur","email":"xagent@gmail.com","username":"arjunbaindur"},"change_message_id":"9c696982aaa23ba814982043deda509d66fc353a","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"            # so we OR it with (bridge # \u003c\u003c 48) to create a unique ID"},{"line_number":1153,"context_line":"            # It must be exactly 64 bits, else OVS will reject it - zfill"},{"line_number":1154,"context_line":"            dpid \u003d br.get_datapath_id()"},{"line_number":1155,"context_line":"            LOG.info(\"Bridge %s datapath-id \u003d 0x%s\", br.br_name, dpid)"},{"line_number":1156,"context_line":"            if dpid not in datapath_ids_set:"},{"line_number":1157,"context_line":"                datapath_ids_set.add(dpid)"},{"line_number":1158,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_bbc7bd65","line":1155,"in_reply_to":"5f7c97a3_56b86dc5","updated":"2018-09-27 21:54:58.000000000","message":"I\u0027d prefer to keep it in, if thats ok, since I think it might come in handy for debugging. It\u0027s not spammy at all, since it\u0027s only printed once upon initialization. Let me know","commit_id":"1d64712bceb1ec1e67d6ed264fb31a64d3f9aab4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"cf15dc067eb2e3a7f798139e786fb077aee92e07","unresolved":false,"context_lines":[{"line_number":1156,"context_line":"            if dpid not in datapath_ids_set:"},{"line_number":1157,"context_line":"                datapath_ids_set.add(dpid)"},{"line_number":1158,"context_line":"            else:"},{"line_number":1159,"context_line":"                int_dpid \u003d int(dpid, 16)"},{"line_number":1160,"context_line":"                new_dpid \u003d int_dpid | (bridge_num \u003c\u003c 48)"},{"line_number":1161,"context_line":"                str_new_dpid \u003d format(new_dpid, \u00270x\u0027)"},{"line_number":1162,"context_line":"                str_new_dpid \u003d str_new_dpid.zfill(16)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_0fae547f","line":1159,"updated":"2018-07-31 15:24:46.000000000","message":"This method is already pretty long, maybe either just do something like:\n\n else:\n     dp \u003d format(int(dpid, 16) | (bridge_num \u003c\u003c 48), \u00270x\u0027).zfill(16)\n     LOG.info(\"Changed bridge %s datapath_id to %x\", br.br_name, dp)\n     br.set_datapath_id(dp)\n     datapath_ids_set.add(dp)\n\nThe log line was too long for pep8 with the long variable name anyway. No reason to do all of the intermediate assignments. Or just break out a separate unique_datapath_id(datapath_id_set, proposed_dpid) method that returns a modified datapath if proposed_dpid is in datapath_id_set. Then if the result was different than the input, br.set_datapath_id(new_dpid) and add it to the datapath_id_set? This method would be easy to unit test as well since it has no side effects and has a defined input/output. Just a thought.\n\nAlso, is there an issue here using the bridge_num \u003d 0/increment? If the original duplicate is 0000deadbeef4dad, then wouldn\u0027t we end up with the new dpid \u003d\u003d the old one?","commit_id":"1d64712bceb1ec1e67d6ed264fb31a64d3f9aab4"},{"author":{"_account_id":21907,"name":"Arjun Baindur","email":"xagent@gmail.com","username":"arjunbaindur"},"change_message_id":"019be9acc715c94669737adcfc4aaa845d226ee0","unresolved":false,"context_lines":[{"line_number":1156,"context_line":"            if dpid not in datapath_ids_set:"},{"line_number":1157,"context_line":"                datapath_ids_set.add(dpid)"},{"line_number":1158,"context_line":"            else:"},{"line_number":1159,"context_line":"                int_dpid \u003d int(dpid, 16)"},{"line_number":1160,"context_line":"                new_dpid \u003d int_dpid | (bridge_num \u003c\u003c 48)"},{"line_number":1161,"context_line":"                str_new_dpid \u003d format(new_dpid, \u00270x\u0027)"},{"line_number":1162,"context_line":"                str_new_dpid \u003d str_new_dpid.zfill(16)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_55ff58aa","line":1159,"in_reply_to":"5f7c97a3_0fae547f","updated":"2018-09-27 21:51:45.000000000","message":"I can change if needed, but purposely split it for clarity since some of the operations might appear cryptic at first","commit_id":"1d64712bceb1ec1e67d6ed264fb31a64d3f9aab4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"28b05abba84b4fd2f5ecac62b360ee7284aa3dec","unresolved":false,"context_lines":[{"line_number":1156,"context_line":"            if dpid not in datapath_ids_set:"},{"line_number":1157,"context_line":"                datapath_ids_set.add(dpid)"},{"line_number":1158,"context_line":"            else:"},{"line_number":1159,"context_line":"                int_dpid \u003d int(dpid, 16)"},{"line_number":1160,"context_line":"                new_dpid \u003d int_dpid | (bridge_num \u003c\u003c 48)"},{"line_number":1161,"context_line":"                str_new_dpid \u003d format(new_dpid, \u00270x\u0027)"},{"line_number":1162,"context_line":"                str_new_dpid \u003d str_new_dpid.zfill(16)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_7bc3093a","line":1159,"in_reply_to":"5f7c97a3_0fae547f","updated":"2018-07-31 18:38:41.000000000","message":"re: increment issue, ignore that comment as well, as that pretty clearly wouldn\u0027t be an issue. reviews before coffee never a good idea.","commit_id":"1d64712bceb1ec1e67d6ed264fb31a64d3f9aab4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3c5d7edcca34c204ee781a954fce2069ea474806","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                dp \u003d format(int(dpid, 16) | (bridge_num \u003c\u003c 48), \u00270x\u0027).zfill(16)"},{"line_number":1162,"context_line":"                LOG.info(\"Changed bridge %s datapath_id to %s\", br.br_name, dp)"},{"line_number":1163,"context_line":"                br.set_datapath_id(dp)"},{"line_number":1164,"context_line":"                datapath_ids_set.add(dp)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"            bridge_num +\u003d 1"},{"line_number":1167,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_77ef1ffa","line":1164,"range":{"start_line":1164,"start_character":16,"end_line":1164,"end_character":40},"updated":"2018-10-09 05:07:42.000000000","message":"It is already in the datapath_ids_set, this can be removed?","commit_id":"eeb89cef379f71f8e5ed22d08bb598cc4965da66"},{"author":{"_account_id":21907,"name":"Arjun Baindur","email":"xagent@gmail.com","username":"arjunbaindur"},"change_message_id":"171f0db870a961db01e988a6d779c11ddf2980ab","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                dp \u003d format(int(dpid, 16) | (bridge_num \u003c\u003c 48), \u00270x\u0027).zfill(16)"},{"line_number":1162,"context_line":"                LOG.info(\"Changed bridge %s datapath_id to %s\", br.br_name, dp)"},{"line_number":1163,"context_line":"                br.set_datapath_id(dp)"},{"line_number":1164,"context_line":"                datapath_ids_set.add(dp)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"            bridge_num +\u003d 1"},{"line_number":1167,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_cccada44","line":1164,"range":{"start_line":1164,"start_character":16,"end_line":1164,"end_character":40},"in_reply_to":"3f79a3b5_77ef1ffa","updated":"2018-10-11 22:25:27.000000000","message":"No, it is not there, since we changed the datapath ID, so we are adding a new unique one. I think it should remain incase someone has already taken manual steps and changed bridge IDs. For example, suppose initally there are br-vlan and br-ex with same DPID. Someone might have changed br-ex\u0027s datapath ID to 0x1000... before this commit. Now they add another bridge, br-ex2 (someone in bug mentioned having br-ex and br-ex2). Depending upon the order the bridges are processed, we might change a bridge\u0027s DPID, and it may end up matching subsequent bridge. This guarantees for sanity everything is unique.","commit_id":"eeb89cef379f71f8e5ed22d08bb598cc4965da66"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"08b19a4cd1e178d4d3fb6e30be54bd72dae5f3b7","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                dp \u003d format(int(dpid, 16) | (bridge_num \u003c\u003c 48), \u00270x\u0027).zfill(16)"},{"line_number":1162,"context_line":"                LOG.info(\"Changed bridge %s datapath_id to %s\", br.br_name, dp)"},{"line_number":1163,"context_line":"                br.set_datapath_id(dp)"},{"line_number":1164,"context_line":"                datapath_ids_set.add(dp)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"            bridge_num +\u003d 1"},{"line_number":1167,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_7277d1a0","line":1164,"range":{"start_line":1164,"start_character":16,"end_line":1164,"end_character":40},"in_reply_to":"3f79a3b5_cccada44","updated":"2018-10-12 10:57:49.000000000","message":"Thanks for the detail. One more thing, since you do not remove any datapath id here from the set, all the stale datapath id will remain forever?","commit_id":"eeb89cef379f71f8e5ed22d08bb598cc4965da66"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"21edc4ba18daf196c4248285e2ff21f85f4c4c48","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"            LOG.info(\"Bridge %s datapath-id \u003d 0x%s\", br.br_name, dpid)"},{"line_number":1158,"context_line":"            if dpid not in datapath_ids_set:"},{"line_number":1159,"context_line":"                datapath_ids_set.add(dpid)"},{"line_number":1160,"context_line":"            else:"},{"line_number":1161,"context_line":"                dp \u003d format(int(dpid, 16) | (bridge_num \u003c\u003c 48), \u00270x\u0027).zfill(16)"},{"line_number":1162,"context_line":"                LOG.info(\"Changed bridge %s datapath_id to %s\", br.br_name, dp)"},{"line_number":1163,"context_line":"                br.set_datapath_id(dp)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_bf289735","line":1160,"updated":"2018-11-27 21:47:37.000000000","message":"Should we have a test to assert this path?","commit_id":"d1efdec4c6f75e57d253d70a538107b21b4c55a7"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"b5de619e395ff1e658190ffadb7fdd0d814bf40e","unresolved":false,"context_lines":[{"line_number":1174,"context_line":"                dp \u003d format(int(dpid, 16) | (bridge_num \u003c\u003c 48), \u00270x\u0027).zfill(16)"},{"line_number":1175,"context_line":"                LOG.info(\"Changed bridge %s datapath_id to %s\", br.br_name, dp)"},{"line_number":1176,"context_line":"                br.set_datapath_id(dp)"},{"line_number":1177,"context_line":"                datapath_ids_set.add(dp)"},{"line_number":1178,"context_line":""},{"line_number":1179,"context_line":"            bridge_num +\u003d 1"},{"line_number":1180,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_70025709","line":1177,"updated":"2018-12-07 19:04:48.000000000","message":"As Terry mentioned, we need at least one test for this.","commit_id":"98e931be4754685a889d56af359fd50eb3a8f8d4"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"a776f476a08dbe559fceb3e83657a8a2167909b4","unresolved":false,"context_lines":[{"line_number":1153,"context_line":"        :param bridge: (OVSPhysicalBridge) bridge"},{"line_number":1154,"context_line":"        :param datapath_ids_set: (set) used datapath ids in OVS"},{"line_number":1155,"context_line":"        \"\"\""},{"line_number":1156,"context_line":"        dpid \u003d bridge.get_datapath_id()"},{"line_number":1157,"context_line":"        dpid_hex \u003d format(dpid, \u00270x\u0027).zfill(16)"},{"line_number":1158,"context_line":"        if dpid_hex in datapath_ids_set:"},{"line_number":1159,"context_line":"            dpid_hex \u003d format("}],"source_content_type":"text/x-python","patch_set":8,"id":"9fdfeff1_2e0d2290","line":1156,"updated":"2019-01-19 20:58:38.000000000","message":"This is returning a unicode string.","commit_id":"bd7f83b255bdf616bd32f4c141f6b2217f7483af"}]}
