)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ca69a0c08bf2423bf8554c9c9011aced2fb5dcf0","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Manjeet Singh Bhatia \u003cmanjeet.s.bhatia@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-12-03 00:10:12 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use Port OVO in plugins/ml2/test_db.py"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Port object is merged, This patch uses it for unit test."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a71b18c_e080404c","line":7,"updated":"2016-12-07 18:42:47.000000000","message":"I see you touch production code too?","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"58d7b64f29b0efff5eb5d235e6bb1ff2dc678ff2","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Manjeet Singh Bhatia \u003cmanjeet.s.bhatia@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-12-03 00:10:12 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use Port OVO in plugins/ml2/test_db.py"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Port object is merged, This patch uses it for unit test."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a71b18c_c01c24c4","line":7,"in_reply_to":"3a71b18c_e080404c","updated":"2016-12-07 18:54:52.000000000","message":"Done","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6b5f6e87dc9ac933ac44f26bf4b3a3e3bb6eea45","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Manjeet Singh Bhatia \u003cmanjeet.s.bhatia@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-12-07 19:55:06 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use Port OVO in ml2/db and plugins/mlw/test_db"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Port object is merged, This patch use port object"},{"line_number":10,"context_line":"in plugins/ml2/db.py and unit/plugins/mlw/test_db.py."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3a71b18c_ff3993a4","line":7,"range":{"start_line":7,"start_character":37,"end_line":7,"end_character":38},"updated":"2016-12-08 15:17:01.000000000","message":"2?","commit_id":"5abbc397d1dfec9a46c394198f30ffe8257bfd44"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6b5f6e87dc9ac933ac44f26bf4b3a3e3bb6eea45","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Use Port OVO in ml2/db and plugins/mlw/test_db"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Port object is merged, This patch use port object"},{"line_number":10,"context_line":"in plugins/ml2/db.py and unit/plugins/mlw/test_db.py."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Ic1b617a789ea9c7e0ad369f34478d33e17837ba9"},{"line_number":13,"context_line":"Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3a71b18c_9fbedffd","line":10,"range":{"start_line":10,"start_character":40,"end_line":10,"end_character":41},"updated":"2016-12-08 15:17:01.000000000","message":"2?","commit_id":"5abbc397d1dfec9a46c394198f30ffe8257bfd44"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"bbffde1c50ac0d0c6c09d460deb4349997c83ac6","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use Port OVO in ml2/db and plugins/ml2/test_db"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Port object is merged, This patch use port object"},{"line_number":10,"context_line":"in plugins/ml2/db.py and unit/plugins/ml2/test_db.py."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Ic1b617a789ea9c7e0ad369f34478d33e17837ba9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"1a6eadb0_aea42bb9","line":9,"range":{"start_line":9,"start_character":23,"end_line":9,"end_character":24},"updated":"2016-12-20 14:52:30.000000000","message":"nit: s/T/t","commit_id":"0af50736fc800f898728d6d879509f7c266fe745"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"bbffde1c50ac0d0c6c09d460deb4349997c83ac6","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use Port OVO in ml2/db and plugins/ml2/test_db"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Port object is merged, This patch use port object"},{"line_number":10,"context_line":"in plugins/ml2/db.py and unit/plugins/ml2/test_db.py."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Ic1b617a789ea9c7e0ad369f34478d33e17837ba9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"1a6eadb0_ceab2788","line":9,"range":{"start_line":9,"start_character":34,"end_line":9,"end_character":37},"updated":"2016-12-20 14:52:30.000000000","message":"s/use/uses","commit_id":"0af50736fc800f898728d6d879509f7c266fe745"}],"neutron/plugins/ml2/db.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ca69a0c08bf2423bf8554c9c9011aced2fb5dcf0","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context,"},{"line_number":163,"context_line":"        mac_address\u003ddevice_mac)"},{"line_number":164,"context_line":"    if len(port) \u003d\u003d 1:"},{"line_number":165,"context_line":"        return port[0]"},{"line_number":166,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_6040b036","line":163,"updated":"2016-12-07 18:42:47.000000000","message":"I think you can join the two lines.","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"58d7b64f29b0efff5eb5d235e6bb1ff2dc678ff2","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context,"},{"line_number":163,"context_line":"        mac_address\u003ddevice_mac)"},{"line_number":164,"context_line":"    if len(port) \u003d\u003d 1:"},{"line_number":165,"context_line":"        return port[0]"},{"line_number":166,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_60f7d08c","line":163,"in_reply_to":"3a71b18c_6040b036","updated":"2016-12-07 18:54:52.000000000","message":"Done","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ca69a0c08bf2423bf8554c9c9011aced2fb5dcf0","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context,"},{"line_number":163,"context_line":"        mac_address\u003ddevice_mac)"},{"line_number":164,"context_line":"    if len(port) \u003d\u003d 1:"},{"line_number":165,"context_line":"        return port[0]"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_4072d4ae","line":164,"updated":"2016-12-07 18:42:47.000000000","message":"what if it\u0027s !\u003d 1?","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ddd3a46b07ab982fe35d028d82ab557d5416ff78","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context,"},{"line_number":163,"context_line":"        mac_address\u003ddevice_mac)"},{"line_number":164,"context_line":"    if len(port) \u003d\u003d 1:"},{"line_number":165,"context_line":"        return port[0]"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_2d3b109e","line":164,"in_reply_to":"3a71b18c_20fdd86e","updated":"2016-12-07 19:36:39.000000000","message":"Well I actually wonder why the code takes the first port matching? That\u0027s something to clarify. Is it some bug in the code? Or we can\u0027t really get multiple matches?","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"88f3dce7e38423be5a9f85f7a3c2f98aa6bd6765","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context,"},{"line_number":163,"context_line":"        mac_address\u003ddevice_mac)"},{"line_number":164,"context_line":"    if len(port) \u003d\u003d 1:"},{"line_number":165,"context_line":"        return port[0]"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_6d398841","line":164,"in_reply_to":"3a71b18c_2d3b109e","updated":"2016-12-07 19:48:41.000000000","message":"i don\u0027t think there will be multiple entries for this, if mac address for each port is unique but from columns definitions it is just a field neither have primary or unique constraint,\nso it can repeat, i just tried to keep it same by returning first element from list,","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"58d7b64f29b0efff5eb5d235e6bb1ff2dc678ff2","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context,"},{"line_number":163,"context_line":"        mac_address\u003ddevice_mac)"},{"line_number":164,"context_line":"    if len(port) \u003d\u003d 1:"},{"line_number":165,"context_line":"        return port[0]"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_20fdd86e","line":164,"in_reply_to":"3a71b18c_4072d4ae","updated":"2016-12-07 18:54:52.000000000","message":"should i just remove this condition and always send ports[0] if it exists ?","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6b5f6e87dc9ac933ac44f26bf4b3a3e3bb6eea45","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(port), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"def get_ports_and_sgs(context, port_ids):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_1f580ffa","line":163,"range":{"start_line":163,"start_character":4,"end_line":163,"end_character":33},"updated":"2016-12-08 15:17:01.000000000","message":"wow, what happened with \u0027return ports[0] if ports else None? You think it\u0027s as easy to parse next(iter(...), None)? :)","commit_id":"5abbc397d1dfec9a46c394198f30ffe8257bfd44"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"eef07a5dbc2b1bca609993f64463e98b9d4ce590","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(port), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"def get_ports_and_sgs(context, port_ids):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_71dbf2ed","line":163,"range":{"start_line":163,"start_character":4,"end_line":163,"end_character":33},"in_reply_to":"3a71b18c_1f580ffa","updated":"2016-12-08 17:19:35.000000000","message":"this is same logic it will return either first port from list or none, same as how query.first() works. by parse you mean for reviewers ? do you have any suggestion for this ?","commit_id":"5abbc397d1dfec9a46c394198f30ffe8257bfd44"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"9ace93365675e6920921cedc53b8ad40e51082fd","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(port), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"def get_ports_and_sgs(context, port_ids):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_e346594e","line":163,"range":{"start_line":163,"start_character":4,"end_line":163,"end_character":33},"in_reply_to":"3a71b18c_71dbf2ed","updated":"2016-12-08 17:22:06.000000000","message":"I find return ports[0] if ports else None a lot easier to read. But that\u0027s just me.","commit_id":"5abbc397d1dfec9a46c394198f30ffe8257bfd44"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"a1bc4f0b342a7de4b988cdd7de46e9657f6d102f","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(port), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_32e095cc","line":162,"range":{"start_line":162,"start_character":4,"end_line":162,"end_character":8},"updated":"2016-12-08 19:37:34.000000000","message":"nit: s/port/ports","commit_id":"d0166d0f9554edf6250b9154dedc568ffd94ec7e"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0296fd3e2f2bc99389ff0a619299f4cf84191746","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(port), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_1218f983","line":162,"range":{"start_line":162,"start_character":4,"end_line":162,"end_character":8},"in_reply_to":"3a71b18c_32e095cc","updated":"2016-12-08 19:43:14.000000000","message":"Done","commit_id":"d0166d0f9554edf6250b9154dedc568ffd94ec7e"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"a1bc4f0b342a7de4b988cdd7de46e9657f6d102f","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    port \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(port), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"def get_ports_and_sgs(context, port_ids):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_f2445db8","line":163,"range":{"start_line":163,"start_character":11,"end_line":163,"end_character":33},"updated":"2016-12-08 19:37:34.000000000","message":"I\u0027ve seen most of the patches using pop method but this is also fine","commit_id":"d0166d0f9554edf6250b9154dedc568ffd94ec7e"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"053c71cda1366104487ca00d209503a26d8a4d4c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        # to both be added to the session and locked for update. A"},{"line_number":57,"context_line":"        # single joined query should work, but the combination of left"},{"line_number":58,"context_line":"        # outer joins and postgresql doesn\u0027t seem to work."},{"line_number":59,"context_line":"        port \u003d (session.query(models_v2.Port)."},{"line_number":60,"context_line":"                enable_eagerloads(False)."},{"line_number":61,"context_line":"                filter_by(id\u003dport_id)."},{"line_number":62,"context_line":"                with_lockmode(\u0027update\u0027)."}],"source_content_type":"text/x-python","patch_set":5,"id":"3a71b18c_245be5f7","line":59,"range":{"start_line":59,"start_character":30,"end_line":59,"end_character":44},"updated":"2016-12-09 05:22:19.000000000","message":"This is more of a question. Do we need to take care of such db access codes in OVO side?","commit_id":"e72d73660fc5fa894359cae31594d91cc31ceec4"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"55ec7f3c5abe936c60f9a2dd148390cc333ac30c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        # to both be added to the session and locked for update. A"},{"line_number":57,"context_line":"        # single joined query should work, but the combination of left"},{"line_number":58,"context_line":"        # outer joins and postgresql doesn\u0027t seem to work."},{"line_number":59,"context_line":"        port \u003d (session.query(models_v2.Port)."},{"line_number":60,"context_line":"                enable_eagerloads(False)."},{"line_number":61,"context_line":"                filter_by(id\u003dport_id)."},{"line_number":62,"context_line":"                with_lockmode(\u0027update\u0027)."}],"source_content_type":"text/x-python","patch_set":5,"id":"3a71b18c_40944ae1","line":59,"range":{"start_line":59,"start_character":30,"end_line":59,"end_character":44},"in_reply_to":"3a71b18c_245be5f7","updated":"2016-12-09 07:42:24.000000000","message":"We should but we don\u0027t have ready solution for locks yet.","commit_id":"e72d73660fc5fa894359cae31594d91cc31ceec4"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"354523b58d92242356479e428de018119320b704","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        # to both be added to the session and locked for update. A"},{"line_number":57,"context_line":"        # single joined query should work, but the combination of left"},{"line_number":58,"context_line":"        # outer joins and postgresql doesn\u0027t seem to work."},{"line_number":59,"context_line":"        port \u003d (session.query(models_v2.Port)."},{"line_number":60,"context_line":"                enable_eagerloads(False)."},{"line_number":61,"context_line":"                filter_by(id\u003dport_id)."},{"line_number":62,"context_line":"                with_lockmode(\u0027update\u0027)."}],"source_content_type":"text/x-python","patch_set":5,"id":"3a71b18c_67bd9f67","line":59,"range":{"start_line":59,"start_character":30,"end_line":59,"end_character":44},"in_reply_to":"3a71b18c_40944ae1","updated":"2016-12-11 23:59:25.000000000","message":"ok, thanks!","commit_id":"e72d73660fc5fa894359cae31594d91cc31ceec4"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"053c71cda1366104487ca00d209503a26d8a4d4c","unresolved":false,"context_lines":[{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":146,"context_line":"        try:"},{"line_number":147,"context_line":"            record \u003d (session.query(models_v2.Port)."},{"line_number":148,"context_line":"                      enable_eagerloads(False)."},{"line_number":149,"context_line":"                      filter(models_v2.Port.id.startswith(port_id))."},{"line_number":150,"context_line":"                      one())"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a71b18c_646ddd98","line":147,"range":{"start_line":147,"start_character":36,"end_line":147,"end_character":50},"updated":"2016-12-09 05:22:19.000000000","message":"ditto","commit_id":"e72d73660fc5fa894359cae31594d91cc31ceec4"},{"author":{"_account_id":22776,"name":"Nakul Dahiwade","email":"nakul.dahiwade@intel.com","username":"nakul.dahiwade"},"change_message_id":"f63cf7ffd5c265778c78f5eb6a506a8f317eade9","unresolved":false,"context_lines":[{"line_number":145,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":146,"context_line":"        try:"},{"line_number":147,"context_line":"            record \u003d (session.query(models_v2.Port)."},{"line_number":148,"context_line":"                      enable_eagerloads(False)."},{"line_number":149,"context_line":"                      filter(models_v2.Port.id.startswith(port_id))."},{"line_number":150,"context_line":"                      one())"},{"line_number":151,"context_line":"            return record"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6eadb0_65c44892","line":148,"updated":"2016-12-12 21:02:37.000000000","message":"nit: Any reason why this query is not implemented in OVO?","commit_id":"e72d73660fc5fa894359cae31594d91cc31ceec4"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"053c71cda1366104487ca00d209503a26d8a4d4c","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        partial_uuids \u003d set(port_id for port_id in port_ids"},{"line_number":195,"context_line":"                            if not uuidutils.is_uuid_like(port_id))"},{"line_number":196,"context_line":"        full_uuids \u003d set(port_ids) - partial_uuids"},{"line_number":197,"context_line":"        or_criteria \u003d [models_v2.Port.id.startswith(port_id)"},{"line_number":198,"context_line":"                       for port_id in partial_uuids]"},{"line_number":199,"context_line":"        if full_uuids:"},{"line_number":200,"context_line":"            or_criteria.append(models_v2.Port.id.in_(full_uuids))"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a71b18c_64f4fdce","line":197,"range":{"start_line":197,"start_character":23,"end_line":197,"end_character":37},"updated":"2016-12-09 05:22:19.000000000","message":"ditto","commit_id":"e72d73660fc5fa894359cae31594d91cc31ceec4"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"053c71cda1366104487ca00d209503a26d8a4d4c","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        or_criteria \u003d [models_v2.Port.id.startswith(port_id)"},{"line_number":198,"context_line":"                       for port_id in partial_uuids]"},{"line_number":199,"context_line":"        if full_uuids:"},{"line_number":200,"context_line":"            or_criteria.append(models_v2.Port.id.in_(full_uuids))"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        query \u003d context.session.query("},{"line_number":203,"context_line":"            models_v2.Port,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a71b18c_a4fe15ac","line":200,"range":{"start_line":200,"start_character":31,"end_line":200,"end_character":45},"updated":"2016-12-09 05:22:19.000000000","message":"ditto","commit_id":"e72d73660fc5fa894359cae31594d91cc31ceec4"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"2265c128bf13ec64d5f3157baea8e7b2fab97db7","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    ports \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(ports), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"def get_ports_and_sgs(context, port_ids):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_3cd37e61","line":163,"range":{"start_line":163,"start_character":11,"end_line":163,"end_character":34},"updated":"2016-12-16 11:44:25.000000000","message":"It can be rewritten: ports.pop() if ports else None.","commit_id":"e4866ccd369265a5a04163e2e450109fbd9ab805"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"12ef271dfaf333b711b2f80b9dba4e45673e6f5c","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    ports \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(ports), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"def get_ports_and_sgs(context, port_ids):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_dcc8ca57","line":163,"range":{"start_line":163,"start_character":11,"end_line":163,"end_character":34},"in_reply_to":"1a6eadb0_3cd37e61","updated":"2016-12-16 11:46:15.000000000","message":"Yeah, I suggested that before. But since it\u0027s a matter of taste, I haven\u0027t pushed.","commit_id":"e4866ccd369265a5a04163e2e450109fbd9ab805"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"efb92878258936e425b299d72a2d5d53c0678b72","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    ports \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(ports), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"def get_ports_and_sgs(context, port_ids):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_399d155a","line":163,"range":{"start_line":163,"start_character":11,"end_line":163,"end_character":34},"updated":"2016-12-19 07:11:54.000000000","message":"I\u0027m not a fan of this construction but if others are happy, I would not make an objection.","commit_id":"f81420c43bb5a15d879a5ff2c62e3815300e0ba0"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"e8effbda15d6b1bb2d2fa72f0220a8ffa81dcb53","unresolved":false,"context_lines":[{"line_number":160,"context_line":"def get_port_from_device_mac(context, device_mac):"},{"line_number":161,"context_line":"    LOG.debug(\"get_port_from_device_mac() called for mac %s\", device_mac)"},{"line_number":162,"context_line":"    ports \u003d port_obj.Port.get_objects(context, mac_address\u003ddevice_mac)"},{"line_number":163,"context_line":"    return next(iter(ports), None)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"def get_ports_and_sgs(context, port_ids):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_d905ea14","line":163,"range":{"start_line":163,"start_character":11,"end_line":163,"end_character":34},"in_reply_to":"1a6eadb0_399d155a","updated":"2016-12-19 15:23:20.000000000","message":"i\u0027ll change it make you guys happy. next patch will simplify it","commit_id":"f81420c43bb5a15d879a5ff2c62e3815300e0ba0"}],"neutron/tests/unit/plugins/ml2/test_db.py":[{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"5c00562220f5a9c84827f2b285aa5849b8cb30ee","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    def setUp(self):"},{"line_number":40,"context_line":"        super(Ml2DBTestCase, self).setUp()"},{"line_number":41,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":42,"context_line":"        self.setup_coreplugin(\u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def _setup_neutron_network(self, network_id):"},{"line_number":45,"context_line":"        with self.ctx.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_16928d57","line":42,"range":{"start_line":42,"start_character":8,"end_line":42,"end_character":79},"updated":"2016-12-03 00:16:17.000000000","message":"is their any other way this can be done, i believe hard coding isn\u0027t a good idea.","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ca69a0c08bf2423bf8554c9c9011aced2fb5dcf0","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    def setUp(self):"},{"line_number":40,"context_line":"        super(Ml2DBTestCase, self).setUp()"},{"line_number":41,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":42,"context_line":"        self.setup_coreplugin(\u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def _setup_neutron_network(self, network_id):"},{"line_number":45,"context_line":"        with self.ctx.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_c05ee411","line":42,"range":{"start_line":42,"start_character":8,"end_line":42,"end_character":79},"in_reply_to":"3a71b18c_16928d57","updated":"2016-12-07 18:42:47.000000000","message":"We would probably need to do some refactoring for test framework to avoid that.","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"ca69a0c08bf2423bf8554c9c9011aced2fb5dcf0","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        super(Ml2DBTestCase, self).setUp()"},{"line_number":41,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":42,"context_line":"        self.setup_coreplugin(\u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def _setup_neutron_network(self, network_id):"},{"line_number":45,"context_line":"        with self.ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":46,"context_line":"            self.ctx.session.add(models_v2.Network(id\u003dnetwork_id))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_80922c9e","line":43,"updated":"2016-12-07 18:42:47.000000000","message":"These are ml2 tests, so shouldn\u0027t we use ml2 plugin here?","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"58d7b64f29b0efff5eb5d235e6bb1ff2dc678ff2","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        super(Ml2DBTestCase, self).setUp()"},{"line_number":41,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":42,"context_line":"        self.setup_coreplugin(\u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def _setup_neutron_network(self, network_id):"},{"line_number":45,"context_line":"        with self.ctx.session.begin(subtransactions\u003dTrue):"},{"line_number":46,"context_line":"            self.ctx.session.add(models_v2.Network(id\u003dnetwork_id))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_200b187f","line":43,"in_reply_to":"3a71b18c_80922c9e","updated":"2016-12-07 18:54:52.000000000","message":"i\u0027ll look and set that up here","commit_id":"e1730d3b6b6c500415999bf7d8f0b8990ee6ef37"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6b5f6e87dc9ac933ac44f26bf4b3a3e3bb6eea45","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    def setUp(self):"},{"line_number":276,"context_line":"        super(Ml2DvrDBTestCase, self).setUp()"},{"line_number":277,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":278,"context_line":"        self.setup_coreplugin(\u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def _setup_neutron_network(self, network_id, port_ids):"},{"line_number":281,"context_line":"        with self.ctx.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_ff07d3c6","line":278,"updated":"2016-12-08 15:17:01.000000000","message":"ml2?","commit_id":"5abbc397d1dfec9a46c394198f30ffe8257bfd44"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"194afbcf9beb512113461ac0fd8afbe7e624aee7","unresolved":false,"context_lines":[{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def test_get_port_multiple_results_found(self):"},{"line_number":224,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":225,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":226,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"},{"line_number":227,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"},{"line_number":228,"context_line":"        self._setup_neutron_network(network_id)"},{"line_number":229,"context_line":"        self._setup_neutron_port(network_id, port_id_one)"},{"line_number":230,"context_line":"        self._setup_neutron_port(network_id, port_id_two)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a6eadb0_a50b0a7c","line":227,"range":{"start_line":225,"start_character":0,"end_line":227,"end_character":47},"updated":"2016-12-16 01:53:19.000000000","message":"I don\u0027t get it here. Originally, port_id should be a prefix of both port_id_one and port_id_two. How can this part ensure that?","commit_id":"117dd358adf8f2501c115d8117ba165df2d2f7b6"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"2e42edbcb204b29d53827cd3bd9a9e75a2c360ce","unresolved":false,"context_lines":[{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def test_get_port_multiple_results_found(self):"},{"line_number":224,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":225,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":226,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"},{"line_number":227,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"},{"line_number":228,"context_line":"        self._setup_neutron_network(network_id)"},{"line_number":229,"context_line":"        self._setup_neutron_port(network_id, port_id_one)"},{"line_number":230,"context_line":"        self._setup_neutron_port(network_id, port_id_two)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a6eadb0_209efeb8","line":227,"range":{"start_line":225,"start_character":0,"end_line":227,"end_character":47},"in_reply_to":"1a6eadb0_a50b0a7c","updated":"2016-12-16 08:31:49.000000000","message":"Yeah, and it seems like get_port is not integrated with OVO yet, so we probably need to keep this test case intact.","commit_id":"117dd358adf8f2501c115d8117ba165df2d2f7b6"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"2265c128bf13ec64d5f3157baea8e7b2fab97db7","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        self.assertEqual(host, port_host)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def test_get_port_binding_host_multiple_results_found(self):"},{"line_number":194,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":195,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":196,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"},{"line_number":197,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_3ca45eb8","line":194,"updated":"2016-12-16 11:44:25.000000000","message":"How is it going to work when generating the UUID?","commit_id":"e4866ccd369265a5a04163e2e450109fbd9ab805"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"12ef271dfaf333b711b2f80b9dba4e45673e6f5c","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        self.assertEqual(host, port_host)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def test_get_port_binding_host_multiple_results_found(self):"},{"line_number":194,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":195,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":196,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"},{"line_number":197,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_dccfea53","line":194,"in_reply_to":"1a6eadb0_3ca45eb8","updated":"2016-12-16 11:46:15.000000000","message":"Meh, another candidate for sqlalchemy mock rework? :-x","commit_id":"e4866ccd369265a5a04163e2e450109fbd9ab805"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"bb526b1d0c05e5d44f9d0e461bad879f64550fcb","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        self.assertEqual(host, port_host)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def test_get_port_binding_host_multiple_results_found(self):"},{"line_number":194,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":195,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":196,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"},{"line_number":197,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_acf10e97","line":194,"in_reply_to":"1a6eadb0_7c8256c9","updated":"2016-12-16 18:11:59.000000000","message":"another solution could be generate multiple uuid\u0027s and make first 8 characters same for all uuid\u0027s how does that sounds ?","commit_id":"e4866ccd369265a5a04163e2e450109fbd9ab805"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"c9bb1212e2aea53b6de4786b61f58081e95234e7","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        self.assertEqual(host, port_host)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def test_get_port_binding_host_multiple_results_found(self):"},{"line_number":194,"context_line":"        network_id \u003d uuidutils.generate_uuid()"},{"line_number":195,"context_line":"        port_id \u003d uuidutils.generate_uuid()"},{"line_number":196,"context_line":"        port_id_one \u003d uuidutils.generate_uuid()"},{"line_number":197,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_7c8256c9","line":194,"in_reply_to":"1a6eadb0_dccfea53","updated":"2016-12-16 11:49:04.000000000","message":"yeah, I wonder if startswith is a still valid case? Port-id should be UUID, is there some use-case, when you are passing start of port uuid and hope to get multiple results?","commit_id":"e4866ccd369265a5a04163e2e450109fbd9ab805"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"bbffde1c50ac0d0c6c09d460deb4349997c83ac6","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def setUp(self):"},{"line_number":41,"context_line":"        super(Ml2DBTestCase, self).setUp()"},{"line_number":42,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":43,"context_line":"        self.setup_coreplugin(\u0027ml2\u0027)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _setup_neutron_network(self, network_id):"},{"line_number":46,"context_line":"        with self.ctx.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a6eadb0_6eff73aa","line":43,"range":{"start_line":43,"start_character":30,"end_line":43,"end_character":35},"updated":"2016-12-20 14:52:30.000000000","message":"I noticed that several unit tests under this folder make a reference to a plugin constant[1], shouldn\u0027t be better to refer it as well?\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/tests/unit/plugins/ml2/test_plugin.py#L84","commit_id":"0af50736fc800f898728d6d879509f7c266fe745"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"bbffde1c50ac0d0c6c09d460deb4349997c83ac6","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    def setUp(self):"},{"line_number":276,"context_line":"        super(Ml2DvrDBTestCase, self).setUp()"},{"line_number":277,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":278,"context_line":"        self.setup_coreplugin(\u0027ml2\u0027)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def _setup_neutron_network(self, network_id, port_ids):"},{"line_number":281,"context_line":"        with self.ctx.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a6eadb0_aed6eb24","line":278,"range":{"start_line":278,"start_character":30,"end_line":278,"end_character":34},"updated":"2016-12-20 14:52:30.000000000","message":"ditto: line 43","commit_id":"0af50736fc800f898728d6d879509f7c266fe745"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"9a7b4a99fb3ff76e84d637158767bc28c7321c1f","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"},{"line_number":201,"context_line":"        # NOTE(manjeets) to check startswith testcase we"},{"line_number":202,"context_line":"        # need port ids with same characters"},{"line_number":203,"context_line":"        port_id_one.replace(port_id_one[:8], port_id[:8])"},{"line_number":204,"context_line":"        port_id_two.replace(port_id_two[:8], port_id[:8])"},{"line_number":205,"context_line":"        host \u003d \u0027fake_host\u0027"},{"line_number":206,"context_line":"        vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":207,"context_line":"        self._setup_neutron_network(network_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a6eadb0_177a74f1","line":204,"range":{"start_line":203,"start_character":0,"end_line":204,"end_character":57},"updated":"2016-12-21 06:19:42.000000000","message":"Hey, I think these two lines should be like this:\n        port_id_one \u003d port_id_one.replace(port_id_one[:8], port_id[:8])\n        port_id_two \u003d port_id_two.replace(port_id_two[:8], port_id[:8])\n\nreplace() only returns the modified value but will not change the original value of port_id_one(two). I have tested this.\n\n\u003e\u003e\u003e a\n\u0027aa4ab9e0-5255-4276-89e6-dfdb50564c49\u0027 \n\u003e\u003e\u003e b\n\u0027945297e6-5416-453d-b80a-054042e1d77a\u0027\n\u003e\u003e\u003e c\n\u0027e9ad79c5-5dd2-4823-a177-722d9578afca\u0027\n\u003e\u003e\u003e a.replace(a[:8], c[:8])\n\u0027e9ad79c5-5255-4276-89e6-dfdb50564c49\u0027\n\u003e\u003e\u003e b.replace(b[:8], c[:8])\n\u0027e9ad79c5-5416-453d-b80a-054042e1d77a\u0027\n\u003e\u003e\u003e a\n\u0027aa4ab9e0-5255-4276-89e6-dfdb50564c49\u0027\n\nThe reason we still pass this test is because we did not set any port binding with port_id[:8] thus the returning result of host is none with respect to port_id[:8].","commit_id":"e6c3c149ce11937d8a75ae68db3ca0ebb86630d7"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"599e62ea1e192703b81c5363881bc3504523f51c","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        port_id_two \u003d uuidutils.generate_uuid()"},{"line_number":201,"context_line":"        # NOTE(manjeets) to check startswith testcase we"},{"line_number":202,"context_line":"        # need port ids with same characters"},{"line_number":203,"context_line":"        port_id_one.replace(port_id_one[:8], port_id[:8])"},{"line_number":204,"context_line":"        port_id_two.replace(port_id_two[:8], port_id[:8])"},{"line_number":205,"context_line":"        host \u003d \u0027fake_host\u0027"},{"line_number":206,"context_line":"        vif_type \u003d portbindings.VIF_TYPE_UNBOUND"},{"line_number":207,"context_line":"        self._setup_neutron_network(network_id)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa48f94a_7255181c","line":204,"range":{"start_line":203,"start_character":0,"end_line":204,"end_character":57},"in_reply_to":"1a6eadb0_177a74f1","updated":"2016-12-21 17:32:46.000000000","message":"good catch !, I have better solution than replace as replace first searches and then replace.\ni\u0027ll use concatenation.","commit_id":"e6c3c149ce11937d8a75ae68db3ca0ebb86630d7"}]}
