)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"92aef008537f34be2f05d9aee99b400c816f46d6","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"ML2 Cisco Nexus MD: Create pre/post DB event handlers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Fixes bug: 1241098"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Split ML2 cisco nexus event handers for update and delete"},{"line_number":12,"context_line":"into precommit (called during DB transactions) and postcommit"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAATn%2F%2B7JY%3D","line":9,"updated":"2013-11-18 14:47:34.000000000","message":"New format for specifying bugs per this email [1] would be:\n\nCloses-Bug: 1241098\n\n[1] http://lists.openstack.org/pipermail/openstack-dev/2013-August/012945.html","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"8ace82ea2048310986b35f5854cb4c281983fb59","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"ML2 Cisco Nexus MD: Create pre/post DB event handlers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Fixes bug: 1241098"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Split ML2 cisco nexus event handers for update and delete"},{"line_number":12,"context_line":"into precommit (called during DB transactions) and postcommit"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAATn%2F%2B7ZA%3D","line":9,"updated":"2013-11-18 15:06:13.000000000","message":"Nit: please follow the convention:\n   Closes-Bug: #1241098","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"1c99484deb6f93a07988d2094fb243ad276a0523","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"ML2 Cisco Nexus MD: Create pre/post DB event handlers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Fixes bug: 1241098"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Split ML2 cisco nexus event handers for update and delete"},{"line_number":12,"context_line":"into precommit (called during DB transactions) and postcommit"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAATn%2F%2B6ts%3D","line":9,"in_reply_to":"AAAATn%2F%2B7JY%3D","updated":"2013-11-18 16:25:19.000000000","message":"Sadly, I thought that was the new format. :-) Done.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"1c99484deb6f93a07988d2094fb243ad276a0523","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"ML2 Cisco Nexus MD: Create pre/post DB event handlers"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Fixes bug: 1241098"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Split ML2 cisco nexus event handers for update and delete"},{"line_number":12,"context_line":"into precommit (called during DB transactions) and postcommit"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAATn%2F%2B6tk%3D","line":9,"in_reply_to":"AAAATn%2F%2B7ZA%3D","updated":"2013-11-18 16:25:19.000000000","message":"Done","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"f31bae6758530ac65ec5f3fbc984c3317bddc34d","unresolved":false,"context_lines":[{"line_number":13,"context_line":"(called after DB transactions) methods."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Also fixes some unit tests that were incorrectly accessing"},{"line_number":16,"context_line":"contextmanagers without using the \"with\" statement."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I59b046342706230222c1be39d13a455ca5a884ea"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAATn%2F%2B%2F7g%3D","line":16,"updated":"2013-11-18 12:34:11.000000000","message":"nit context managers.\n\nAlso, what is \"MD\" on line 7?","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"1c99484deb6f93a07988d2094fb243ad276a0523","unresolved":false,"context_lines":[{"line_number":13,"context_line":"(called after DB transactions) methods."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Also fixes some unit tests that were incorrectly accessing"},{"line_number":16,"context_line":"contextmanagers without using the \"with\" statement."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I59b046342706230222c1be39d13a455ca5a884ea"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAATn%2F%2B6tI%3D","line":16,"in_reply_to":"AAAATn%2F%2B%2F7g%3D","updated":"2013-11-18 16:25:19.000000000","message":"Mechanism Driver. I don\u0027t think it will fit on the limited one line description if I spell it out.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"}],"neutron/plugins/ml2/drivers/cisco/mech_cisco_nexus.py":[{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"8a448fa748889757094895a09bbd26fe41b67cc4","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            raise excep.NexusComputeHostNotConfigured(host\u003dhost_id)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def _configure_nxos_db(self, context, vlan_id, device_id, host_id):"},{"line_number":93,"context_line":"        \"\"\"Called during update precommit port event."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        Create the appropriate nexus database entry."},{"line_number":96,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FALc%3D","line":93,"updated":"2013-11-15 22:01:30.000000000","message":"First line of doc string should be a summary... consider swapping the 2 lines of this doc string. Same goes for docstrings in the 2 methods which follow this one.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"1c99484deb6f93a07988d2094fb243ad276a0523","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            raise excep.NexusComputeHostNotConfigured(host\u003dhost_id)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def _configure_nxos_db(self, context, vlan_id, device_id, host_id):"},{"line_number":93,"context_line":"        \"\"\"Called during update precommit port event."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        Create the appropriate nexus database entry."},{"line_number":96,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FAB8%3D","line":93,"in_reply_to":"AAAATn%2F%2FALc%3D","updated":"2013-11-18 16:25:19.000000000","message":"Yes, thanks. Copy/paste error.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"8a448fa748889757094895a09bbd26fe41b67cc4","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        bindings \u003d nxos_db.get_port_vlan_switch_binding(port_id, vlan_id,"},{"line_number":112,"context_line":"                                                        switch_ip)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # Check for initial db entries. Configure switch accordingly."},{"line_number":115,"context_line":"        if len(bindings) \u003d\u003d 1:"},{"line_number":116,"context_line":"            bindings \u003d nxos_db.get_nexusvlan_binding(vlan_id, switch_ip)"},{"line_number":117,"context_line":"            if len(bindings) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FAG0%3D","line":114,"updated":"2013-11-15 22:01:30.000000000","message":"Consider changing \"Check for initial db entries\" to something more descriptive, e.g. \"Check to see if this is the first binding to use this vlan on the switch/port\" or similar.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"1c99484deb6f93a07988d2094fb243ad276a0523","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        bindings \u003d nxos_db.get_port_vlan_switch_binding(port_id, vlan_id,"},{"line_number":112,"context_line":"                                                        switch_ip)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # Check for initial db entries. Configure switch accordingly."},{"line_number":115,"context_line":"        if len(bindings) \u003d\u003d 1:"},{"line_number":116,"context_line":"            bindings \u003d nxos_db.get_nexusvlan_binding(vlan_id, switch_ip)"},{"line_number":117,"context_line":"            if len(bindings) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2B6gc%3D","line":114,"in_reply_to":"AAAATn%2F%2FAG0%3D","updated":"2013-11-18 16:25:19.000000000","message":"Done","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"8ace82ea2048310986b35f5854cb4c281983fb59","unresolved":false,"context_lines":[{"line_number":112,"context_line":"                                                        switch_ip)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # Check for initial db entries. Configure switch accordingly."},{"line_number":115,"context_line":"        if len(bindings) \u003d\u003d 1:"},{"line_number":116,"context_line":"            bindings \u003d nxos_db.get_nexusvlan_binding(vlan_id, switch_ip)"},{"line_number":117,"context_line":"            if len(bindings) \u003d\u003d 1:"},{"line_number":118,"context_line":"                LOG.debug(_(\"Nexus: create \u0026 trunk vlan %s\"), vlan_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2B7M0%3D","line":115,"updated":"2013-11-18 15:06:13.000000000","message":"Is this check and the call to get bindings for (port_id, vlan_id, switch_ip) necessary? \n\nThe call to get bindings for (vlan_id, switch_ip) is sufficient to \n   . if vlan doesn\u0027t exist  (number of bindings is 1) on the switch, create it\n   . if it does, trunk the vlan\n\nThe logic in below doesn\u0027t check the case where the number of bindings is zero, which is an exception. But I guess the call wouldn\u0027t reach here since the precommit would have already failed. \n\nA side note is that the db access routines could have been designed to \n       . create_vlan\n       . trunk_vlan\n\nin that case, a clearer logic (in my opinion) would be: \n       if len(bindings) \u003d\u003d 1:\n              create_vlan()\n       trunk_vlan()","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"1c99484deb6f93a07988d2094fb243ad276a0523","unresolved":false,"context_lines":[{"line_number":112,"context_line":"                                                        switch_ip)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        # Check for initial db entries. Configure switch accordingly."},{"line_number":115,"context_line":"        if len(bindings) \u003d\u003d 1:"},{"line_number":116,"context_line":"            bindings \u003d nxos_db.get_nexusvlan_binding(vlan_id, switch_ip)"},{"line_number":117,"context_line":"            if len(bindings) \u003d\u003d 1:"},{"line_number":118,"context_line":"                LOG.debug(_(\"Nexus: create \u0026 trunk vlan %s\"), vlan_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2B6gg%3D","line":115,"in_reply_to":"AAAATn%2F%2B7M0%3D","updated":"2013-11-18 16:25:19.000000000","message":"Correct about the precommit processing. i.e. you wouldn\u0027t get to the postcommit method if the precommit failed so len(binding) is always \u003e\u003d 1.\n\nI don\u0027t think you can call a trunk_vlan() method without checking if it already exists. Seems like you would be re-adding in a vlan # on the trunked interface.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"8a448fa748889757094895a09bbd26fe41b67cc4","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                                         row.switch_ip, row.instance_id)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def _delete_switch_entry(self, context, vlan_id, device_id, host_id):"},{"line_number":141,"context_line":"        \"\"\"Called during update postcommit port event."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        By accessing the current db entries determine if switch"},{"line_number":144,"context_line":"        configuration can be removed."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FAD8%3D","line":141,"updated":"2013-11-15 22:01:30.000000000","message":"s/update postcommit/delete postcommit/\nAlso, consider changing the first line of the docstring to describe what the method does, rather than when it\u0027s called. (\"Called during delete postcommit port event\" could be included in the body?)","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"1c99484deb6f93a07988d2094fb243ad276a0523","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                                         row.switch_ip, row.instance_id)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def _delete_switch_entry(self, context, vlan_id, device_id, host_id):"},{"line_number":141,"context_line":"        \"\"\"Called during update postcommit port event."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        By accessing the current db entries determine if switch"},{"line_number":144,"context_line":"        configuration can be removed."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FABY%3D","line":141,"in_reply_to":"AAAATn%2F%2FAD8%3D","updated":"2013-11-18 16:25:19.000000000","message":"Yes again. Copy/paste description from earlier version.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"e05af5c4bfad9c6b34f12ccb751d59322734e3d5","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        \"\"\"Update port pre-database transaction commit event.\"\"\""},{"line_number":172,"context_line":"        port \u003d context.current"},{"line_number":173,"context_line":"        if self._is_deviceowner_compute(port) and self._is_status_active(port):"},{"line_number":174,"context_line":"            self._port_action(context, self._configure_nxos_db)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def update_port_postcommit(self, context):"},{"line_number":177,"context_line":"        \"\"\"Update port post-database commit event.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2B6mM%3D","line":174,"updated":"2013-11-18 16:06:56.000000000","message":"a python decorator can be used when a function\u0027s argument is another function.\nSo looks like _port_action can be converted to a decorator, and afterwards, this routine can be converted as\ndef update_port_precommit(self, context):\n    self._configure_nxos_db(context)\n\n@port_action(port_status\u003d\u0027active\u0027)\ndef _configure_nxos_db(self, context, vlan_id, device_id, host_id): \n   ----------\n\nConvert _port_action to a decorator outside the class. Something like:\ndef port_action(port_status\u003dNone):\n        def outer(f):\n            @function_tools.wraps(f)    \n            def inner(self, context, vlan_id\u003dNone, device_id\u003dNone, host_id\u003dNone):\n                port \u003d context.current\n                if not self._is_deviceowner_compute(port):\n                    return\n                if not (port_status \u003d\u003d \u0027active\u0027 and self._is_status_active(port)):\n                    return\n                vlan_id \u003d self._get_vlanid(context)\n                device_id \u003d context.current.get(\u0027device_id\u0027)\n                host_id \u003d context.current.get(portbindings.HOST_ID)\n               if vlan_id and device_id and host_id: \n                   return(f, context, vlan_id, device_id, host_id)\n               else:\n                   throw exception\n            return inner\n        return outer\nThe additional checks (device owner and port status) are placed in the decorator as well.\n\nPlace the decorator in front of _configure_switch_entry, _delete_nxos_db, _delete_switch_entry, the rest of the commit routines can be simplified in the same way.\n\nThis is just a recommendation.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"1c99484deb6f93a07988d2094fb243ad276a0523","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        \"\"\"Update port pre-database transaction commit event.\"\"\""},{"line_number":172,"context_line":"        port \u003d context.current"},{"line_number":173,"context_line":"        if self._is_deviceowner_compute(port) and self._is_status_active(port):"},{"line_number":174,"context_line":"            self._port_action(context, self._configure_nxos_db)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def update_port_postcommit(self, context):"},{"line_number":177,"context_line":"        \"\"\"Update port post-database commit event.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2B6fM%3D","line":174,"in_reply_to":"AAAATn%2F%2B6mM%3D","updated":"2013-11-18 16:25:19.000000000","message":"I\u0027ll take a look at this suggestion but at first glance it doesn\u0027t look at simple as my proposed design. Might take advantage of some python capabilities but it looks like this proposed port_action() is more complicated. I tend to like small functions/methods.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"a836ae4879ac999945f735fa9aba4f176ff0946c","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        # Check to see if this is the first binding to use this vlan on the"},{"line_number":101,"context_line":"        # switch/port. Configure switch accordingly."},{"line_number":102,"context_line":"        bindings \u003d nxos_db.get_nexusvlan_binding(vlan_id, switch_ip)"},{"line_number":103,"context_line":"        if len(bindings) \u003d\u003d 1:"},{"line_number":104,"context_line":"            LOG.debug(_(\"Nexus: create \u0026 trunk vlan %s\"), vlan_name)"},{"line_number":105,"context_line":"            self.driver.create_and_trunk_vlan(switch_ip, vlan_id, vlan_name,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F92Po%3D","line":102,"updated":"2014-02-03 11:09:05.000000000","message":"that looks inconsistent with method definition. it should return single entry. also the parameter is instance_id, why switch_ip here?","commit_id":"b34fb5cb22b1fa43306552f916a31e1a88e98cad"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"553d258e4269fd73ce0f0d6226233fbdb53be7a0","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        # Check to see if this is the first binding to use this vlan on the"},{"line_number":101,"context_line":"        # switch/port. Configure switch accordingly."},{"line_number":102,"context_line":"        bindings \u003d nxos_db.get_nexusvlan_binding(vlan_id, switch_ip)"},{"line_number":103,"context_line":"        if len(bindings) \u003d\u003d 1:"},{"line_number":104,"context_line":"            LOG.debug(_(\"Nexus: create \u0026 trunk vlan %s\"), vlan_name)"},{"line_number":105,"context_line":"            self.driver.create_and_trunk_vlan(switch_ip, vlan_id, vlan_name,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2F2SM%3D","line":102,"in_reply_to":"AAAAUH%2F91lw%3D","updated":"2014-02-10 12:59:59.000000000","message":"Thanks for the explanation.\n\nI think it\u0027s method name which creates confusion.","commit_id":"b34fb5cb22b1fa43306552f916a31e1a88e98cad"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"41bfe8783e60c7e0b65fd9d7298dc3fca4228eb8","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        # Check to see if this is the first binding to use this vlan on the"},{"line_number":101,"context_line":"        # switch/port. Configure switch accordingly."},{"line_number":102,"context_line":"        bindings \u003d nxos_db.get_nexusvlan_binding(vlan_id, switch_ip)"},{"line_number":103,"context_line":"        if len(bindings) \u003d\u003d 1:"},{"line_number":104,"context_line":"            LOG.debug(_(\"Nexus: create \u0026 trunk vlan %s\"), vlan_name)"},{"line_number":105,"context_line":"            self.driver.create_and_trunk_vlan(switch_ip, vlan_id, vlan_name,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F91lw%3D","line":102,"in_reply_to":"AAAAUH%2F92Po%3D","updated":"2014-02-03 13:48:01.000000000","message":"nxos_db.get_nexusvlan_binding is defined here\nml2/drivers/cisco/nexus_db_v2.py as\ndef get_nexusvlan_binding(vlan_id, switch_ip):\n  return _lookup_all_nexus_bindings(vlan_id\u003dvlan_id, switch_ip\u003dswitch_ip)\nThe passed in parameters to get_nexusvlan_binding are vlan# and the IP address of the nexus switch. \nThe call to lookup_all_nexus_bindings will return all bindings associated with the matching vlan + switch_ip.","commit_id":"b34fb5cb22b1fa43306552f916a31e1a88e98cad"}],"neutron/tests/unit/ml2/drivers/test_cisco_mech.py":[{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"6753a5c36a3f201e4a8b4c500b87831976e5ffd8","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                    req \u003d self.new_update_request(\u0027ports\u0027, data,"},{"line_number":185,"context_line":"                                                  port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":186,"context_line":"                    res \u003d req.get_response(self.api)"},{"line_number":187,"context_line":"                    yield res"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _assertExpectedHTTP(self, status, exc):"},{"line_number":190,"context_line":"        \"\"\"Confirm that an HTTP status corresponds to an expected exception."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2B6mc%3D","line":187,"updated":"2013-11-18 16:27:31.000000000","message":"It looks as though the value \u0027res\u0027 returned for _create_resources() is no longer used by callers for anything other than deriving res.status_int. Should this method be changed to just return res.status_int directly?","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"708b89a632f591583a4343065e674a2892cfa3de","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                    req \u003d self.new_update_request(\u0027ports\u0027, data,"},{"line_number":185,"context_line":"                                                  port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":186,"context_line":"                    res \u003d req.get_response(self.api)"},{"line_number":187,"context_line":"                    yield res"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _assertExpectedHTTP(self, status, exc):"},{"line_number":190,"context_line":"        \"\"\"Confirm that an HTTP status corresponds to an expected exception."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BqqM%3D","line":187,"in_reply_to":"AAAATn%2F%2B6mc%3D","updated":"2014-01-29 18:12:46.000000000","message":"Done","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"6753a5c36a3f201e4a8b4c500b87831976e5ffd8","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        :param exc: Expected exception"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        if exc in base.FAULT_MAP:"},{"line_number":201,"context_line":"            expected_http \u003d base.FAULT_MAP[exc].code"},{"line_number":202,"context_line":"        else:"},{"line_number":203,"context_line":"            expected_http \u003d wexc.HTTPInternalServerError.code"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2B6eE%3D","line":200,"updated":"2013-11-18 16:27:31.000000000","message":"The mapping of expected exception to returned HTTP result code that we had assumed in the monolithic Nexus plugin no longer works in the ML2 model, since the ML2 mechanism driver is mapping all exceptions to MechanismDriverError (which currently only includes a tag for the mechanism driver API method which was called when the error occurs). So I think there are 2 issues to consider:\n(1) The ML2 mechanism manager should include more information about the original exception, e.g. original exception traceback, or at least the original, mechanism-driver-specific exception name, and\n(2) The unit tests in this module probably need to be redesigned to look for something more specific than HTTP result code, since the HTTP result code we\u0027d be getting for any exception is going to be mapped from the one common MechanismDriverError.  Maybe we can pass the expected exception to the port() and new_update_request() methods, or if that doesn\u0027t work, somehow mock the mechanism manager\u0027s _call_on_drivers() method so that we can trap the Cisco mech driver specific exception that is being raised.\nThis is a lot of rework, so I don\u0027t know if we want to tackle this with this bug or raise a new bug.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"708b89a632f591583a4343065e674a2892cfa3de","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        :param exc: Expected exception"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        if exc in base.FAULT_MAP:"},{"line_number":201,"context_line":"            expected_http \u003d base.FAULT_MAP[exc].code"},{"line_number":202,"context_line":"        else:"},{"line_number":203,"context_line":"            expected_http \u003d wexc.HTTPInternalServerError.code"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2BPyk%3D","line":200,"in_reply_to":"AAAATn%2F%2B6eE%3D","updated":"2014-01-29 18:12:46.000000000","message":"Working on exception handling (including changing common ML2 code to return more than one HTTP code) using another bug.\nNB: Another bug is up for review: https://review.openstack.org/#/c/69748/2 which I may be able to use to solve our issue.","commit_id":"69142588212281d9f569b59849ba98f4d91bbed5"}]}
