def get_port_by_attachment(self, tenant_id, attachment_id):
        # FIXME(danwent): this will be inefficient until the Quantum
        # API implements querying a port by the interface-id
        net_list_resdict = self.client.list_networks(tenant=tenant_id)
        for n in net_list_resdict["networks"]:
            net_id = n['id']
            port_list_resdict = self.client.list_ports(net_id,
                                            tenant=tenant_id)
            for p in port_list_resdict["ports"]:
                port_id = p["id"]
                port_get_resdict = self.client.show_port_attachment(net_id,
                                port_id, tenant=tenant_id)
                if attachment_id == port_get_resdict["attachment"]["id"]:
                    return (net_id, port_id)
        return (None, None)
update _comments in parent if _comments column is missing
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/network/quantum/quantum_connection.py/QuantumClientConnection.get_port_by_attachment--crossover with--dataset/ETHPy150Open frappe/frappe/frappe/core/doctype/communication/comment.py/update_comments_in_parent_after_request