)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"change_message_id":"b47be74f64c4535c0f0058cc954e5f0520488118","unresolved":false,"context_lines":[{"line_number":10,"context_line":"nodes, when VM are created on a routed network."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"A recent patch that addressed \"Move Post commit ops"},{"line_number":13,"context_line":"out of transaction for bulk\" introduced this bug."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"It basically changed the order in which the call such"},{"line_number":16,"context_line":"as _get_host_port_if_changed is called. This function"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a930d6b_bb3ce5c0","line":13,"updated":"2015-01-22 18:21:17.000000000","message":"Can you put the SHA or Change ID of that patch in this commit message?","commit_id":"fda63f724769d6d9082df9e725e2e141140cd116"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3fcd953d8b2e3235a37b89c7a5fe8d903a4b762f","unresolved":false,"context_lines":[{"line_number":10,"context_line":"nodes, when VM are created on a routed network."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"A recent patch that addressed \"Move Post commit ops"},{"line_number":13,"context_line":"out of transaction for bulk\" introduced this bug."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"It basically changed the order in which the call such"},{"line_number":16,"context_line":"as _get_host_port_if_changed is called. This function"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a930d6b_447de26d","line":13,"in_reply_to":"1a930d6b_bb3ce5c0","updated":"2015-01-22 19:38:40.000000000","message":"Will add the \"SHA\" in the next patch.","commit_id":"fda63f724769d6d9082df9e725e2e141140cd116"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9522b1184ece2e898bd7e5232449edc65f916921","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"A recent patch with the change id mentioned below"},{"line_number":13,"context_line":"I9a9683058088e50d9443040223232bf5e1396ccf and with the"},{"line_number":14,"context_line":"bug description \"Move Post commit ops out of transcation"},{"line_number":15,"context_line":"for bulk\" introduced this bug."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"It basically changed the order in which the call such"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a930d6b_84b79739","line":14,"updated":"2015-01-24 05:41:55.000000000","message":"nit:  Adding the bug description is redundant.  I think the change id is enough.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"995ef6b697486e3f447180d40a6568ac7b70a6bb","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"A recent patch with the change id mentioned below"},{"line_number":13,"context_line":"I9a9683058088e50d9443040223232bf5e1396ccf and with the"},{"line_number":14,"context_line":"bug description \"Move Post commit ops out of transcation"},{"line_number":15,"context_line":"for bulk\" introduced this bug."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"It basically changed the order in which the call such"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a930d6b_06229e51","line":14,"in_reply_to":"1a930d6b_84b79739","updated":"2015-01-26 17:48:28.000000000","message":"Will fix it.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9522b1184ece2e898bd7e5232449edc65f916921","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        return result, mech_context, None"},{"line_number":555,"context_line":""},{"line_number":556,"context_line":"    def create_network(self, context, network):"},{"line_number":557,"context_line":"        result, mech_context, temp \u003d self._create_network_db(context, network)"},{"line_number":558,"context_line":"        try:"},{"line_number":559,"context_line":"            self.mechanism_manager.create_network_postcommit(mech_context)"},{"line_number":560,"context_line":"        except ml2_exc.MechanismDriverError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_90a51249","line":557,"updated":"2015-01-24 05:41:55.000000000","message":"Since temp is not used, it is customary to begin it with underscore.  I think I\u0027d use _host here as the name.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"995ef6b697486e3f447180d40a6568ac7b70a6bb","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        return result, mech_context, None"},{"line_number":555,"context_line":""},{"line_number":556,"context_line":"    def create_network(self, context, network):"},{"line_number":557,"context_line":"        result, mech_context, temp \u003d self._create_network_db(context, network)"},{"line_number":558,"context_line":"        try:"},{"line_number":559,"context_line":"            self.mechanism_manager.create_network_postcommit(mech_context)"},{"line_number":560,"context_line":"        except ml2_exc.MechanismDriverError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_e6a832dd","line":557,"in_reply_to":"1a930d6b_90a51249","updated":"2015-01-26 17:48:28.000000000","message":"Will fix it in the next patchl","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9522b1184ece2e898bd7e5232449edc65f916921","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            # delete the subnet.  Ideally we\u0027d notify the caller of"},{"line_number":854,"context_line":"            # the fact that an error occurred."},{"line_number":855,"context_line":"            LOG.error(_LE(\"mechanism_manager.delete_subnet_postcommit failed\"))"},{"line_number":856,"context_line":""},{"line_number":857,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":858,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":859,"context_line":"        attrs[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_73c98b58","line":856,"updated":"2015-01-24 05:41:55.000000000","message":"Here is a thought:  You could reduce the footprint of this patch with a wrapper method like this:\n\n  def _create_port_db(self, context, port):\n      result, mech_context, _old_host \u003d self._create_port_db_wrapped(context, port)\n      return result, mech_context\n\n  def _create_port_db_wrapped(self, context, port):\n      ...\n\nOr some other such refactoring.  I don\u0027t know how much I like this suggestion but it is at least as good as this proposed patch set.  Also, the name of the wrapped method may need some work.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"61c5f3ab267ff5a024b8d164cc9b99acc27cd3a9","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            # delete the subnet.  Ideally we\u0027d notify the caller of"},{"line_number":854,"context_line":"            # the fact that an error occurred."},{"line_number":855,"context_line":"            LOG.error(_LE(\"mechanism_manager.delete_subnet_postcommit failed\"))"},{"line_number":856,"context_line":""},{"line_number":857,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":858,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":859,"context_line":"        attrs[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_d0476775","line":856,"in_reply_to":"1a930d6b_73c98b58","updated":"2015-01-26 19:15:17.000000000","message":"Carl, I don\u0027t think we can split this one in a cleaner way.\nIn this case even though we write a wrapper, we will have the _old_host variable in the _create_port_db context and so we need to call the _get_host_port_if_changed and the notify_l3_agent input should be based on the _get_host_port_if_changed output.\n\nThis would again create a problem of introducing an RPC call within the DB transaction.\n\nFor just create_port we can get around this problem where we can call the notify_l3_agent after the \"with db transaction\" completes.\n\nBut in the case of the \"bulk\" operations where the _create_port_db is directly called there is again another \"with db transaction\" were we would be including this rpc call.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"995ef6b697486e3f447180d40a6568ac7b70a6bb","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            # delete the subnet.  Ideally we\u0027d notify the caller of"},{"line_number":854,"context_line":"            # the fact that an error occurred."},{"line_number":855,"context_line":"            LOG.error(_LE(\"mechanism_manager.delete_subnet_postcommit failed\"))"},{"line_number":856,"context_line":""},{"line_number":857,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":858,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":859,"context_line":"        attrs[\u0027status\u0027] \u003d const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_264a3a26","line":856,"in_reply_to":"1a930d6b_73c98b58","updated":"2015-01-26 17:48:28.000000000","message":"Let me check this out and let you know how cleaner we can do.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9522b1184ece2e898bd7e5232449edc65f916921","unresolved":false,"context_lines":[{"line_number":870,"context_line":"            binding \u003d db.add_port_binding(session, result[\u0027id\u0027])"},{"line_number":871,"context_line":"            mech_context \u003d driver_context.PortContext(self, context, result,"},{"line_number":872,"context_line":"                                                      network, binding)"},{"line_number":873,"context_line":"            # Here _process_port_binding is called before the"},{"line_number":874,"context_line":"            # _get_host_port_if_changed call. This would cause a logical"},{"line_number":875,"context_line":"            # error in _get_host_port_if_changed and will not return any"},{"line_number":876,"context_line":"            # port. So the port binding.host state should be captured here"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_537e4f1a","line":873,"updated":"2015-01-24 05:41:55.000000000","message":"This is very verbose.  Just say something like \"need to record the old_host for _get_host_port_if_changed\".","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"995ef6b697486e3f447180d40a6568ac7b70a6bb","unresolved":false,"context_lines":[{"line_number":870,"context_line":"            binding \u003d db.add_port_binding(session, result[\u0027id\u0027])"},{"line_number":871,"context_line":"            mech_context \u003d driver_context.PortContext(self, context, result,"},{"line_number":872,"context_line":"                                                      network, binding)"},{"line_number":873,"context_line":"            # Here _process_port_binding is called before the"},{"line_number":874,"context_line":"            # _get_host_port_if_changed call. This would cause a logical"},{"line_number":875,"context_line":"            # error in _get_host_port_if_changed and will not return any"},{"line_number":876,"context_line":"            # port. So the port binding.host state should be captured here"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_26715a76","line":873,"in_reply_to":"1a930d6b_537e4f1a","updated":"2015-01-26 17:48:28.000000000","message":"I thought it would be good to add more verbose, because that would provide more input to the other developerswho are modifying the code.\nBut if you want it to be simple I can revert it.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9522b1184ece2e898bd7e5232449edc65f916921","unresolved":false,"context_lines":[{"line_number":878,"context_line":"            # The other option is to move back the _get_host_port_if_changed"},{"line_number":879,"context_line":"            # in this function."},{"line_number":880,"context_line":"            # Save the binding.host state for _get_host_port_if_changed."},{"line_number":881,"context_line":"            binding \u003d mech_context._binding"},{"line_number":882,"context_line":"            old_host \u003d binding.host"},{"line_number":883,"context_line":"            self._process_port_binding(mech_context, attrs)"},{"line_number":884,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_b39a136c","line":881,"updated":"2015-01-24 05:41:55.000000000","message":"Does this end up being the same binding as on L870?","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"995ef6b697486e3f447180d40a6568ac7b70a6bb","unresolved":false,"context_lines":[{"line_number":878,"context_line":"            # The other option is to move back the _get_host_port_if_changed"},{"line_number":879,"context_line":"            # in this function."},{"line_number":880,"context_line":"            # Save the binding.host state for _get_host_port_if_changed."},{"line_number":881,"context_line":"            binding \u003d mech_context._binding"},{"line_number":882,"context_line":"            old_host \u003d binding.host"},{"line_number":883,"context_line":"            self._process_port_binding(mech_context, attrs)"},{"line_number":884,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_a60c6aee","line":881,"in_reply_to":"1a930d6b_b39a136c","updated":"2015-01-26 17:48:28.000000000","message":"I will check this out.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9522b1184ece2e898bd7e5232449edc65f916921","unresolved":false,"context_lines":[{"line_number":896,"context_line":"        attrs \u003d port[\u0027port\u0027]"},{"line_number":897,"context_line":"        result, mech_context, binding_host \u003d self._create_port_db("},{"line_number":898,"context_line":"            context, port)"},{"line_number":899,"context_line":"        # _get_host_port_if_changed need to know the previous state of"},{"line_number":900,"context_line":"        # the binding.host before it is been altered by the"},{"line_number":901,"context_line":"        # _process_port_binding."},{"line_number":902,"context_line":"        # The validation in _get_host_port_if_changed will fail if this"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_737b4b28","line":899,"updated":"2015-01-24 05:41:55.000000000","message":"Also too verbose.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"995ef6b697486e3f447180d40a6568ac7b70a6bb","unresolved":false,"context_lines":[{"line_number":896,"context_line":"        attrs \u003d port[\u0027port\u0027]"},{"line_number":897,"context_line":"        result, mech_context, binding_host \u003d self._create_port_db("},{"line_number":898,"context_line":"            context, port)"},{"line_number":899,"context_line":"        # _get_host_port_if_changed need to know the previous state of"},{"line_number":900,"context_line":"        # the binding.host before it is been altered by the"},{"line_number":901,"context_line":"        # _process_port_binding."},{"line_number":902,"context_line":"        # The validation in _get_host_port_if_changed will fail if this"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_e612f207","line":899,"in_reply_to":"1a930d6b_737b4b28","updated":"2015-01-26 17:48:28.000000000","message":"ditto.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9522b1184ece2e898bd7e5232449edc65f916921","unresolved":false,"context_lines":[{"line_number":990,"context_line":"            mech_context \u003d driver_context.PortContext("},{"line_number":991,"context_line":"                self, context, updated_port, network, binding,"},{"line_number":992,"context_line":"                original_port\u003doriginal_port)"},{"line_number":993,"context_line":"            # Save the state of the binding.host."},{"line_number":994,"context_line":"            binding \u003d mech_context._binding"},{"line_number":995,"context_line":"            old_host \u003d binding.host"},{"line_number":996,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_93743737","line":993,"updated":"2015-01-24 05:41:55.000000000","message":"This comment is more like it.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"995ef6b697486e3f447180d40a6568ac7b70a6bb","unresolved":false,"context_lines":[{"line_number":990,"context_line":"            mech_context \u003d driver_context.PortContext("},{"line_number":991,"context_line":"                self, context, updated_port, network, binding,"},{"line_number":992,"context_line":"                original_port\u003doriginal_port)"},{"line_number":993,"context_line":"            # Save the state of the binding.host."},{"line_number":994,"context_line":"            binding \u003d mech_context._binding"},{"line_number":995,"context_line":"            old_host \u003d binding.host"},{"line_number":996,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_66fe02b0","line":993,"in_reply_to":"1a930d6b_93743737","updated":"2015-01-26 17:48:28.000000000","message":"will remove this comment.","commit_id":"209027ebbf0c55d28bec19ff2cc510b51bccb53e"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"8e71d81e3d354305103a842ba811c2496048a743","unresolved":false,"context_lines":[{"line_number":887,"context_line":"        result, mech_context, binding_host \u003d self._create_port_db("},{"line_number":888,"context_line":"            context, port)"},{"line_number":889,"context_line":"        new_host_port \u003d self._get_host_port_if_changed("},{"line_number":890,"context_line":"            mech_context, attrs, binding_host)"},{"line_number":891,"context_line":"        self._notify_l3_agent_new_port(context, new_host_port)"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_3c5bb62f","line":890,"updated":"2015-02-16 02:09:08.000000000","message":"Further checked, I don\u0027t believe there\u0027s any changing after you changed method _create_port_db, _get_host_port_if_changed, and create_port.\n\nThe code in _get_host_port_if_changed still compare host from attrs and mech_context. NO difference.\n\nYou commit message tells something right, the _notify_l3_agent_new_port should be called. But your code seems having nothing to do with this.","commit_id":"a65c0dda31bbddba4bd92f9eb35263cd39a092b3"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"92139f44ad1c9e16c20d5d60ffb348efe6e04aa7","unresolved":false,"context_lines":[{"line_number":779,"context_line":"        return result, mech_context, None"},{"line_number":780,"context_line":""},{"line_number":781,"context_line":"    def create_subnet(self, context, subnet):"},{"line_number":782,"context_line":"        result, mech_context, _temp \u003d self._create_subnet_db(context, subnet)"},{"line_number":783,"context_line":"        try:"},{"line_number":784,"context_line":"            self.mechanism_manager.create_subnet_postcommit(mech_context)"},{"line_number":785,"context_line":"        except ml2_exc.MechanismDriverError:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_0cd6dcc3","line":782,"updated":"2015-03-17 07:51:45.000000000","message":"It seems only create_subnet will invoke _create_subnet_db. So the \"None\" and \"_temp\" you added here, seems useless.","commit_id":"46f3740d9458d89863b87dc5ac8d1453aa75145f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"f02ee5f535775783f369c4c93d005b1a121c662d","unresolved":false,"context_lines":[{"line_number":779,"context_line":"        return result, mech_context, None"},{"line_number":780,"context_line":""},{"line_number":781,"context_line":"    def create_subnet(self, context, subnet):"},{"line_number":782,"context_line":"        result, mech_context, _temp \u003d self._create_subnet_db(context, subnet)"},{"line_number":783,"context_line":"        try:"},{"line_number":784,"context_line":"            self.mechanism_manager.create_subnet_postcommit(mech_context)"},{"line_number":785,"context_line":"        except ml2_exc.MechanismDriverError:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_ca2acd8f","line":782,"in_reply_to":"9a80dd14_0cd6dcc3","updated":"2015-03-17 16:14:36.000000000","message":"ZongKai Li, any _create_(object)_db will be called my _create_bulk_ml2.\nThat is the reason I need to modify the _create_(object)_db to return all three values similar to the _create_port_db.","commit_id":"46f3740d9458d89863b87dc5ac8d1453aa75145f"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"92139f44ad1c9e16c20d5d60ffb348efe6e04aa7","unresolved":false,"context_lines":[{"line_number":933,"context_line":"        result, mech_context, binding_host \u003d self._create_port_db("},{"line_number":934,"context_line":"            context, port)"},{"line_number":935,"context_line":"        new_host_port \u003d self._get_host_port_if_changed("},{"line_number":936,"context_line":"            mech_context, attrs, binding_host)"},{"line_number":937,"context_line":"        # notify any plugin that is interested in port create events"},{"line_number":938,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027port\u0027: new_host_port}"},{"line_number":939,"context_line":"        registry.notify(resources.PORT, events.AFTER_CREATE, self, **kwargs)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_2749fb60","line":936,"updated":"2015-03-17 07:51:45.000000000","message":"so, the binding_host is mech_context._binding.host indeed. so after you changing, nothing changed to method _get_host_port_if_changed processing, right?","commit_id":"46f3740d9458d89863b87dc5ac8d1453aa75145f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"f02ee5f535775783f369c4c93d005b1a121c662d","unresolved":false,"context_lines":[{"line_number":933,"context_line":"        result, mech_context, binding_host \u003d self._create_port_db("},{"line_number":934,"context_line":"            context, port)"},{"line_number":935,"context_line":"        new_host_port \u003d self._get_host_port_if_changed("},{"line_number":936,"context_line":"            mech_context, attrs, binding_host)"},{"line_number":937,"context_line":"        # notify any plugin that is interested in port create events"},{"line_number":938,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027port\u0027: new_host_port}"},{"line_number":939,"context_line":"        registry.notify(resources.PORT, events.AFTER_CREATE, self, **kwargs)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_3e72caad","line":936,"in_reply_to":"9a80dd14_2749fb60","updated":"2015-03-17 16:14:36.000000000","message":"ZongKai Li,\nHere we are capturing the state of the host before it is passed to the _process_port_binding.\nBecause it is in the _process_port_binding that the host is being set for the mech_context.\nThen the captured state of the host is passed to the _get_host_port_if_changed.","commit_id":"46f3740d9458d89863b87dc5ac8d1453aa75145f"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"e28b4f79028a82ebb15da4e22027e113a7d3e7f6","unresolved":false,"context_lines":[{"line_number":933,"context_line":"        result, mech_context, binding_host \u003d self._create_port_db("},{"line_number":934,"context_line":"            context, port)"},{"line_number":935,"context_line":"        new_host_port \u003d self._get_host_port_if_changed("},{"line_number":936,"context_line":"            mech_context, attrs, binding_host)"},{"line_number":937,"context_line":"        # notify any plugin that is interested in port create events"},{"line_number":938,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027port\u0027: new_host_port}"},{"line_number":939,"context_line":"        registry.notify(resources.PORT, events.AFTER_CREATE, self, **kwargs)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_a3ee48b3","line":936,"in_reply_to":"9a80dd14_3e72caad","updated":"2015-03-19 09:46:55.000000000","message":"You mentioned _process_port_binding, I think you\u0027re close enough. It will use host data from port or attrs from nova compute to update mech_context which is related object to port in neutron db.\nWhen we boot a new VM, nova compute will send a port data/object to neutron, that port object only contains few valid info in it, and it will be updated by neutron and sent back to nova compute. While neutron processing, neutron will not only fill the port object but also create related db records, yeah, these records collection should be mech_context. So as you can see, after neutron finish its db processing, in create vm case, mech_context._binding.host should equals to attrs[\u0027binding:host_id\u0027], which means _get_host_port_if_changed will return None for this case.","commit_id":"46f3740d9458d89863b87dc5ac8d1453aa75145f"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"92139f44ad1c9e16c20d5d60ffb348efe6e04aa7","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"            binding \u003d mech_context._binding"},{"line_number":1029,"context_line":"            old_host \u003d binding.host"},{"line_number":1030,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1031,"context_line":"                mech_context, attrs, old_host)"},{"line_number":1032,"context_line":"            need_port_update_notify |\u003d self._process_port_binding("},{"line_number":1033,"context_line":"                mech_context, attrs)"},{"line_number":1034,"context_line":"            self.mechanism_manager.update_port_precommit(mech_context)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_672a1331","line":1031,"updated":"2015-03-17 07:51:45.000000000","message":"previous code will compare mech_context._binding.host with host from attrs in _get_host_port_if_changed, you code here just fetch host from mech_context before invoking _get_host_port_if_changed, so what\u0027s the different?","commit_id":"46f3740d9458d89863b87dc5ac8d1453aa75145f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"f02ee5f535775783f369c4c93d005b1a121c662d","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"            binding \u003d mech_context._binding"},{"line_number":1029,"context_line":"            old_host \u003d binding.host"},{"line_number":1030,"context_line":"            new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1031,"context_line":"                mech_context, attrs, old_host)"},{"line_number":1032,"context_line":"            need_port_update_notify |\u003d self._process_port_binding("},{"line_number":1033,"context_line":"                mech_context, attrs)"},{"line_number":1034,"context_line":"            self.mechanism_manager.update_port_precommit(mech_context)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_9eb7363a","line":1031,"in_reply_to":"9a80dd14_672a1331","updated":"2015-03-17 16:14:36.000000000","message":"See my answer for the previous comment.","commit_id":"46f3740d9458d89863b87dc5ac8d1453aa75145f"}]}
