)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"b5c58aee2ee072db80dbfbc99fe50a2389e9b0a3","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Nexus MD: Neutron trunk support"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add neutron trunk support to the cisco_nexus mechanism driver."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I0992312dfba5c58302b050d409bbbb3d180ea0a0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"1f1a1f67_75562d2c","line":9,"range":{"start_line":9,"start_character":61,"end_line":9,"end_character":62},"updated":"2017-07-13 14:17:18.000000000","message":"A little more detail would be nice.  For instance.....\nThis will result in native vlan being configured for parent port and unique vlans configured for each subport on the Nexus device.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"61eee3a6d2c75084bbfca9ada7eba72672e113c5","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Nexus MD: Neutron trunk support"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add neutron trunk support to the cisco_nexus mechanism driver."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I0992312dfba5c58302b050d409bbbb3d180ea0a0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"1f1a1f67_ab522666","line":9,"range":{"start_line":9,"start_character":61,"end_line":9,"end_character":62},"in_reply_to":"1f1a1f67_75562d2c","updated":"2017-07-13 19:02:14.000000000","message":"Done","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"}],"networking_cisco/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py":[{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":618,"context_line":"        port \u003d context.current"},{"line_number":619,"context_line":""},{"line_number":620,"context_line":"        if self.trunk.is_trunk_subport_baremetal(port):"},{"line_number":621,"context_line":"            self._baremetal_set_binding(context)"},{"line_number":622,"context_line":"            return True"},{"line_number":623,"context_line":""},{"line_number":624,"context_line":"        if not self._is_baremetal(port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_0d2dc594","line":621,"range":{"start_line":621,"start_character":17,"end_line":621,"end_character":39},"updated":"2017-06-21 18:02:44.000000000","message":"this method returns a boolean but you chose to ignore it and always call true?  Is this intended?","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":618,"context_line":"        port \u003d context.current"},{"line_number":619,"context_line":""},{"line_number":620,"context_line":"        if self.trunk.is_trunk_subport_baremetal(port):"},{"line_number":621,"context_line":"            self._baremetal_set_binding(context)"},{"line_number":622,"context_line":"            return True"},{"line_number":623,"context_line":""},{"line_number":624,"context_line":"        if not self._is_baremetal(port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_d0c87856","line":621,"range":{"start_line":621,"start_character":17,"end_line":621,"end_character":39},"in_reply_to":"5f201791_0d2dc594","updated":"2017-06-21 21:19:32.000000000","message":"I can just return the value from _baremetal_set_binding.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":658,"context_line":""},{"line_number":659,"context_line":"        selected \u003d self._baremetal_set_binding(context, all_link_info)"},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"        if selected is True and self.trunk.is_trunk_parentport(port):"},{"line_number":662,"context_line":"            self.trunk.update_subports(port)"},{"line_number":663,"context_line":""},{"line_number":664,"context_line":"        return selected"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_8d91d555","line":661,"range":{"start_line":661,"start_character":23,"end_line":661,"end_character":27},"updated":"2017-06-21 18:02:44.000000000","message":"wouldn\u0027t \u0027if selected and\u0027 suffice?","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":658,"context_line":""},{"line_number":659,"context_line":"        selected \u003d self._baremetal_set_binding(context, all_link_info)"},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"        if selected is True and self.trunk.is_trunk_parentport(port):"},{"line_number":662,"context_line":"            self.trunk.update_subports(port)"},{"line_number":663,"context_line":""},{"line_number":664,"context_line":"        return selected"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_d0699825","line":661,"range":{"start_line":661,"start_character":23,"end_line":661,"end_character":27},"in_reply_to":"5f201791_8d91d555","updated":"2017-06-21 21:19:32.000000000","message":"Yup. I\u0027ll remove \u0027is True\u0027.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"a96905615190800e6c27189c717e22faade636e6","unresolved":false,"context_lines":[{"line_number":1649,"context_line":"            return"},{"line_number":1650,"context_line":""},{"line_number":1651,"context_line":"        # if parent trunk port then process event for subports."},{"line_number":1652,"context_line":"        if self.trunk.is_trunk_parentport(port):"},{"line_number":1653,"context_line":"            self.trunk.process_subports(port, func)"},{"line_number":1654,"context_line":""},{"line_number":1655,"context_line":"        device_id \u003d port.get(\u0027device_id\u0027)"},{"line_number":1656,"context_line":"        if self._is_baremetal(port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_42fdc738","line":1653,"range":{"start_line":1652,"start_character":4,"end_line":1653,"end_character":51},"updated":"2017-06-21 14:27:03.000000000","message":"If I\u0027m not mistaken, this will take care of the VM case and program vlans for trunk subports.\n\nIn the vm case, the agent running on the compute host will update the subports, which will result in the calls to _update_port_precommit() and _update_port_postcommit() in this MD. Therefore, to program the switch, the subports should be processed in those calls. In doing that, the correct vlans will be programmed.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":1649,"context_line":"            return"},{"line_number":1650,"context_line":""},{"line_number":1651,"context_line":"        # if parent trunk port then process event for subports."},{"line_number":1652,"context_line":"        if self.trunk.is_trunk_parentport(port):"},{"line_number":1653,"context_line":"            self.trunk.process_subports(port, func)"},{"line_number":1654,"context_line":""},{"line_number":1655,"context_line":"        device_id \u003d port.get(\u0027device_id\u0027)"},{"line_number":1656,"context_line":"        if self._is_baremetal(port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_10d6f0c6","line":1653,"range":{"start_line":1652,"start_character":4,"end_line":1653,"end_character":51},"in_reply_to":"5f201791_42fdc738","updated":"2017-06-21 21:19:32.000000000","message":"If we allow the event handlers to process events from device_owner \u003d\u003d \u0027trunk:subport\u0027 then the existing flow of the handlers will access the vlan from the network segment.\nIf this is \u0027the correct vlan\u0027 then this is probably how I\u0027ll change the code. We still need to meet to determine how vlan IDs provided via the trunk subport commands are used vs. a subport\u0027s bounded network segment ID.\n(I actually at one point had the MD driver program the subport\u0027s network ID programmed on the switch. It wasn\u0027t what I intended, so I removed that code.)","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b4e02d7adf9b7e5e4d8f344f3959e736e35317b2","unresolved":false,"context_lines":[{"line_number":1667,"context_line":"            host_id \u003d port.get(\u0027dns_name\u0027)"},{"line_number":1668,"context_line":"        else:"},{"line_number":1669,"context_line":"            host_id \u003d port.get(bc.portbindings.HOST_ID)"},{"line_number":1670,"context_line":""},{"line_number":1671,"context_line":"        vlan_id \u003d segment.get(api.SEGMENTATION_ID)"},{"line_number":1672,"context_line":""},{"line_number":1673,"context_line":"        # TODO(rpothier) Add back in provider segment support."}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_464a9780","line":1670,"range":{"start_line":1670,"start_character":0,"end_line":1670,"end_character":0},"updated":"2017-07-12 18:21:35.000000000","message":"nit, white space","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":1667,"context_line":"            host_id \u003d port.get(\u0027dns_name\u0027)"},{"line_number":1668,"context_line":"        else:"},{"line_number":1669,"context_line":"            host_id \u003d port.get(bc.portbindings.HOST_ID)"},{"line_number":1670,"context_line":""},{"line_number":1671,"context_line":"        vlan_id \u003d segment.get(api.SEGMENTATION_ID)"},{"line_number":1672,"context_line":""},{"line_number":1673,"context_line":"        # TODO(rpothier) Add back in provider segment support."}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_71ae61e8","line":1670,"range":{"start_line":1670,"start_character":0,"end_line":1670,"end_character":0},"in_reply_to":"1f1a1f67_464a9780","updated":"2017-07-13 02:20:47.000000000","message":"Yes. I added the blank lines on purpose because I had issues when looking at the code to find the vlan_id. My next commit will be for the is_provider support (line below). At that point I may rework these few lines.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b4e02d7adf9b7e5e4d8f344f3959e736e35317b2","unresolved":false,"context_lines":[{"line_number":1669,"context_line":"            host_id \u003d port.get(bc.portbindings.HOST_ID)"},{"line_number":1670,"context_line":""},{"line_number":1671,"context_line":"        vlan_id \u003d segment.get(api.SEGMENTATION_ID)"},{"line_number":1672,"context_line":""},{"line_number":1673,"context_line":"        # TODO(rpothier) Add back in provider segment support."},{"line_number":1674,"context_line":"        is_provider \u003d False"},{"line_number":1675,"context_line":"        settings \u003d {\"vlan_id\": vlan_id,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_065c9f49","line":1672,"range":{"start_line":1672,"start_character":0,"end_line":1672,"end_character":0},"updated":"2017-07-12 18:21:35.000000000","message":"ditto","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":1669,"context_line":"            host_id \u003d port.get(bc.portbindings.HOST_ID)"},{"line_number":1670,"context_line":""},{"line_number":1671,"context_line":"        vlan_id \u003d segment.get(api.SEGMENTATION_ID)"},{"line_number":1672,"context_line":""},{"line_number":1673,"context_line":"        # TODO(rpothier) Add back in provider segment support."},{"line_number":1674,"context_line":"        is_provider \u003d False"},{"line_number":1675,"context_line":"        settings \u003d {\"vlan_id\": vlan_id,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_31b8e928","line":1672,"range":{"start_line":1672,"start_character":0,"end_line":1672,"end_character":0},"in_reply_to":"1f1a1f67_065c9f49","updated":"2017-07-13 02:20:47.000000000","message":"Same","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4295e45822bdb3a211bb02581842367dea014347","unresolved":false,"context_lines":[{"line_number":1792,"context_line":"            context.original_bottom_bound_segment)"},{"line_number":1793,"context_line":""},{"line_number":1794,"context_line":"        if (self._is_vm_migrating(context, vlan_segment, orig_vlan_segment) or"},{"line_number":1795,"context_line":"            self._is_status_down(context.current)):"},{"line_number":1796,"context_line":"            vni \u003d (self._port_action_vxlan("},{"line_number":1797,"context_line":"                context.original, orig_vxlan_segment, self._delete_nve_db)"},{"line_number":1798,"context_line":"                if orig_vxlan_segment else 0)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_84bc1d6a","line":1795,"range":{"start_line":1795,"start_character":41,"end_line":1795,"end_character":48},"updated":"2017-07-12 20:50:50.000000000","message":"Couldn\u0027t _delete_nve_db and _delete_nxos_db be called multiple times with this addition of _is_status_down()?  Could this result is undesirable exceptions?","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"61eee3a6d2c75084bbfca9ada7eba72672e113c5","unresolved":false,"context_lines":[{"line_number":1792,"context_line":"            context.original_bottom_bound_segment)"},{"line_number":1793,"context_line":""},{"line_number":1794,"context_line":"        if (self._is_vm_migrating(context, vlan_segment, orig_vlan_segment) or"},{"line_number":1795,"context_line":"            self._is_status_down(context.current)):"},{"line_number":1796,"context_line":"            vni \u003d (self._port_action_vxlan("},{"line_number":1797,"context_line":"                context.original, orig_vxlan_segment, self._delete_nve_db)"},{"line_number":1798,"context_line":"                if orig_vxlan_segment else 0)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_e60df537","line":1795,"range":{"start_line":1795,"start_character":41,"end_line":1795,"end_character":48},"in_reply_to":"1f1a1f67_55d33139","updated":"2017-07-13 19:02:14.000000000","message":"Yes, the original code worked ... but not as designed.\n\n_is_vm_migrating() is suppose to look for a VM moving between compute hosts but it also (incorrectly) was being triggered when a port became unbound (triggering the delete operations).\n\nI rewrote so that _is_vm_migrating will now pick up when VMs move from one host_id to another (and only that case) and added _is_status_down to detect when a port is unbound (therefore in the DOWN state).\n\nRight now the actions for both vm migration and a port being detected as DOWN is the same but it may not always be that case.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"c89af2846834491a7c2fb383a297c69561962505","unresolved":false,"context_lines":[{"line_number":1792,"context_line":"            context.original_bottom_bound_segment)"},{"line_number":1793,"context_line":""},{"line_number":1794,"context_line":"        if (self._is_vm_migrating(context, vlan_segment, orig_vlan_segment) or"},{"line_number":1795,"context_line":"            self._is_status_down(context.current)):"},{"line_number":1796,"context_line":"            vni \u003d (self._port_action_vxlan("},{"line_number":1797,"context_line":"                context.original, orig_vxlan_segment, self._delete_nve_db)"},{"line_number":1798,"context_line":"                if orig_vxlan_segment else 0)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_55d33139","line":1795,"range":{"start_line":1795,"start_character":41,"end_line":1795,"end_character":48},"in_reply_to":"1f1a1f67_5d12545a","updated":"2017-07-13 14:28:41.000000000","message":"Hmm, this looks like a bug in the code. So your change would address the case where a nova instance is booted as:\n   nova boot --nic port-id\u003d\u003cp\u003e\n\nAnd when the instance is deleted, nexus will receive a port down event and the binding in db should be removed. \n\nBut the original code seems to be ok since in this case, the current host_id would be NULL and the original would be valid. In a sense, nexus takes actions with binding changes (but not port status changes).","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":1792,"context_line":"            context.original_bottom_bound_segment)"},{"line_number":1793,"context_line":""},{"line_number":1794,"context_line":"        if (self._is_vm_migrating(context, vlan_segment, orig_vlan_segment) or"},{"line_number":1795,"context_line":"            self._is_status_down(context.current)):"},{"line_number":1796,"context_line":"            vni \u003d (self._port_action_vxlan("},{"line_number":1797,"context_line":"                context.original, orig_vxlan_segment, self._delete_nve_db)"},{"line_number":1798,"context_line":"                if orig_vxlan_segment else 0)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_5d12545a","line":1795,"range":{"start_line":1795,"start_character":41,"end_line":1795,"end_character":48},"in_reply_to":"1f1a1f67_84bc1d6a","updated":"2017-07-13 02:20:47.000000000","message":"There\u0027s a few reasons why I changed this code.\nOne was that _is_vm_migrating() was not working as designed.\nBefore this change a vlan was being removed from our db and switch by passing the _is_vm_migrating() check. The nova delete event will cause neutron to generate an update that the port is DOWN (and note that the host_id is removed from the port\u0027s dictionary/db). Because the host_id is None and the previous segment has the (old) host_id we are calling the delete call here (and in postcommit). I fixed _is_vm_migrating() to check for two non-None hostids.\nHowever, we still want to delete the vlan at this event.\nWe don\u0027t want delete_port* calls to remove because some customers just reuse ports. i.e. create vm w/ port, delete that vm, create new vm with same port.\nSo that\u0027s why I added looking for port DOWN states.\n\nWe do get multiple calls for port updates when the port is ACTIVE. Not sure if I\u0027ve seen multiple calls when the port is DOWN. But regardless both our create and delete code protects against multiple calls with, from our driver perspective, the same required action. Ex. the delete_nxos_db code attempts to delete the row but allows for the row not to exist, i.e. exception checks for row not found.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"}],"networking_cisco/plugins/ml2/drivers/cisco/nexus/trunk.py":[{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    def __init__(self):"},{"line_number":36,"context_line":"        # To prevent recursive importing."},{"line_number":37,"context_line":"        from networking_cisco import backwards_compatibility"},{"line_number":38,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _is_baremetal(self, port):"},{"line_number":41,"context_line":"        return (port[self.bc.portbindings.VNIC_TYPE] \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_5fcfee56","line":38,"range":{"start_line":38,"start_character":15,"end_line":38,"end_character":16},"updated":"2017-06-21 18:02:44.000000000","message":"Why do you need to assign backwards_compatibility to self.bc?  Why not just import it \u0027as bc\u0027 and use bc.x instead of self.bc.x?  I made this change in my workspace and pep8 \u0026 py27 seem to work successfully.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    def __init__(self):"},{"line_number":36,"context_line":"        # To prevent recursive importing."},{"line_number":37,"context_line":"        from networking_cisco import backwards_compatibility"},{"line_number":38,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _is_baremetal(self, port):"},{"line_number":41,"context_line":"        return (port[self.bc.portbindings.VNIC_TYPE] \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_7031a40b","line":38,"range":{"start_line":38,"start_character":15,"end_line":38,"end_character":16},"in_reply_to":"7f231b9d_5fcfee56","updated":"2017-06-21 21:19:32.000000000","message":"I tried that but it\u0027s not accessible from the methods below.\nRunning -py27 imports the neutron code from stable/mitaka.\nTrunking is not supported on this branch and I needed to stub out any calls from mech_cisco_nexus from accessing the trunk code (since it doesn\u0027t even exist. See BC changes.) Not also that all the new trunk UTs don\u0027t even run for stable/mitaka.\nI\u0027ve added skipIfs around the test classes.\n(I will test again.)","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        # trunk database (2) on deletes, port device_owner will indicate"},{"line_number":50,"context_line":"        # subport type."},{"line_number":51,"context_line":"        if (port[\u0027device_owner\u0027] \u003d\u003d trunk_consts.TRUNK_SUBPORT_OWNER or"},{"line_number":52,"context_line":"            trunk_objects.SubPort.get_object(self.bc.get_context(),"},{"line_number":53,"context_line":"                                             port_id\u003dport[\u0027id\u0027])):"},{"line_number":54,"context_line":"            return True"},{"line_number":55,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_75e8a815","line":52,"range":{"start_line":52,"start_character":12,"end_line":52,"end_character":25},"updated":"2017-06-21 18:02:44.000000000","message":"Perhaps you should call get_trunk_subport() here instead of trunk_objects.SubPort.get_object(....) to avoid duplication?","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        # trunk database (2) on deletes, port device_owner will indicate"},{"line_number":50,"context_line":"        # subport type."},{"line_number":51,"context_line":"        if (port[\u0027device_owner\u0027] \u003d\u003d trunk_consts.TRUNK_SUBPORT_OWNER or"},{"line_number":52,"context_line":"            trunk_objects.SubPort.get_object(self.bc.get_context(),"},{"line_number":53,"context_line":"                                             port_id\u003dport[\u0027id\u0027])):"},{"line_number":54,"context_line":"            return True"},{"line_number":55,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_501fc86b","line":52,"range":{"start_line":52,"start_character":12,"end_line":52,"end_character":25},"in_reply_to":"5f201791_75e8a815","updated":"2017-06-21 21:19:32.000000000","message":"Yup.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        el_context \u003d context.elevated()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        subport_obj \u003d trunk_objects.SubPort.get_object("},{"line_number":67,"context_line":"            el_context, port_id\u003dport[\u0027id\u0027])"},{"line_number":68,"context_line":"        if subport_obj:"},{"line_number":69,"context_line":"            trunk_obj \u003d trunk_objects.Trunk.get_object("},{"line_number":70,"context_line":"                el_context, id\u003dsubport_obj.trunk_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_d5c1bc82","line":67,"range":{"start_line":67,"start_character":40,"end_line":67,"end_character":43},"updated":"2017-06-21 18:02:44.000000000","message":"Call get_trunk_subport() here too??","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        el_context \u003d context.elevated()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        subport_obj \u003d trunk_objects.SubPort.get_object("},{"line_number":67,"context_line":"            el_context, port_id\u003dport[\u0027id\u0027])"},{"line_number":68,"context_line":"        if subport_obj:"},{"line_number":69,"context_line":"            trunk_obj \u003d trunk_objects.Trunk.get_object("},{"line_number":70,"context_line":"                el_context, id\u003dsubport_obj.trunk_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_3b042d15","line":67,"range":{"start_line":67,"start_character":40,"end_line":67,"end_character":43},"in_reply_to":"5f201791_d5c1bc82","updated":"2017-06-21 21:19:32.000000000","message":"Done","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        if not all_link_info:"},{"line_number":91,"context_line":"            context \u003d self.bc.get_context()"},{"line_number":92,"context_line":"            subport_obj \u003d trunk_objects.SubPort.get_object("},{"line_number":93,"context_line":"                context, port_id\u003dsubport[\u0027id\u0027])"},{"line_number":94,"context_line":"            if subport_obj:"},{"line_number":95,"context_line":"                el_context \u003d context.elevated()"},{"line_number":96,"context_line":"                trunk_obj \u003d trunk_objects.Trunk.get_object("}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_9517c4ee","line":93,"range":{"start_line":93,"start_character":33,"end_line":93,"end_character":40},"updated":"2017-06-21 18:02:44.000000000","message":"Could get_trunk_subport() be used here as well?","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        if not all_link_info:"},{"line_number":91,"context_line":"            context \u003d self.bc.get_context()"},{"line_number":92,"context_line":"            subport_obj \u003d trunk_objects.SubPort.get_object("},{"line_number":93,"context_line":"                context, port_id\u003dsubport[\u0027id\u0027])"},{"line_number":94,"context_line":"            if subport_obj:"},{"line_number":95,"context_line":"                el_context \u003d context.elevated()"},{"line_number":96,"context_line":"                trunk_obj \u003d trunk_objects.Trunk.get_object("}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_fb0d9537","line":93,"range":{"start_line":93,"start_character":33,"end_line":93,"end_character":40},"in_reply_to":"5f201791_9517c4ee","updated":"2017-06-21 21:19:32.000000000","message":"Done","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        return all_link_info"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def process_subports(self, port, func):"},{"line_number":105,"context_line":"        host_id \u003d (port.get(dns.DNSNAME) if self._is_baremetal(port) else"},{"line_number":106,"context_line":"                   port.get(self.bc.portbindings.HOST_ID))"},{"line_number":107,"context_line":"        if host_id:"},{"line_number":108,"context_line":"            trunk_details \u003d port.get(\u0027trunk_details\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_d579bc2f","line":105,"range":{"start_line":105,"start_character":32,"end_line":105,"end_character":39},"updated":"2017-06-21 18:02:44.000000000","message":"For baremetal case, DNSNAME will only be present if configured else None.  If None, host_id should be const.RESERVED_PORT_HOST_ID.  Does trunking only function when DNS is configured for baremetal?  Also perhaps a helper function _get_host_id() would be useful for your  code.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        return all_link_info"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def process_subports(self, port, func):"},{"line_number":105,"context_line":"        host_id \u003d (port.get(dns.DNSNAME) if self._is_baremetal(port) else"},{"line_number":106,"context_line":"                   port.get(self.bc.portbindings.HOST_ID))"},{"line_number":107,"context_line":"        if host_id:"},{"line_number":108,"context_line":"            trunk_details \u003d port.get(\u0027trunk_details\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_5be92918","line":105,"range":{"start_line":105,"start_character":32,"end_line":105,"end_character":39},"in_reply_to":"5f201791_d579bc2f","updated":"2017-06-21 21:19:32.000000000","message":"If I can use RESERVED_PORT_HOST_ID I will move to a helper.\nRight now there are only two places were I access the host_id, but the additional logic (for RESERVED* setting) probably puts it over the top.\nI need to look at the call flow again to see what happens when there there is no real host_id, I\u0027m thinking/hoping that it\u0027s no different than any of the other events and won\u0027t be an issue.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        if host_id:"},{"line_number":108,"context_line":"            trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":109,"context_line":"            subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":110,"context_line":"            context \u003d self.bc.get_context()"},{"line_number":111,"context_line":"            el_context \u003d context.elevated()"},{"line_number":112,"context_line":"            for subport in subports:"},{"line_number":113,"context_line":"                sub_port \u003d self.bc.get_plugin().get_port("},{"line_number":114,"context_line":"                        el_context, subport[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_f554b856","line":111,"range":{"start_line":110,"start_character":0,"end_line":111,"end_character":43},"updated":"2017-06-21 18:02:44.000000000","message":"You seem to do these two lines a lot, perhaps a helper function would be useful and applied throughout this code.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        if host_id:"},{"line_number":108,"context_line":"            trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":109,"context_line":"            subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":110,"context_line":"            context \u003d self.bc.get_context()"},{"line_number":111,"context_line":"            el_context \u003d context.elevated()"},{"line_number":112,"context_line":"            for subport in subports:"},{"line_number":113,"context_line":"                sub_port \u003d self.bc.get_plugin().get_port("},{"line_number":114,"context_line":"                        el_context, subport[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_fbf7d5f4","line":111,"range":{"start_line":110,"start_character":0,"end_line":111,"end_character":43},"in_reply_to":"5f201791_f554b856","updated":"2017-06-21 21:19:32.000000000","message":"Yeah, it\u0027s now at three accesses, so I\u0027ll move to a helper.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"53fb6d03eefba76ab8477bfb555ff9838b84db66","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            for subport in subports:"},{"line_number":113,"context_line":"                sub_port \u003d self.bc.get_plugin().get_port("},{"line_number":114,"context_line":"                        el_context, subport[\u0027port_id\u0027])"},{"line_number":115,"context_line":"                func(sub_port, subport[\u0027segmentation_id\u0027], subport[\u0027port_id\u0027],"},{"line_number":116,"context_line":"                     host_id, NO_VNI, NO_PROVIDER_NETWORK)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_subports(self, port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_a14b9985","line":115,"range":{"start_line":115,"start_character":31,"end_line":115,"end_character":57},"updated":"2017-06-20 18:46:29.000000000","message":"This doesn\u0027t look correct. segmentation_id configured on the trunk subport maybe different from the neutron network where the subport is created on. The vlan associated with the neutron network should be used instead on nexus.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"90a51c2163a697054d3f77bfa77a73789224e74e","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            for subport in subports:"},{"line_number":113,"context_line":"                sub_port \u003d self.bc.get_plugin().get_port("},{"line_number":114,"context_line":"                        el_context, subport[\u0027port_id\u0027])"},{"line_number":115,"context_line":"                func(sub_port, subport[\u0027segmentation_id\u0027], subport[\u0027port_id\u0027],"},{"line_number":116,"context_line":"                     host_id, NO_VNI, NO_PROVIDER_NETWORK)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_subports(self, port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_2c73f5e9","line":115,"range":{"start_line":115,"start_character":31,"end_line":115,"end_character":57},"in_reply_to":"5f201791_a14b9985","updated":"2017-06-21 01:12:13.000000000","message":"Programming the segmentation_id that\u0027s assigned on the trunk subport command should be programmed on the switch. But as we\u0027ve discussed, there may be some additional code required if we also have to program the vlan associated with this neutron port\u0027s network segment. Investigation ongoing.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    def update_subports(self, port):"},{"line_number":119,"context_line":"        \"\"\"Set port attributes for trunk subports."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        For baremetal deployments, set the neturon port attributes"},{"line_number":122,"context_line":"        during the bind_port event."},{"line_number":123,"context_line":"        \"\"\""},{"line_number":124,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_a26ca036","line":121,"range":{"start_line":121,"start_character":43,"end_line":121,"end_character":50},"updated":"2017-06-21 18:02:44.000000000","message":"Typo","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    def update_subports(self, port):"},{"line_number":119,"context_line":"        \"\"\"Set port attributes for trunk subports."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        For baremetal deployments, set the neturon port attributes"},{"line_number":122,"context_line":"        during the bind_port event."},{"line_number":123,"context_line":"        \"\"\""},{"line_number":124,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_3bd78d4e","line":121,"range":{"start_line":121,"start_character":43,"end_line":121,"end_character":50},"in_reply_to":"5f201791_a26ca036","updated":"2017-06-21 21:19:32.000000000","message":"Done","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        \"\"\""},{"line_number":124,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":125,"context_line":"        subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":126,"context_line":"        host_id \u003d (port.get(dns.DNSNAME) if self._is_baremetal(port) else"},{"line_number":127,"context_line":"                   port.get(self.bc.portbindings.HOST_ID))"},{"line_number":128,"context_line":"        context \u003d self.bc.get_context()"},{"line_number":129,"context_line":"        el_context \u003d context.elevated()"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_624fa8bd","line":127,"range":{"start_line":126,"start_character":0,"end_line":127,"end_character":58},"updated":"2017-06-21 18:02:44.000000000","message":"Same comment as previosly on DNSNAME","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        \"\"\""},{"line_number":124,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":125,"context_line":"        subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":126,"context_line":"        host_id \u003d (port.get(dns.DNSNAME) if self._is_baremetal(port) else"},{"line_number":127,"context_line":"                   port.get(self.bc.portbindings.HOST_ID))"},{"line_number":128,"context_line":"        context \u003d self.bc.get_context()"},{"line_number":129,"context_line":"        el_context \u003d context.elevated()"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_1bccd1ba","line":127,"range":{"start_line":126,"start_character":0,"end_line":127,"end_character":58},"in_reply_to":"5f201791_624fa8bd","updated":"2017-06-21 21:19:32.000000000","message":"Done","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b4e02d7adf9b7e5e4d8f344f3959e736e35317b2","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    def is_trunk_subport(self, port):"},{"line_number":38,"context_line":"        return port[\u0027device_owner\u0027] \u003d\u003d bc.trunk_consts.TRUNK_SUBPORT_OWNER"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def update_subports(self, port):"},{"line_number":41,"context_line":"        \"\"\"Set port attributes for trunk subports."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        For baremetal deployments, set the neturon port attributes"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_08c5c93c","line":40,"range":{"start_line":40,"start_character":34,"end_line":40,"end_character":36},"updated":"2017-07-12 18:21:35.000000000","message":"I think this is for bare metal case only. So please indicate that in the following python doc.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    def is_trunk_subport(self, port):"},{"line_number":38,"context_line":"        return port[\u0027device_owner\u0027] \u003d\u003d bc.trunk_consts.TRUNK_SUBPORT_OWNER"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def update_subports(self, port):"},{"line_number":41,"context_line":"        \"\"\"Set port attributes for trunk subports."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        For baremetal deployments, set the neturon port attributes"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_d1ed3526","line":40,"range":{"start_line":40,"start_character":34,"end_line":40,"end_character":36},"in_reply_to":"1f1a1f67_08c5c93c","updated":"2017-07-13 02:20:47.000000000","message":"My python doc do you mean this docstring?\nI mention below \"For baremetal deployments, ...\"","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"c89af2846834491a7c2fb383a297c69561962505","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    def is_trunk_subport(self, port):"},{"line_number":38,"context_line":"        return port[\u0027device_owner\u0027] \u003d\u003d bc.trunk_consts.TRUNK_SUBPORT_OWNER"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def update_subports(self, port):"},{"line_number":41,"context_line":"        \"\"\"Set port attributes for trunk subports."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        For baremetal deployments, set the neturon port attributes"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_f204937d","line":40,"range":{"start_line":40,"start_character":34,"end_line":40,"end_character":36},"in_reply_to":"1f1a1f67_d1ed3526","updated":"2017-07-13 14:28:41.000000000","message":"I was thinking of a docstring like \"this method is only applicable to bare metal deployment....\"","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"61eee3a6d2c75084bbfca9ada7eba72672e113c5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    def is_trunk_subport(self, port):"},{"line_number":38,"context_line":"        return port[\u0027device_owner\u0027] \u003d\u003d bc.trunk_consts.TRUNK_SUBPORT_OWNER"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def update_subports(self, port):"},{"line_number":41,"context_line":"        \"\"\"Set port attributes for trunk subports."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        For baremetal deployments, set the neturon port attributes"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_065a31f2","line":40,"range":{"start_line":40,"start_character":34,"end_line":40,"end_character":36},"in_reply_to":"1f1a1f67_f204937d","updated":"2017-07-13 19:02:14.000000000","message":"I\u0027ll change the existing docstring to include the word \u0027only\u0027.\n\"For baremetal deployments, ...\"\nto\n\"For baremetal deployments only, ...\"","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4295e45822bdb3a211bb02581842367dea014347","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def update_subports(self, port):"},{"line_number":41,"context_line":"        \"\"\"Set port attributes for trunk subports."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        For baremetal deployments, set the neturon port attributes"},{"line_number":44,"context_line":"        during the bind_port event."},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_0e8eec77","line":43,"range":{"start_line":43,"start_character":43,"end_line":43,"end_character":50},"updated":"2017-07-12 20:50:50.000000000","message":"typo still here.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def update_subports(self, port):"},{"line_number":41,"context_line":"        \"\"\"Set port attributes for trunk subports."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        For baremetal deployments, set the neturon port attributes"},{"line_number":44,"context_line":"        during the bind_port event."},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_9d210ca3","line":43,"range":{"start_line":43,"start_character":43,"end_line":43,"end_character":50},"in_reply_to":"1f1a1f67_0e8eec77","updated":"2017-07-13 02:20:47.000000000","message":"Done","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b4e02d7adf9b7e5e4d8f344f3959e736e35317b2","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":47,"context_line":"        subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":48,"context_line":"        host_id \u003d (port.get(dns.DNSNAME) if nexus_help.is_baremetal(port) else"},{"line_number":49,"context_line":"                   port.get(bc.portbindings.HOST_ID))"},{"line_number":50,"context_line":"        context \u003d bc.get_context()"},{"line_number":51,"context_line":"        el_context \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_28cd255d","line":48,"range":{"start_line":48,"start_character":55,"end_line":48,"end_character":67},"updated":"2017-07-12 18:21:35.000000000","message":"the check is redundant, or rather it should make sure it\u0027s a bare metal case.\n\nsubport\u0027s host_id can be taken from the parent. So port.get(dns.DNSNAME) call is not needed in here.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":47,"context_line":"        subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":48,"context_line":"        host_id \u003d (port.get(dns.DNSNAME) if nexus_help.is_baremetal(port) else"},{"line_number":49,"context_line":"                   port.get(bc.portbindings.HOST_ID))"},{"line_number":50,"context_line":"        context \u003d bc.get_context()"},{"line_number":51,"context_line":"        el_context \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_b1275965","line":48,"range":{"start_line":48,"start_character":55,"end_line":48,"end_character":67},"in_reply_to":"1f1a1f67_28cd255d","updated":"2017-07-13 02:20:47.000000000","message":"Agree on checking for baremetal ... that check is not needed.\n\nThis method is called w/ the parent\u0027s port so I am accessing the \u0027host_id\u0027 from the parent.\n\nBut since I don\u0027t need to check for baremetal this variable (\u0027host_id\u0027) isn\u0027t needed. I will just access from \u0027port\u0027 for the HOST_ID assignment below (update_port call).","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4295e45822bdb3a211bb02581842367dea014347","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":47,"context_line":"        subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":48,"context_line":"        host_id \u003d (port.get(dns.DNSNAME) if nexus_help.is_baremetal(port) else"},{"line_number":49,"context_line":"                   port.get(bc.portbindings.HOST_ID))"},{"line_number":50,"context_line":"        context \u003d bc.get_context()"},{"line_number":51,"context_line":"        el_context \u003d context.elevated()"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_2e4ac854","line":49,"range":{"start_line":49,"start_character":0,"end_line":49,"end_character":19},"updated":"2017-07-12 20:50:50.000000000","message":"If you decide get of DNS name is needed here....So what do you plan to do if dns is not configured and baremetal is?","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"0d90a0a456272b5fdf3c4e3ba3e78a0a5e0fe98a","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":47,"context_line":"        subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":48,"context_line":"        host_id \u003d (port.get(dns.DNSNAME) if nexus_help.is_baremetal(port) else"},{"line_number":49,"context_line":"                   port.get(bc.portbindings.HOST_ID))"},{"line_number":50,"context_line":"        context \u003d bc.get_context()"},{"line_number":51,"context_line":"        el_context \u003d context.elevated()"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_5dbc7ddb","line":49,"range":{"start_line":49,"start_character":0,"end_line":49,"end_character":19},"in_reply_to":"1f1a1f67_1d917c9a","updated":"2017-07-13 13:50:10.000000000","message":"If there is no dns name, it is none and I use constants.RESERVED_PORT_HOST_ID instead.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":47,"context_line":"        subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":48,"context_line":"        host_id \u003d (port.get(dns.DNSNAME) if nexus_help.is_baremetal(port) else"},{"line_number":49,"context_line":"                   port.get(bc.portbindings.HOST_ID))"},{"line_number":50,"context_line":"        context \u003d bc.get_context()"},{"line_number":51,"context_line":"        el_context \u003d context.elevated()"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_1d917c9a","line":49,"range":{"start_line":49,"start_character":0,"end_line":49,"end_character":19},"in_reply_to":"1f1a1f67_2e4ac854","updated":"2017-07-13 02:20:47.000000000","message":"Note that this method is only called during baremetal deployments.\nI\u0027m testing some more based on Robert\u0027s comments and the host_id isn\u0027t set correctly when this method is called so I will be using the DNS name.\nHaven\u0027t tested without dns so not sure what happens when the subport events are generated below. What happens today when you have a baremetal port with valid profile info but no dns name?","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b4e02d7adf9b7e5e4d8f344f3959e736e35317b2","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                  bc.portbindings.VNIC_TYPE:"},{"line_number":58,"context_line":"                      bc.portbindings.VNIC_BAREMETAL,"},{"line_number":59,"context_line":"                  bc.portbindings.PROFILE:"},{"line_number":60,"context_line":"                      port.get(bc.portbindings.PROFILE),"},{"line_number":61,"context_line":"                  \u0027device_owner\u0027: bc.trunk_consts.TRUNK_SUBPORT_OWNER,"},{"line_number":62,"context_line":"                  \u0027status\u0027: bc.constants.PORT_STATUS_ACTIVE}})"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_fa492b60","line":60,"range":{"start_line":60,"start_character":0,"end_line":60,"end_character":56},"updated":"2017-07-12 18:21:35.000000000","message":"I\u0027m still debating about whether or not the subport should have a vnic_type of VNIC_BAREMETAL. It can fall into the same logic as regular subport. Profile is not required for subport.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"e44176e614a52f5f1467b89e63af10fdbbb98184","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                  bc.portbindings.VNIC_TYPE:"},{"line_number":58,"context_line":"                      bc.portbindings.VNIC_BAREMETAL,"},{"line_number":59,"context_line":"                  bc.portbindings.PROFILE:"},{"line_number":60,"context_line":"                      port.get(bc.portbindings.PROFILE),"},{"line_number":61,"context_line":"                  \u0027device_owner\u0027: bc.trunk_consts.TRUNK_SUBPORT_OWNER,"},{"line_number":62,"context_line":"                  \u0027status\u0027: bc.constants.PORT_STATUS_ACTIVE}})"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_fe5b3f2b","line":60,"range":{"start_line":60,"start_character":0,"end_line":60,"end_character":56},"in_reply_to":"1f1a1f67_c488d572","updated":"2017-07-13 13:20:16.000000000","message":"I just tested by removing the VNIC_TYPE\u003dBAREMETAL (now defaults to \u0027normal\u0027) and the PROFILE setting. The subports are not processed by the cisco_nexus ml2 driver. I didn\u0027t do any further debugging.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                  bc.portbindings.VNIC_TYPE:"},{"line_number":58,"context_line":"                      bc.portbindings.VNIC_BAREMETAL,"},{"line_number":59,"context_line":"                  bc.portbindings.PROFILE:"},{"line_number":60,"context_line":"                      port.get(bc.portbindings.PROFILE),"},{"line_number":61,"context_line":"                  \u0027device_owner\u0027: bc.trunk_consts.TRUNK_SUBPORT_OWNER,"},{"line_number":62,"context_line":"                  \u0027status\u0027: bc.constants.PORT_STATUS_ACTIVE}})"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_c488d572","line":60,"range":{"start_line":60,"start_character":0,"end_line":60,"end_character":56},"in_reply_to":"1f1a1f67_fa492b60","updated":"2017-07-13 02:20:47.000000000","message":"I\u0027m sure it could work just don\u0027t know how much additional effort (if any at all) would be required to generate update_port events on a neutron port being used as the subport in the case of baremetal. I started writing the code around the same time Carol had committed the \u0027cisco_ml2_nexus_host_interface_mapping\u0027 change and with the initial trunk implementation (accessing the trunk defined vlan for switch programming vs. the subport\u0027s network segment) I needed to copy the baremetal related port attributes for the parent port to the subport. \nSo if in the case of baremetal deployment if a subport can use the non-baremetal call flow through the ml2 update_port* methods then that\u0027s fine. \nIf time permits, I\u0027ll test before I go on PTO. If it doesn\u0027t work then I say we merge w/ this update_port code and can revisit as a bugfix.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b639c1d91a250d6804bf3d178096202b8edce843","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        trunk_details \u003d port.get(\u0027trunk_details\u0027)"},{"line_number":45,"context_line":"        subports \u003d trunk_details[\u0027sub_ports\u0027]"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        host_id \u003d port.get(dns.DNSNAME)"},{"line_number":48,"context_line":"        context \u003d bc.get_context()"},{"line_number":49,"context_line":"        el_context \u003d context.elevated()"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1f1a1f67_6515369c","line":47,"range":{"start_line":47,"start_character":7,"end_line":47,"end_character":39},"updated":"2017-07-14 14:59:54.000000000","message":"Per comment at patch 8, through that we wanted to do: \n\nhost_id \u003d port.get(bc.portbindings.HOST_ID","commit_id":"dbcdea1275580f4fdd0d6c34febf72f944bd02be"}],"networking_cisco/services/trunk/nexus_trunk.py":[{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"d9613585d8c9068b0bad9633dbc12f260c89be46","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def __init__(self):"},{"line_number":42,"context_line":"        # To prevent recursive importing."},{"line_number":43,"context_line":"        from networking_cisco import backwards_compatibility"},{"line_number":44,"context_line":"        from networking_cisco.plugins.ml2.drivers.cisco.nexus import ("},{"line_number":45,"context_line":"            mech_cisco_nexus as md_cisco_nexus)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_1b152a49","line":45,"range":{"start_line":44,"start_character":0,"end_line":45,"end_character":47},"updated":"2017-06-19 16:14:58.000000000","message":"The nexus driver has been loaded by stevedore ( see setup.cfg in the root dir). So we\u0027d end up with two instances of it? This doesn\u0027t seem to be right to me.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"90a51c2163a697054d3f77bfa77a73789224e74e","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def __init__(self):"},{"line_number":42,"context_line":"        # To prevent recursive importing."},{"line_number":43,"context_line":"        from networking_cisco import backwards_compatibility"},{"line_number":44,"context_line":"        from networking_cisco.plugins.ml2.drivers.cisco.nexus import ("},{"line_number":45,"context_line":"            mech_cisco_nexus as md_cisco_nexus)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_373b42d2","line":45,"range":{"start_line":44,"start_character":0,"end_line":45,"end_character":47},"in_reply_to":"5f201791_e1063121","updated":"2017-06-21 01:12:13.000000000","message":"I don\u0027t think we\u0027d ever see an issue w/ out having the locks since there is one and only one vlan per subport in use so I can\u0027t think of any issues w/ other processes reading/writing to the db that would impact how these methods operate. However, I think I may be moving the mech_cisco_nexus methods used below to new methods. I\u0027ll add the db cisco locks around those new methods.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"e6ceafe1f4aff9f9f24c65490653e094a88b7409","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def __init__(self):"},{"line_number":42,"context_line":"        # To prevent recursive importing."},{"line_number":43,"context_line":"        from networking_cisco import backwards_compatibility"},{"line_number":44,"context_line":"        from networking_cisco.plugins.ml2.drivers.cisco.nexus import ("},{"line_number":45,"context_line":"            mech_cisco_nexus as md_cisco_nexus)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_934b535e","line":45,"range":{"start_line":44,"start_character":0,"end_line":45,"end_character":47},"in_reply_to":"7f231b9d_10ce1c83","updated":"2017-06-20 00:03:29.000000000","message":"Driving home I started rethinking what you meant by \"... done with update lock applied\". Are you referring to calls made to our db inside a db transaction? (i.e. \u0027with session.begin(subtransaction\u003dTrue):\u0027 or a db lock on a specific database row (i.e. with_for_update() usage) or what I wrote above?","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"0ae357c658ed4c02b914568d6721347e192d5a81","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def __init__(self):"},{"line_number":42,"context_line":"        # To prevent recursive importing."},{"line_number":43,"context_line":"        from networking_cisco import backwards_compatibility"},{"line_number":44,"context_line":"        from networking_cisco.plugins.ml2.drivers.cisco.nexus import ("},{"line_number":45,"context_line":"            mech_cisco_nexus as md_cisco_nexus)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_d6c0a47f","line":45,"range":{"start_line":44,"start_character":0,"end_line":45,"end_character":47},"in_reply_to":"7f231b9d_11de293d","updated":"2017-06-19 17:59:34.000000000","message":"I understand that. I must have missed something that requires the class NexusTrunkHandler. Could registration (at line 155-161) be taking place in the nexus MD, and the event handlers incorporated there as well? It\u0027s really awkward calling those MD methods in here. Also, the db operations doesn\u0027t seem to be done with update lock applied. Not sure if that\u0027s going to be an issue with multiple neutron instances.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"ee48acf6f3f633483cded4ef145798fdf79c2e94","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def __init__(self):"},{"line_number":42,"context_line":"        # To prevent recursive importing."},{"line_number":43,"context_line":"        from networking_cisco import backwards_compatibility"},{"line_number":44,"context_line":"        from networking_cisco.plugins.ml2.drivers.cisco.nexus import ("},{"line_number":45,"context_line":"            mech_cisco_nexus as md_cisco_nexus)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_11de293d","line":45,"range":{"start_line":44,"start_character":0,"end_line":45,"end_character":47},"in_reply_to":"7f231b9d_1b152a49","updated":"2017-06-19 17:12:45.000000000","message":"Correct. The \u0027cisco_nexus\u0027 stevedore location is loaded by the ML2 common code. Once all the mechanism drivers have been loaded the ML2 common code will call each MD\u0027s \u0027initialize\u0027 method once and only once per controller. \n\nIdeally I wouldn\u0027t import the mech driver module. The service_plugin trunk code needs access to the methods that eventually write to the db (precommit like processing) and switch (postcommit). The code (I wrote it so blame me) should have three layers:\n1) MD event handlers\n2) specific db/switch process to determine if db/switch needs to be written to\n3) nexus driver code\n\nGiven how the code is written the service_plugin trunk code needs to call into the methods from (2).\nParts (1) and (2) are both under the same class so until/if we need to break out this code to it\u0027s own class/module, this was the most straight forward way to implement.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"53fb6d03eefba76ab8477bfb555ff9838b84db66","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def __init__(self):"},{"line_number":42,"context_line":"        # To prevent recursive importing."},{"line_number":43,"context_line":"        from networking_cisco import backwards_compatibility"},{"line_number":44,"context_line":"        from networking_cisco.plugins.ml2.drivers.cisco.nexus import ("},{"line_number":45,"context_line":"            mech_cisco_nexus as md_cisco_nexus)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_e1063121","line":45,"range":{"start_line":44,"start_character":0,"end_line":45,"end_character":47},"in_reply_to":"7f231b9d_934b535e","updated":"2017-06-20 18:46:29.000000000","message":"I mean the db lock you just described.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"c0bc1253478eabc1a287cc9a9d6525b56ea03811","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    def __init__(self):"},{"line_number":42,"context_line":"        # To prevent recursive importing."},{"line_number":43,"context_line":"        from networking_cisco import backwards_compatibility"},{"line_number":44,"context_line":"        from networking_cisco.plugins.ml2.drivers.cisco.nexus import ("},{"line_number":45,"context_line":"            mech_cisco_nexus as md_cisco_nexus)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_10ce1c83","line":45,"range":{"start_line":44,"start_character":0,"end_line":45,"end_character":47},"in_reply_to":"7f231b9d_d6c0a47f","updated":"2017-06-19 21:30:59.000000000","message":"The register() method below in the NexusTrunkDriver() class is called from the trunk infra. The create() method is called from the cisco_nexus initialize() method and this starts the overall registration process between the trunk infra and another component that wants to register for trunk events.\n\nKeeping this design (this module handles all events from the service_plugin; cisco/nexus/trunk.py handles all calls from the MD to handle trunk events - basically this just when vm/bm come up/down and bind_port) then there has to be some call from this module to a method/class/module from the cisco nexus MD. I could create wrapper methods in mech_cisco_nexus.py to call the methods listed below to remove some of the parameter passing details required by this class. Let me think about that one some more.\n\nRegarding the db comment, I take it you\u0027re referring to the cisco_nexus database (not any neutron db). Kind of surprising, there is no db session locking done. Then again, each row in the nexus db in unique and no two processes should ever be writing to the same row. (The driver only creates a row when a port goes ACTIVE.) Same is true w/ this trunk subport code. \nI bet the event locks that were put in around the event handlers, \"@lockutils.synchronized(\u0027cisco-nexus-portlock\u0027)\",\nare acting as a db lock mechanism. Hmmm, maybe another reason to create the wrapper methods (i.e. at that point it\u0027s easy enough to wrap those methods w/ the cisco-nexus-portlock).","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        from networking_cisco.plugins.ml2.drivers.cisco.nexus import ("},{"line_number":45,"context_line":"            mech_cisco_nexus as md_cisco_nexus)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"},{"line_number":49,"context_line":"        self.plugin \u003d self.bc.get_plugin()"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_3328e484","line":47,"range":{"start_line":47,"start_character":8,"end_line":47,"end_character":41},"updated":"2017-06-21 18:02:44.000000000","message":"Again I\u0027m not sure why this is necessary.  I\u0027ve imported it from the top and existing test cases seem to work.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        from networking_cisco.plugins.ml2.drivers.cisco.nexus import ("},{"line_number":45,"context_line":"            mech_cisco_nexus as md_cisco_nexus)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.bc \u003d backwards_compatibility"},{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"},{"line_number":49,"context_line":"        self.plugin \u003d self.bc.get_plugin()"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_fbd0f552","line":47,"range":{"start_line":47,"start_character":8,"end_line":47,"end_character":41},"in_reply_to":"5f201791_3328e484","updated":"2017-06-21 21:19:32.000000000","message":"Same answer as reply in trunk.py comment.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"},{"line_number":49,"context_line":"        self.plugin \u003d self.bc.get_plugin()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _is_baremetal(self, port):"},{"line_number":52,"context_line":"        return (port[self.bc.portbindings.VNIC_TYPE] \u003d\u003d"},{"line_number":53,"context_line":"                self.bc.portbindings.VNIC_BAREMETAL)"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_334d8472","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":21},"updated":"2017-06-21 18:02:44.000000000","message":"Not fond of duplicating this method all over the place.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.md \u003d md_cisco_nexus.CiscoNexusMechanismDriver()"},{"line_number":49,"context_line":"        self.plugin \u003d self.bc.get_plugin()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _is_baremetal(self, port):"},{"line_number":52,"context_line":"        return (port[self.bc.portbindings.VNIC_TYPE] \u003d\u003d"},{"line_number":53,"context_line":"                self.bc.portbindings.VNIC_BAREMETAL)"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_db7d391d","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":21},"in_reply_to":"5f201791_334d8472","updated":"2017-06-21 21:19:32.000000000","message":"I did think to access from just one module but there really isn\u0027t a good file to put it in right now.\nIf you read some of the comment exchange Robert and I had on that odd looking import of mech_cisco_nexus.py you\u0027ll see that we really need to break down that module into at least two parts (one event handlers, two a nexus_handler.py type of file that handles the bulk of work required before an event to sent to the nexus driver code). Doing that would have provided the entry points that a service_plugin needs without importing mech_cisco_nexus creating another instance. Thankfully most of the initialization type of code is in intialize() and not a __init__. (Although you\u0027ll see that I did have to move some variables there so that the calls from the service_plugin trunk code (in nexus_trunk.py) would work. \nLong answer for yes I agree but given that this is only one line and no proper file, I\u0027ll wait a bit. (Maybe your new nexus_helpers.py.)","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    def subport_precommit(self, resource, event, trunk_plugin, payload):"},{"line_number":67,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":68,"context_line":"            payload.context, payload.current_trunk.port_id)"},{"line_number":69,"context_line":"        host_id \u003d (trunkport.get(dns.DNSNAME) if self._is_baremetal(trunkport)"},{"line_number":70,"context_line":"                   else trunkport.get(self.bc.portbindings.HOST_ID))"},{"line_number":71,"context_line":"        if (trunkport[\u0027status\u0027] !\u003d self.bc.constants.PORT_STATUS_ACTIVE or"},{"line_number":72,"context_line":"            not host_id):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_d3d09053","line":69,"range":{"start_line":69,"start_character":19,"end_line":69,"end_character":28},"updated":"2017-06-21 18:02:44.000000000","message":"Same comments as other file about dns name.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    def subport_precommit(self, resource, event, trunk_plugin, payload):"},{"line_number":67,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":68,"context_line":"            payload.context, payload.current_trunk.port_id)"},{"line_number":69,"context_line":"        host_id \u003d (trunkport.get(dns.DNSNAME) if self._is_baremetal(trunkport)"},{"line_number":70,"context_line":"                   else trunkport.get(self.bc.portbindings.HOST_ID))"},{"line_number":71,"context_line":"        if (trunkport[\u0027status\u0027] !\u003d self.bc.constants.PORT_STATUS_ACTIVE or"},{"line_number":72,"context_line":"            not host_id):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_bb7a7d21","line":69,"range":{"start_line":69,"start_character":19,"end_line":69,"end_character":28},"in_reply_to":"5f201791_d3d09053","updated":"2017-06-21 21:19:32.000000000","message":"Same answer.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"16d9a26ab5cfb2137b27f55be167298fb04a2950","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        # work. Opposite is true for deletes."},{"line_number":81,"context_line":"        if event \u003d\u003d events.PRECOMMIT_DELETE:"},{"line_number":82,"context_line":"            self.md._delete_nxos_db("},{"line_number":83,"context_line":"                subport_dict, subport.segmentation_id, subport.port_id,"},{"line_number":84,"context_line":"                host_id, NO_VNI, NO_PROVIDER_NETWORK)"},{"line_number":85,"context_line":"            self.md._delete_switch_entry("},{"line_number":86,"context_line":"                subport_dict, subport.segmentation_id, subport.port_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_87d089f9","line":83,"range":{"start_line":83,"start_character":16,"end_line":83,"end_character":28},"updated":"2017-06-21 18:02:44.000000000","message":"You\u0027ve gone thru the effort to getting this var and passing it into _delete_nxos_db() but the name of this var in _delete_nxos_db is \u0027unused\u0027.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8213fc1cadf97649cacd89e0bc2f027c425b8cf3","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        # work. Opposite is true for deletes."},{"line_number":81,"context_line":"        if event \u003d\u003d events.PRECOMMIT_DELETE:"},{"line_number":82,"context_line":"            self.md._delete_nxos_db("},{"line_number":83,"context_line":"                subport_dict, subport.segmentation_id, subport.port_id,"},{"line_number":84,"context_line":"                host_id, NO_VNI, NO_PROVIDER_NETWORK)"},{"line_number":85,"context_line":"            self.md._delete_switch_entry("},{"line_number":86,"context_line":"                subport_dict, subport.segmentation_id, subport.port_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_5bdda912","line":83,"range":{"start_line":83,"start_character":16,"end_line":83,"end_character":28},"in_reply_to":"5f201791_87d089f9","updated":"2017-06-21 21:19:32.000000000","message":"Funny. Yeah, don\u0027t need it here. Just a copy/paste of the existing calls inside of mech_cisco_nexus.py Do need it for delete_switch_entry.\nnote that I\u0027m planning on moving both these calls into a new method defined in mech_cisco_nexus. At the very least I should have removed the \u0027_\u0027 from these modules since they are no longer internal methods. This won\u0027t eliminate the need for a split of mech_cisco_nexus, but I think it\u0027s cleaner to call a single self.md.delete_subport(...) method here instead of the two calls.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"d9613585d8c9068b0bad9633dbc12f260c89be46","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        # for the subport to match the parent port."},{"line_number":105,"context_line":"        if self._is_baremetal(trunkport):"},{"line_number":106,"context_line":"            if event \u003d\u003d events.AFTER_CREATE:"},{"line_number":107,"context_line":"                self.plugin.update_port("},{"line_number":108,"context_line":"                    payload.context, trunk_subport_dict[\u0027port_id\u0027],"},{"line_number":109,"context_line":"                    {attributes.PORT:"},{"line_number":110,"context_line":"                     {self.bc.portbindings.HOST_ID: host_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_9b525a34","line":107,"range":{"start_line":107,"start_character":13,"end_line":107,"end_character":40},"updated":"2017-06-19 16:14:58.000000000","message":"This is to update the first subport only (see line 98)?\nI also see update_port() in trunk.py. wonder why?","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"90a51c2163a697054d3f77bfa77a73789224e74e","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        # for the subport to match the parent port."},{"line_number":105,"context_line":"        if self._is_baremetal(trunkport):"},{"line_number":106,"context_line":"            if event \u003d\u003d events.AFTER_CREATE:"},{"line_number":107,"context_line":"                self.plugin.update_port("},{"line_number":108,"context_line":"                    payload.context, trunk_subport_dict[\u0027port_id\u0027],"},{"line_number":109,"context_line":"                    {attributes.PORT:"},{"line_number":110,"context_line":"                     {self.bc.portbindings.HOST_ID: host_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_37aea2e7","line":107,"range":{"start_line":107,"start_character":13,"end_line":107,"end_character":40},"in_reply_to":"5f201791_d4b7753a","updated":"2017-06-21 01:12:13.000000000","message":"I\u0027ll add some more comments.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"c0bc1253478eabc1a287cc9a9d6525b56ea03811","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        # for the subport to match the parent port."},{"line_number":105,"context_line":"        if self._is_baremetal(trunkport):"},{"line_number":106,"context_line":"            if event \u003d\u003d events.AFTER_CREATE:"},{"line_number":107,"context_line":"                self.plugin.update_port("},{"line_number":108,"context_line":"                    payload.context, trunk_subport_dict[\u0027port_id\u0027],"},{"line_number":109,"context_line":"                    {attributes.PORT:"},{"line_number":110,"context_line":"                     {self.bc.portbindings.HOST_ID: host_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_ea360fe8","line":107,"range":{"start_line":107,"start_character":13,"end_line":107,"end_character":40},"in_reply_to":"7f231b9d_6cdfc20c","updated":"2017-06-19 21:30:59.000000000","message":"What part is unclear? In this class and the class defined in cisco/nexus/trunk.py docstings I do describe how the class is being used.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"ee48acf6f3f633483cded4ef145798fdf79c2e94","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        # for the subport to match the parent port."},{"line_number":105,"context_line":"        if self._is_baremetal(trunkport):"},{"line_number":106,"context_line":"            if event \u003d\u003d events.AFTER_CREATE:"},{"line_number":107,"context_line":"                self.plugin.update_port("},{"line_number":108,"context_line":"                    payload.context, trunk_subport_dict[\u0027port_id\u0027],"},{"line_number":109,"context_line":"                    {attributes.PORT:"},{"line_number":110,"context_line":"                     {self.bc.portbindings.HOST_ID: host_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_d1f6718f","line":107,"range":{"start_line":107,"start_character":13,"end_line":107,"end_character":40},"in_reply_to":"7f231b9d_9b525a34","updated":"2017-06-19 17:12:45.000000000","message":"Events will be triggered from two locations; ML2 events and service_plugin trunk events.\nThis method subport_postcommit (and the matching pre) are called when a single subport is added/removed from the trunk.\nAccessing via [0] is just how the trunk code is implemented.\n\ncisco/nexus/trunk.py - this module contains methods called when ML2 events occur. (update_port call made when parent port is bound. Need to update subports to indicate that these neutron ports are now \u0027trunk:subport\u0027s.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"0ae357c658ed4c02b914568d6721347e192d5a81","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        # for the subport to match the parent port."},{"line_number":105,"context_line":"        if self._is_baremetal(trunkport):"},{"line_number":106,"context_line":"            if event \u003d\u003d events.AFTER_CREATE:"},{"line_number":107,"context_line":"                self.plugin.update_port("},{"line_number":108,"context_line":"                    payload.context, trunk_subport_dict[\u0027port_id\u0027],"},{"line_number":109,"context_line":"                    {attributes.PORT:"},{"line_number":110,"context_line":"                     {self.bc.portbindings.HOST_ID: host_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f231b9d_6cdfc20c","line":107,"range":{"start_line":107,"start_character":13,"end_line":107,"end_character":40},"in_reply_to":"7f231b9d_d1f6718f","updated":"2017-06-19 17:59:34.000000000","message":"yeah, that makes sense. Can we add comments for that?","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"53fb6d03eefba76ab8477bfb555ff9838b84db66","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        # for the subport to match the parent port."},{"line_number":105,"context_line":"        if self._is_baremetal(trunkport):"},{"line_number":106,"context_line":"            if event \u003d\u003d events.AFTER_CREATE:"},{"line_number":107,"context_line":"                self.plugin.update_port("},{"line_number":108,"context_line":"                    payload.context, trunk_subport_dict[\u0027port_id\u0027],"},{"line_number":109,"context_line":"                    {attributes.PORT:"},{"line_number":110,"context_line":"                     {self.bc.portbindings.HOST_ID: host_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f201791_d4b7753a","line":107,"range":{"start_line":107,"start_character":13,"end_line":107,"end_character":40},"in_reply_to":"7f231b9d_ea360fe8","updated":"2017-06-20 18:46:29.000000000","message":"I mean to add what you described above into the code as comments.","commit_id":"a776173cd871c5fedfe92bb9465607a5549a9cea"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b4e02d7adf9b7e5e4d8f344f3959e736e35317b2","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        current_trunk_data \u003d payload.current_trunk.to_dict()"},{"line_number":45,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":46,"context_line":"            payload.context, current_trunk_data[\u0027port_id\u0027])"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if nexus_help.is_baremetal(trunkport):"},{"line_number":49,"context_line":"            for subport in current_trunk_data[\u0027sub_ports\u0027]:"},{"line_number":50,"context_line":"                self.plugin.update_port(payload.context, subport[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_9f66a951","line":47,"updated":"2017-07-12 18:21:35.000000000","message":"parent port status should be checked to make sure if it\u0027s not active, the following code doesn\u0027t need to be called.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"61eee3a6d2c75084bbfca9ada7eba72672e113c5","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        current_trunk_data \u003d payload.current_trunk.to_dict()"},{"line_number":45,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":46,"context_line":"            payload.context, current_trunk_data[\u0027port_id\u0027])"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if nexus_help.is_baremetal(trunkport):"},{"line_number":49,"context_line":"            for subport in current_trunk_data[\u0027sub_ports\u0027]:"},{"line_number":50,"context_line":"                self.plugin.update_port(payload.context, subport[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_01f33b0c","line":47,"in_reply_to":"1f1a1f67_886d309a","updated":"2017-07-13 19:02:14.000000000","message":"Yeah, I should only need this call when the trunk is DOWN and I need to set the subports to DOWN.\n\nAt one point I was hoping to use this registered call for both active and down settings of the subport. Along w/ the trunk CLI commands triggering this registered method to be called, ml2/plugin.py also (indirectly) would call this because the trunk code has registered w/ ml2 to get port events.\nHowever when triggered in ml2/update_port when a parent port is being bound the port is still in the DOWN state.\nSo I\u0027ll need to keep the method to set the subports to ACTIVE \nbeing called from bind_port of the parent port.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        current_trunk_data \u003d payload.current_trunk.to_dict()"},{"line_number":45,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":46,"context_line":"            payload.context, current_trunk_data[\u0027port_id\u0027])"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if nexus_help.is_baremetal(trunkport):"},{"line_number":49,"context_line":"            for subport in current_trunk_data[\u0027sub_ports\u0027]:"},{"line_number":50,"context_line":"                self.plugin.update_port(payload.context, subport[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_bd8723d8","line":47,"in_reply_to":"1f1a1f67_9f66a951","updated":"2017-07-13 02:20:47.000000000","message":"As we discussed, I started testing to see if this registered callback is even needed. It is needed when a baremetal nova image is deleted. The ML2 code will call the drivers with the trunk\u0027s parent port going to the DOWN state. But there are no events for the subports. To set the subport\u0027s neutron port information to the correct state and to generate the update_port_* events to the ML2 drivers (cisco_nexus will remove entry from db and remove vlan from switch) the call to update_port() with the new state is required.\nI\u0027m still testing but I think I only need this call when the trunk is going down.\nNote that the supbort registered calls (like subport_postcommit below) are not called on nova image deletes.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"c89af2846834491a7c2fb383a297c69561962505","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        current_trunk_data \u003d payload.current_trunk.to_dict()"},{"line_number":45,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":46,"context_line":"            payload.context, current_trunk_data[\u0027port_id\u0027])"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if nexus_help.is_baremetal(trunkport):"},{"line_number":49,"context_line":"            for subport in current_trunk_data[\u0027sub_ports\u0027]:"},{"line_number":50,"context_line":"                self.plugin.update_port(payload.context, subport[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_886d309a","line":47,"in_reply_to":"1f1a1f67_bd8723d8","updated":"2017-07-13 14:28:41.000000000","message":"Oh I see. \n\nLooks like subports processing for portbinding is done in the mech driver (see _supported_baremetal_transaction()). But removing the binding is done here.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4295e45822bdb3a211bb02581842367dea014347","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if nexus_help.is_baremetal(trunkport):"},{"line_number":49,"context_line":"            for subport in current_trunk_data[\u0027sub_ports\u0027]:"},{"line_number":50,"context_line":"                self.plugin.update_port(payload.context, subport[\u0027port_id\u0027],"},{"line_number":51,"context_line":"                    {attributes.PORT:"},{"line_number":52,"context_line":"                     {\u0027status\u0027: current_trunk_data[\u0027status\u0027]}})"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_a7827bc7","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":39},"updated":"2017-07-12 20:50:50.000000000","message":"So this call causes the regular nexus postcommit to get executed?","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if nexus_help.is_baremetal(trunkport):"},{"line_number":49,"context_line":"            for subport in current_trunk_data[\u0027sub_ports\u0027]:"},{"line_number":50,"context_line":"                self.plugin.update_port(payload.context, subport[\u0027port_id\u0027],"},{"line_number":51,"context_line":"                    {attributes.PORT:"},{"line_number":52,"context_line":"                     {\u0027status\u0027: current_trunk_data[\u0027status\u0027]}})"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_fd991b1f","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":39},"in_reply_to":"1f1a1f67_a7827bc7","updated":"2017-07-13 02:20:47.000000000","message":"Calling the core_plugin (here ML2) update_port method will generate calls to all ML2 drivers. precommit, postcommit and maybe even bind_port MD methods will be called.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"61eee3a6d2c75084bbfca9ada7eba72672e113c5","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if nexus_help.is_baremetal(trunkport):"},{"line_number":49,"context_line":"            for subport in current_trunk_data[\u0027sub_ports\u0027]:"},{"line_number":50,"context_line":"                self.plugin.update_port(payload.context, subport[\u0027port_id\u0027],"},{"line_number":51,"context_line":"                    {attributes.PORT:"},{"line_number":52,"context_line":"                     {\u0027status\u0027: current_trunk_data[\u0027status\u0027]}})"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_41d2535e","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":39},"in_reply_to":"1f1a1f67_e8af0492","updated":"2017-07-13 19:02:14.000000000","message":"Yeah, initially I did remove more port attributes when the port is being unbound but the host_id was needed. But this was using the old design (retrieving VLAN from trunk DB not from port\u0027s network segment).\nI put the code back to reset/Null out more port attributes.\nJust tested and it\u0027s working.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"c89af2846834491a7c2fb383a297c69561962505","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        if nexus_help.is_baremetal(trunkport):"},{"line_number":49,"context_line":"            for subport in current_trunk_data[\u0027sub_ports\u0027]:"},{"line_number":50,"context_line":"                self.plugin.update_port(payload.context, subport[\u0027port_id\u0027],"},{"line_number":51,"context_line":"                    {attributes.PORT:"},{"line_number":52,"context_line":"                     {\u0027status\u0027: current_trunk_data[\u0027status\u0027]}})"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_e8af0492","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":39},"in_reply_to":"1f1a1f67_fd991b1f","updated":"2017-07-13 14:28:41.000000000","message":"If this is for the \"remove binding\" case, then the binding host_id should be set to None, I think.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b4e02d7adf9b7e5e4d8f344f3959e736e35317b2","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                    {attributes.PORT:"},{"line_number":52,"context_line":"                     {\u0027status\u0027: current_trunk_data[\u0027status\u0027]}})"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def subport_postcommit(self, resource, event, trunk_plugin, payload):"},{"line_number":55,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":56,"context_line":"            payload.context, payload.current_trunk.port_id)"},{"line_number":57,"context_line":"        host_id \u003d (trunkport.get(dns.DNSNAME)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_94c0d052","line":54,"range":{"start_line":54,"start_character":8,"end_line":54,"end_character":26},"updated":"2017-07-12 18:21:35.000000000","message":"So this is going to be called when a subport is added after the BM is booted up and running. We don\u0027t have a use case for this yet since we don\u0027t have an automatic mechanism to effect the subport configuration in the BM. But it doesn\u0027t hurt to support it here.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                    {attributes.PORT:"},{"line_number":52,"context_line":"                     {\u0027status\u0027: current_trunk_data[\u0027status\u0027]}})"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def subport_postcommit(self, resource, event, trunk_plugin, payload):"},{"line_number":55,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":56,"context_line":"            payload.context, payload.current_trunk.port_id)"},{"line_number":57,"context_line":"        host_id \u003d (trunkport.get(dns.DNSNAME)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_9d88e7c6","line":54,"range":{"start_line":54,"start_character":8,"end_line":54,"end_character":26},"in_reply_to":"1f1a1f67_94c0d052","updated":"2017-07-13 02:20:47.000000000","message":"Correct","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4295e45822bdb3a211bb02581842367dea014347","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":56,"context_line":"            payload.context, payload.current_trunk.port_id)"},{"line_number":57,"context_line":"        host_id \u003d (trunkport.get(dns.DNSNAME)"},{"line_number":58,"context_line":"                   if nexus_help.is_baremetal(trunkport)"},{"line_number":59,"context_line":"                   else trunkport.get(bc.portbindings.HOST_ID))"},{"line_number":60,"context_line":"        if (trunkport[\u0027status\u0027] !\u003d bc.constants.PORT_STATUS_ACTIVE or"},{"line_number":61,"context_line":"            not host_id):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_673ea32a","line":58,"range":{"start_line":58,"start_character":55,"end_line":58,"end_character":56},"updated":"2017-07-12 20:50:50.000000000","message":"What if baremetal and dns name not present","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":56,"context_line":"            payload.context, payload.current_trunk.port_id)"},{"line_number":57,"context_line":"        host_id \u003d (trunkport.get(dns.DNSNAME)"},{"line_number":58,"context_line":"                   if nexus_help.is_baremetal(trunkport)"},{"line_number":59,"context_line":"                   else trunkport.get(bc.portbindings.HOST_ID))"},{"line_number":60,"context_line":"        if (trunkport[\u0027status\u0027] !\u003d bc.constants.PORT_STATUS_ACTIVE or"},{"line_number":61,"context_line":"            not host_id):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_3d56732b","line":58,"range":{"start_line":58,"start_character":55,"end_line":58,"end_character":56},"in_reply_to":"1f1a1f67_673ea32a","updated":"2017-07-13 02:20:47.000000000","message":"As mentioned in the comment for trunk.py, I haven\u0027t tested with dns not configured. It should work just like the baremetal cisco_nexus code that\u0027s already there. update_port_pre/postcommit() events will be generated with the port attributes set below present.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b4e02d7adf9b7e5e4d8f344f3959e736e35317b2","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        SUPPORTED_INTERFACES \u003d ("},{"line_number":121,"context_line":"            bc.portbindings.VIF_TYPE_OVS,"},{"line_number":122,"context_line":"            bc.portbindings.VIF_TYPE_VHOST_USER,"},{"line_number":123,"context_line":"        )"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        SUPPORTED_SEGMENTATION_TYPES \u003d ("},{"line_number":126,"context_line":"            bc.trunk_consts.VLAN,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_943210a7","line":123,"range":{"start_line":123,"start_character":8,"end_line":123,"end_character":9},"updated":"2017-07-12 18:21:35.000000000","message":"For baremetal, we aren\u0027t support the above VIF types. Wonder how the code in this module gets called by the trunk service plugin","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        SUPPORTED_INTERFACES \u003d ("},{"line_number":121,"context_line":"            bc.portbindings.VIF_TYPE_OVS,"},{"line_number":122,"context_line":"            bc.portbindings.VIF_TYPE_VHOST_USER,"},{"line_number":123,"context_line":"        )"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        SUPPORTED_SEGMENTATION_TYPES \u003d ("},{"line_number":126,"context_line":"            bc.trunk_consts.VLAN,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_bd184381","line":123,"range":{"start_line":123,"start_character":8,"end_line":123,"end_character":9},"in_reply_to":"1f1a1f67_943210a7","updated":"2017-07-13 02:20:47.000000000","message":"Yeah, I\u0027m wondering exactly what the trunk infra does with this info. VM and baremetal is working so it doesn\u0027t prevent the registered methods from being called. However, it does seem misleading to have those settings. I\u0027m going to test w/ VIF_TYPE_OTHER (which is what the subports get set to).","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"e44176e614a52f5f1467b89e63af10fdbbb98184","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        SUPPORTED_INTERFACES \u003d ("},{"line_number":121,"context_line":"            bc.portbindings.VIF_TYPE_OVS,"},{"line_number":122,"context_line":"            bc.portbindings.VIF_TYPE_VHOST_USER,"},{"line_number":123,"context_line":"        )"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        SUPPORTED_SEGMENTATION_TYPES \u003d ("},{"line_number":126,"context_line":"            bc.trunk_consts.VLAN,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_3e89b774","line":123,"range":{"start_line":123,"start_character":8,"end_line":123,"end_character":9},"in_reply_to":"1f1a1f67_bd184381","updated":"2017-07-13 13:20:16.000000000","message":"Setting SUPPORTED_INTERFACES to just VIF_TYPE_OTHER (what is used when the baremetal ports are bound) works.\nI\u0027ve made the change. Obviously the trunk infra doesn\u0027t have any strict restrictions on this config.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"22b5e4d4a3d3cbb7647c32776bcc814811416a95","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":64,"context_line":"            payload.context, payload.current_trunk.port_id)"},{"line_number":65,"context_line":"        host_id \u003d (trunkport.get(dns.DNSNAME)"},{"line_number":66,"context_line":"                   if nexus_help.is_baremetal(trunkport)"},{"line_number":67,"context_line":"                   else trunkport.get(bc.portbindings.HOST_ID))"},{"line_number":68,"context_line":"        if (trunkport[\u0027status\u0027] !\u003d bc.constants.PORT_STATUS_ACTIVE or"},{"line_number":69,"context_line":"            not host_id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_c0307deb","line":66,"range":{"start_line":66,"start_character":33,"end_line":66,"end_character":45},"updated":"2017-07-14 11:12:02.000000000","message":"I\u0027m a little confused that we check for baremetal here but later statically set subport to BAREMETAL.","commit_id":"1455f6d723f56a40e3688b6e729e0b8005b04533"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"89185c02537307102c7886d17a6e03b05890dc1a","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        trunkport \u003d self.plugin.get_port("},{"line_number":64,"context_line":"            payload.context, payload.current_trunk.port_id)"},{"line_number":65,"context_line":"        host_id \u003d (trunkport.get(dns.DNSNAME)"},{"line_number":66,"context_line":"                   if nexus_help.is_baremetal(trunkport)"},{"line_number":67,"context_line":"                   else trunkport.get(bc.portbindings.HOST_ID))"},{"line_number":68,"context_line":"        if (trunkport[\u0027status\u0027] !\u003d bc.constants.PORT_STATUS_ACTIVE or"},{"line_number":69,"context_line":"            not host_id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_7b8dd82f","line":66,"range":{"start_line":66,"start_character":33,"end_line":66,"end_character":45},"in_reply_to":"1f1a1f67_c0307deb","updated":"2017-07-14 12:17:13.000000000","message":"The only time that we want the update_port() event to be\ntriggered for subports is in the baremetal environment.\n(For VM deplpoyments, OVS will be triggering the\nupdate_port() events for subports.)\nLet me rewrite to:\ntrunkport \u003d xxx\nif not is_baremetal():\n    return\n\nI can then remove the 2nd check for BM below.","commit_id":"1455f6d723f56a40e3688b6e729e0b8005b04533"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"22b5e4d4a3d3cbb7647c32776bcc814811416a95","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                self.plugin.update_port("},{"line_number":80,"context_line":"                    payload.context, trunk_subport_dict[\u0027port_id\u0027],"},{"line_number":81,"context_line":"                    {attributes.PORT:"},{"line_number":82,"context_line":"                     {bc.portbindings.HOST_ID: host_id,"},{"line_number":83,"context_line":"                      bc.portbindings.VNIC_TYPE:"},{"line_number":84,"context_line":"                          bc.portbindings.VNIC_BAREMETAL,"},{"line_number":85,"context_line":"                      bc.portbindings.PROFILE:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_c0451d45","line":82,"range":{"start_line":82,"start_character":25,"end_line":82,"end_character":37},"updated":"2017-07-14 11:12:02.000000000","message":"Sorry for delay in these questions but I\u0027m just realizing this is sort of a conflict.\nIs getting/setting of host_id important in any of this code?  The regular nexus baremetal code will do the following.  It doesn\u0027t look at host_id in the event.\n \n        host_id \u003d port_seg.get(\u0027dns_name\u0027)\n        if host_id is None:\n            host_id \u003d const.RESERVED_PORT_HOST_ID","commit_id":"1455f6d723f56a40e3688b6e729e0b8005b04533"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"89185c02537307102c7886d17a6e03b05890dc1a","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                self.plugin.update_port("},{"line_number":80,"context_line":"                    payload.context, trunk_subport_dict[\u0027port_id\u0027],"},{"line_number":81,"context_line":"                    {attributes.PORT:"},{"line_number":82,"context_line":"                     {bc.portbindings.HOST_ID: host_id,"},{"line_number":83,"context_line":"                      bc.portbindings.VNIC_TYPE:"},{"line_number":84,"context_line":"                          bc.portbindings.VNIC_BAREMETAL,"},{"line_number":85,"context_line":"                      bc.portbindings.PROFILE:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1f1a1f67_fbc68849","line":82,"range":{"start_line":82,"start_character":25,"end_line":82,"end_character":37},"in_reply_to":"1f1a1f67_c0451d45","updated":"2017-07-14 12:17:13.000000000","message":"I\u0027m going to forward the \u0027host_id \u003d dns.name\u0027 via the update_port() call. If it\u0027s None then the cisco_nexus driver will handle it as it does today.\nHowever, I\u0027ve tested w/ dns disabled or no dna name (At one point this was a requirement). Since that\u0027s changed and the driver now handles a None dns name then the subport processing will probably work just like the parent port (or non trunking BM deployments). If not then it\u0027s a bug and can be addressed with a future patch.","commit_id":"1455f6d723f56a40e3688b6e729e0b8005b04533"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"b639c1d91a250d6804bf3d178096202b8edce843","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        if (nexus_help.is_baremetal(trunkport) and"},{"line_number":67,"context_line":"            trunkport[\u0027status\u0027] \u003d\u003d bc.constants.PORT_STATUS_ACTIVE):"},{"line_number":68,"context_line":"            host_id \u003d trunkport.get(dns.DNSNAME)"},{"line_number":69,"context_line":"            subport \u003d payload.subports[0]"},{"line_number":70,"context_line":"            trunk_subport_dict \u003d subport.to_dict()"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1f1a1f67_e52826e3","line":68,"range":{"start_line":68,"start_character":3,"end_line":68,"end_character":48},"updated":"2017-07-14 14:59:54.000000000","message":"Per comment at patch 8, through that we wanted to do: \n\nhost_id \u003d trunkport.get(bc.portbindings.HOST_ID","commit_id":"dbcdea1275580f4fdd0d6c34febf72f944bd02be"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"704fbaba1f1645391bb157c14f2f3348e18ab648","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            trunkport[\u0027status\u0027] \u003d\u003d bc.constants.PORT_STATUS_ACTIVE):"},{"line_number":68,"context_line":"            host_id \u003d trunkport.get(dns.DNSNAME)"},{"line_number":69,"context_line":"            subport \u003d payload.subports[0]"},{"line_number":70,"context_line":"            trunk_subport_dict \u003d subport.to_dict()"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"            # Set the subport port attributes to match the parent port."},{"line_number":73,"context_line":"            if event \u003d\u003d events.AFTER_CREATE:"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f1a1f67_df3f3723","line":70,"range":{"start_line":70,"start_character":12,"end_line":70,"end_character":30},"updated":"2017-07-14 12:52:28.000000000","message":"This is much easier to read.","commit_id":"dbcdea1275580f4fdd0d6c34febf72f944bd02be"}],"networking_cisco/services/trunk/trunkstubs.py":[{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4295e45822bdb3a211bb02581842367dea014347","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        pass"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class DriverBase(object):"},{"line_number":41,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_a7595bff","line":40,"range":{"start_line":40,"start_character":6,"end_line":40,"end_character":16},"updated":"2017-07-12 20:50:50.000000000","message":"Is this really needed?  I\u0027m not seeing it referenced anywhere in non-active-trunk code.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        pass"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"class DriverBase(object):"},{"line_number":41,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_dddc1f48","line":40,"range":{"start_line":40,"start_character":6,"end_line":40,"end_character":16},"in_reply_to":"1f1a1f67_a7595bff","updated":"2017-07-13 02:20:47.000000000","message":"it\u0027s an inherited class from nexus_trunk.py\n\nWhen UTs are run for mitaka neutron code (neutron trunk code doesn\u0027t exist on this release) any UT that calls the MD initialize() method would call the .create() method from nexus_trunk.py. This method is in the class that inherits DriverBase.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"}],"networking_cisco/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus_base.py":[{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4295e45822bdb3a211bb02581842367dea014347","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            return None"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"class TestCiscoNexusBase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):"},{"line_number":377,"context_line":"    \"\"\"Feature Base Test Class for Cisco ML2 Nexus driver.\"\"\""},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    TestConfigObj \u003d collections.namedtuple("}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_daec2ff5","line":376,"range":{"start_line":376,"start_character":48,"end_line":376,"end_character":73},"updated":"2017-07-12 20:50:50.000000000","message":"Is this change necessary?  Is there a work-around?Dependencies on Neutron plugins in our unit tests must be minimized.  Sam requested that I refactored all our UTs to make this happen. ref: https://review.openstack.org/371728","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"c484f9da64cd872f994770eeb41a1388343bf4ae","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            return None"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"class TestCiscoNexusBase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):"},{"line_number":377,"context_line":"    \"\"\"Feature Base Test Class for Cisco ML2 Nexus driver.\"\"\""},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    TestConfigObj \u003d collections.namedtuple("}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_5595643f","line":376,"range":{"start_line":376,"start_character":48,"end_line":376,"end_character":73},"in_reply_to":"1f1a1f67_9d27cc65","updated":"2017-07-13 19:51:09.000000000","message":"I was able to remove this back to the testlib_api base class.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":373,"context_line":"            return None"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"class TestCiscoNexusBase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):"},{"line_number":377,"context_line":"    \"\"\"Feature Base Test Class for Cisco ML2 Nexus driver.\"\"\""},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    TestConfigObj \u003d collections.namedtuple("}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_9d27cc65","line":376,"range":{"start_line":376,"start_character":48,"end_line":376,"end_character":73},"in_reply_to":"1f1a1f67_daec2ff5","updated":"2017-07-13 02:20:47.000000000","message":"I agree that UT\u0027s should not depend on neutron or neutron-lib modules. But I changed this because it was necessary to pass something. Now that this patchset has changed dramatically let me remove and see what that \u0027something\u0027 was or hopefully - and I\u0027m expecting this to be true - is no longer there.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"}],"networking_cisco/tests/unit/ml2/drivers/cisco/nexus/test_trunk.py":[{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4295e45822bdb3a211bb02581842367dea014347","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"@testtools.skipIf(bc.NEUTRON_VERSION \u003c bc.NEUTRON_OCATA_VERSION,"},{"line_number":95,"context_line":"                  \"Test not applicable prior to stable/ocata.\")"},{"line_number":96,"context_line":"class TestNexusTrunkHandler(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):"},{"line_number":97,"context_line":"    def setUp(self):"},{"line_number":98,"context_line":"        super(TestNexusTrunkHandler, self).setUp()"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_9a0a3788","line":96,"range":{"start_line":96,"start_character":51,"end_line":96,"end_character":76},"updated":"2017-07-12 20:50:50.000000000","message":"As stated previously, should not have dependencies on Neutron plugins for testing.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"35ba721de65946be78c127c860944e0c3516e7ea","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"@testtools.skipIf(bc.NEUTRON_VERSION \u003c bc.NEUTRON_OCATA_VERSION,"},{"line_number":95,"context_line":"                  \"Test not applicable prior to stable/ocata.\")"},{"line_number":96,"context_line":"class TestNexusTrunkHandler(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):"},{"line_number":97,"context_line":"    def setUp(self):"},{"line_number":98,"context_line":"        super(TestNexusTrunkHandler, self).setUp()"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_5db80f29","line":96,"range":{"start_line":96,"start_character":51,"end_line":96,"end_character":76},"in_reply_to":"1f1a1f67_9a0a3788","updated":"2017-07-13 02:20:47.000000000","message":"same answer from other test comment","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"0d90a0a456272b5fdf3c4e3ba3e78a0a5e0fe98a","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    def setUp(self):"},{"line_number":98,"context_line":"        super(TestNexusTrunkHandler, self).setUp()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        self.handler \u003d trunk.NexusMDTrunkHandler()"},{"line_number":101,"context_line":"        self.plugin \u003d bc.get_plugin()"},{"line_number":102,"context_line":"        self.plugin.get_port \u003d mock.Mock()"},{"line_number":103,"context_line":"        self.plugin.update_port \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_5206a788","line":100,"range":{"start_line":100,"start_character":0,"end_line":100,"end_character":8},"updated":"2017-07-13 13:50:10.000000000","message":"I think it is important to add some functional tests that verifies the output to the switch to make sure we acquire the desired results.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"61eee3a6d2c75084bbfca9ada7eba72672e113c5","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    def setUp(self):"},{"line_number":98,"context_line":"        super(TestNexusTrunkHandler, self).setUp()"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        self.handler \u003d trunk.NexusMDTrunkHandler()"},{"line_number":101,"context_line":"        self.plugin \u003d bc.get_plugin()"},{"line_number":102,"context_line":"        self.plugin.get_port \u003d mock.Mock()"},{"line_number":103,"context_line":"        self.plugin.update_port \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_c821e84f","line":100,"range":{"start_line":100,"start_character":0,"end_line":100,"end_character":8},"in_reply_to":"1f1a1f67_5206a788","updated":"2017-07-13 19:02:14.000000000","message":"Agreed, but unit tests (test a method, function maybe class) is what is expected when pushing up new/updated code.\nFunctional tests should be created/merged under a different bug. Here, it wouldn\u0027t be that difficult to add a trunk based F.T. since the output is that same as all existing tests.\nJust need to setup a new test that mocks the trunk + subports of a neutron port, call update_port_pre/post methods and the nexus driver output should be the same as the existing tests.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"}],"networking_cisco/tests/unit/services/trunk/test_nexus_trunk.py":[{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"0d90a0a456272b5fdf3c4e3ba3e78a0a5e0fe98a","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"@testtools.skipIf(bc.NEUTRON_VERSION \u003c bc.NEUTRON_OCATA_VERSION,"},{"line_number":80,"context_line":"                  \"Test not applicable prior to stable/ocata.\")"},{"line_number":81,"context_line":"class TestNexusTrunkHandler(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):"},{"line_number":82,"context_line":"    def setUp(self):"},{"line_number":83,"context_line":"        super(TestNexusTrunkHandler, self).setUp()"},{"line_number":84,"context_line":"        self.handler \u003d nexus_trunk.NexusTrunkHandler()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_d8dc1b76","line":81,"range":{"start_line":81,"start_character":51,"end_line":81,"end_character":76},"updated":"2017-07-13 13:50:10.000000000","message":"Check if this too is required for use.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"c484f9da64cd872f994770eeb41a1388343bf4ae","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"@testtools.skipIf(bc.NEUTRON_VERSION \u003c bc.NEUTRON_OCATA_VERSION,"},{"line_number":80,"context_line":"                  \"Test not applicable prior to stable/ocata.\")"},{"line_number":81,"context_line":"class TestNexusTrunkHandler(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):"},{"line_number":82,"context_line":"    def setUp(self):"},{"line_number":83,"context_line":"        super(TestNexusTrunkHandler, self).setUp()"},{"line_number":84,"context_line":"        self.handler \u003d nexus_trunk.NexusTrunkHandler()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_f5eb50d9","line":81,"range":{"start_line":81,"start_character":51,"end_line":81,"end_character":76},"in_reply_to":"1f1a1f67_d8dc1b76","updated":"2017-07-13 19:51:09.000000000","message":"It is right now because I\u0027m mocking out the get_port and update_port calls but not the plugin itself (bc.get_plugin).\nSince I\u0027m bringing in the real plugin I need this base case.\nI should be able to rework so I can mock out the get_plugin code itself but this will take a little bit of time.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"0d90a0a456272b5fdf3c4e3ba3e78a0a5e0fe98a","unresolved":false,"context_lines":[{"line_number":79,"context_line":"@testtools.skipIf(bc.NEUTRON_VERSION \u003c bc.NEUTRON_OCATA_VERSION,"},{"line_number":80,"context_line":"                  \"Test not applicable prior to stable/ocata.\")"},{"line_number":81,"context_line":"class TestNexusTrunkHandler(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):"},{"line_number":82,"context_line":"    def setUp(self):"},{"line_number":83,"context_line":"        super(TestNexusTrunkHandler, self).setUp()"},{"line_number":84,"context_line":"        self.handler \u003d nexus_trunk.NexusTrunkHandler()"},{"line_number":85,"context_line":"        self.plugin \u003d bc.get_plugin()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_f2b6d3d9","line":82,"range":{"start_line":82,"start_character":0,"end_line":82,"end_character":4},"updated":"2017-07-13 13:50:10.000000000","message":"I think it would be important to add some functional tests that verifies the output to the switch to make sure we acquire the desired results.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"c484f9da64cd872f994770eeb41a1388343bf4ae","unresolved":false,"context_lines":[{"line_number":79,"context_line":"@testtools.skipIf(bc.NEUTRON_VERSION \u003c bc.NEUTRON_OCATA_VERSION,"},{"line_number":80,"context_line":"                  \"Test not applicable prior to stable/ocata.\")"},{"line_number":81,"context_line":"class TestNexusTrunkHandler(test_db_base_plugin_v2.NeutronDbPluginV2TestCase):"},{"line_number":82,"context_line":"    def setUp(self):"},{"line_number":83,"context_line":"        super(TestNexusTrunkHandler, self).setUp()"},{"line_number":84,"context_line":"        self.handler \u003d nexus_trunk.NexusTrunkHandler()"},{"line_number":85,"context_line":"        self.plugin \u003d bc.get_plugin()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1f1a1f67_d5bcd4dd","line":82,"range":{"start_line":82,"start_character":0,"end_line":82,"end_character":4},"in_reply_to":"1f1a1f67_f2b6d3d9","updated":"2017-07-13 19:51:09.000000000","message":"See comment from other test file.","commit_id":"b8f498f27f152211456b7cebe171ae249f804768"}]}
