)]}'
{"neutron/plugins/ml2/README":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":31,"context_line":"with the hyperv L2 agent. A modular agent may be developed as a"},{"line_number":32,"context_line":"follow-on effort."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Support for mechanism drivers is currently a work-in-progress, and the"},{"line_number":35,"context_line":"interface is subject to change in future versions. MechanismDrivers"},{"line_number":36,"context_line":"are currently called both inside and following DB transactions for"},{"line_number":37,"context_line":"network and port create/update/delete operations. In a future version,"}],"source_content_type":"application/octet-stream","patch_set":14,"id":"AAAAP3%2F%2F8%2BI%3D","line":34,"updated":"2013-07-08 17:54:40.000000000","message":"readme\u0027s can easliy suffer from bit rot.  I\u0027d a preface that this paragraph applies to pre-release Havana versions.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":31,"context_line":"with the hyperv L2 agent. A modular agent may be developed as a"},{"line_number":32,"context_line":"follow-on effort."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Support for mechanism drivers is currently a work-in-progress, and the"},{"line_number":35,"context_line":"interface is subject to change in future versions. MechanismDrivers"},{"line_number":36,"context_line":"are currently called both inside and following DB transactions for"},{"line_number":37,"context_line":"network and port create/update/delete operations. In a future version,"}],"source_content_type":"application/octet-stream","patch_set":14,"id":"AAAAP3%2F%2F7Kc%3D","line":34,"in_reply_to":"AAAAP3%2F%2F8%2BI%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"}],"neutron/plugins/ml2/config.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":29,"context_line":"                       \"networks.\")),"},{"line_number":30,"context_line":"    cfg.ListOpt(\u0027mechanism_drivers\u0027,"},{"line_number":31,"context_line":"                default\u003d[],"},{"line_number":32,"context_line":"                help\u003d_(\"List of networking mechanism driver entrypoints to \""},{"line_number":33,"context_line":"                       \"be loaded from the neutron.ml2.mechanism_drivers \""},{"line_number":34,"context_line":"                       \"namespace. Mechanism drivers are called in the order \""},{"line_number":35,"context_line":"                       \"in which they are listed.\")),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F89M%3D","line":32,"updated":"2013-07-08 17:54:40.000000000","message":"I think you could make this more succinct by adding  \"An ordered list...\" at the beginning vs the sentence at the end.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":29,"context_line":"                       \"networks.\")),"},{"line_number":30,"context_line":"    cfg.ListOpt(\u0027mechanism_drivers\u0027,"},{"line_number":31,"context_line":"                default\u003d[],"},{"line_number":32,"context_line":"                help\u003d_(\"List of networking mechanism driver entrypoints to \""},{"line_number":33,"context_line":"                       \"be loaded from the neutron.ml2.mechanism_drivers \""},{"line_number":34,"context_line":"                       \"namespace. Mechanism drivers are called in the order \""},{"line_number":35,"context_line":"                       \"in which they are listed.\")),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7KU%3D","line":32,"in_reply_to":"AAAAP3%2F%2F89M%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"}],"neutron/plugins/ml2/driver_api.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":140,"context_line":"    __metaclass__ \u003d ABCMeta"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    @abstractmethod"},{"line_number":143,"context_line":"    def get_network(self):"},{"line_number":144,"context_line":"        \"\"\"Return the current state of the network."},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        Return the current state of the network, as defined by"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F87I%3D","line":143,"updated":"2013-07-08 17:54:40.000000000","message":"If I\u0027m calling this, I know I\u0027ve got a NetworkContext instance, so I think a different name is order.  Also this should be an abstract property. Consider:\n\n@abstractproperty\ndef current(self):","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":140,"context_line":"    __metaclass__ \u003d ABCMeta"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    @abstractmethod"},{"line_number":143,"context_line":"    def get_network(self):"},{"line_number":144,"context_line":"        \"\"\"Return the current state of the network."},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        Return the current state of the network, as defined by"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7Iw%3D","line":143,"in_reply_to":"AAAAP3%2F%2F87I%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        pass"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    @abstractmethod"},{"line_number":153,"context_line":"    def get_original_network(self):"},{"line_number":154,"context_line":"        \"\"\"Return the original state of the network."},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        Return the original state of the network, prior to a call"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F87E%3D","line":153,"updated":"2013-07-08 17:54:40.000000000","message":"Same as above..consider:\n\n@abstractproperty\ndef original(self):","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":150,"context_line":"        pass"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    @abstractmethod"},{"line_number":153,"context_line":"    def get_original_network(self):"},{"line_number":154,"context_line":"        \"\"\"Return the original state of the network."},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        Return the original state of the network, prior to a call"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7I0%3D","line":153,"in_reply_to":"AAAAP3%2F%2F87E%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":177,"context_line":"    __metaclass__ \u003d ABCMeta"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    @abstractmethod"},{"line_number":180,"context_line":"    def get_port(self):"},{"line_number":181,"context_line":"        \"\"\"Return the current state of the port."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        Return the current state of the network, as defined by"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F88M%3D","line":180,"updated":"2013-07-08 17:54:40.000000000","message":"Consider\n\n@abstractproperty\ndef current(self):","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":177,"context_line":"    __metaclass__ \u003d ABCMeta"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    @abstractmethod"},{"line_number":180,"context_line":"    def get_port(self):"},{"line_number":181,"context_line":"        \"\"\"Return the current state of the port."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        Return the current state of the network, as defined by"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7I4%3D","line":180,"in_reply_to":"AAAAP3%2F%2F88M%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    def get_port(self):"},{"line_number":181,"context_line":"        \"\"\"Return the current state of the port."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        Return the current state of the network, as defined by"},{"line_number":184,"context_line":"        NeutronPluginBaseV2.create_port and all extensions in the"},{"line_number":185,"context_line":"        ml2 plugin."},{"line_number":186,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F88Y%3D","line":183,"updated":"2013-07-08 17:54:40.000000000","message":"network?  Shouldn\u0027t this state of the port?","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":180,"context_line":"    def get_port(self):"},{"line_number":181,"context_line":"        \"\"\"Return the current state of the port."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        Return the current state of the network, as defined by"},{"line_number":184,"context_line":"        NeutronPluginBaseV2.create_port and all extensions in the"},{"line_number":185,"context_line":"        ml2 plugin."},{"line_number":186,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7JE%3D","line":183,"in_reply_to":"AAAAP3%2F%2F88Y%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":187,"context_line":"        pass"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    @abstractmethod"},{"line_number":190,"context_line":"    def get_original_port(self):"},{"line_number":191,"context_line":"        \"\"\"Return the original state of the port"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        Return the original state of the port, prior to a call"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F88E%3D","line":190,"updated":"2013-07-08 17:54:40.000000000","message":"Same comment as above... consider:\n\n@abstractproperty\ndef original()","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":187,"context_line":"        pass"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    @abstractmethod"},{"line_number":190,"context_line":"    def get_original_port(self):"},{"line_number":191,"context_line":"        \"\"\"Return the original state of the port"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        Return the original state of the port, prior to a call"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7JA%3D","line":190,"in_reply_to":"AAAAP3%2F%2F88E%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        pass"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    @abstractmethod"},{"line_number":200,"context_line":"    def get_network(self):"},{"line_number":201,"context_line":"        \"\"\"Return the NetworkContext associated with this port.\"\"\""},{"line_number":202,"context_line":"        pass"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F84g%3D","line":200,"updated":"2013-07-08 17:54:40.000000000","message":"This should be a property as well.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":197,"context_line":"        pass"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    @abstractmethod"},{"line_number":200,"context_line":"    def get_network(self):"},{"line_number":201,"context_line":"        \"\"\"Return the NetworkContext associated with this port.\"\"\""},{"line_number":202,"context_line":"        pass"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7I8%3D","line":200,"in_reply_to":"AAAAP3%2F%2F84g%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"}],"neutron/plugins/ml2/driver_context.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        self._original_network \u003d original_network"},{"line_number":36,"context_line":"        self._segments \u003d segments"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def get_network(self):"},{"line_number":39,"context_line":"        return self._network"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def get_original_network(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F85A%3D","line":38,"updated":"2013-07-08 17:54:40.000000000","message":"See note in parent definition about making these properties.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":35,"context_line":"        self._original_network \u003d original_network"},{"line_number":36,"context_line":"        self._segments \u003d segments"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def get_network(self):"},{"line_number":39,"context_line":"        return self._network"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def get_original_network(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7IY%3D","line":38,"in_reply_to":"AAAAP3%2F%2F85A%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from neutron.plugins.ml2 import driver_api as api"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class MechanismDriverContext(object):"},{"line_number":20,"context_line":"    \"\"\"MechanismDriver context base class.\"\"\""},{"line_number":21,"context_line":"    def __init__(self, plugin, plugin_context):"},{"line_number":22,"context_line":"        self._plugin \u003d plugin"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAP3%2F%2Fz1A%3D","line":19,"updated":"2013-07-11 04:27:40.000000000","message":"The mechanism driver\u0027s base class should be api.NetworkContext.","commit_id":"34798f3a1e3a910eac553c4eb87e5ffedd74fac1"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":26,"context_line":"        self._plugin_context \u003d plugin_context"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class NetworkContext(MechanismDriverContext, api.NetworkContext):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def __init__(self, plugin, plugin_context, network,"},{"line_number":32,"context_line":"                 segments\u003dNone, original_network\u003dNone):"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAP3%2F%2Fz0w%3D","line":29,"updated":"2013-07-11 04:27:40.000000000","message":"You\u0027re using multiple inheritance when the actual usage is single inheritance.","commit_id":"34798f3a1e3a910eac553c4eb87e5ffedd74fac1"}],"neutron/plugins/ml2/managers.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":"import stevedore"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from neutron.common import exceptions as exc"},{"line_number":22,"context_line":"from neutron.openstack.common import log"},{"line_number":23,"context_line":"from neutron.plugins.ml2.common import exceptions as ml2_exc"},{"line_number":24,"context_line":"from neutron.plugins.ml2 import driver_api as api"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F82I%3D","line":21,"updated":"2013-07-08 17:54:40.000000000","message":"See below, but might need to add:\n\n from neutron.openstack.common import excutils","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":180,"context_line":"        called in this case."},{"line_number":181,"context_line":"        \"\"\""},{"line_number":182,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                driver.obj.create_network_postcommit(context)"},{"line_number":185,"context_line":"            except Exception as e:"},{"line_number":186,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F984%3D","line":183,"updated":"2013-07-08 12:40:23.000000000","message":"The try/except block is used numerous times in this file, with end result of setting a flag or raising an exception.\n\nWould it be useful to create a decorator to remove duplication of error handling and maybe loop?","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":180,"context_line":"        called in this case."},{"line_number":181,"context_line":"        \"\"\""},{"line_number":182,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                driver.obj.create_network_postcommit(context)"},{"line_number":185,"context_line":"            except Exception as e:"},{"line_number":186,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F5l0%3D","line":183,"in_reply_to":"AAAAP3%2F%2F8tA%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":180,"context_line":"        called in this case."},{"line_number":181,"context_line":"        \"\"\""},{"line_number":182,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                driver.obj.create_network_postcommit(context)"},{"line_number":185,"context_line":"            except Exception as e:"},{"line_number":186,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F8tA%3D","line":183,"in_reply_to":"AAAAP3%2F%2F8y0%3D","updated":"2013-07-08 18:16:18.000000000","message":"Yeah, helper may be better. Was thinking on the same lines of providing the method by name. Could include a flag that indicates whether it should raise exception or just return True for error.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        called in this case."},{"line_number":181,"context_line":"        \"\"\""},{"line_number":182,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                driver.obj.create_network_postcommit(context)"},{"line_number":185,"context_line":"            except Exception as e:"},{"line_number":186,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F8y0%3D","line":183,"in_reply_to":"AAAAP3%2F%2F984%3D","updated":"2013-07-08 17:54:40.000000000","message":"Not sure a deco would be appropriate.  Seems like a helper method you pass the method name.  ie\n\ndef _call_on_drivers(self, method_name, context):\n    for driver in self.ordered_mech_drivers:\n        try:\n            getattr(driver.obj, method_name)(context)\n        except:\n            LOG.exception(\n                 _(\"Mechanism driver \u0027%(name)s\u0027 failed in %(method)s\"),\n                {\u0027name\u0027: driver.name, \u0027method\u0027: method_name}\n       \n            )\n            raise ml2_exc.MechanismDriverError(\n                 method\u003dmethod_name\n            )","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                driver.obj.create_network_postcommit(context)"},{"line_number":185,"context_line":"            except Exception as e:"},{"line_number":186,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":187,"context_line":"                            \"create_network_postcommit with error \""},{"line_number":188,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F82c%3D","line":185,"updated":"2013-07-08 17:54:40.000000000","message":"This will actually remove critical info from the logs  This is the only method where you raise the original exception.  Why?\n\nwith excutils.save_and_reraise_exception():\n    LOG.exception(\n        _(\"Mechanism driver \u0027%s\u0027 failed in create_network_postcommit\"),\n        driver.name\n    )","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":182,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":183,"context_line":"            try:"},{"line_number":184,"context_line":"                driver.obj.create_network_postcommit(context)"},{"line_number":185,"context_line":"            except Exception as e:"},{"line_number":186,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":187,"context_line":"                            \"create_network_postcommit with error \""},{"line_number":188,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F5lk%3D","line":185,"in_reply_to":"AAAAP3%2F%2F82c%3D","updated":"2013-07-09 15:30:43.000000000","message":"Yes, this is a good point. Have changed this to now raise a MechanismDriverError (along with the rest of the methods).\n\nThanks for the pointer on excutils.save_and_reraise_exception","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":221,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":222,"context_line":"            try:"},{"line_number":223,"context_line":"                driver.obj.update_network_postcommit(context)"},{"line_number":224,"context_line":"            except Exception as e:"},{"line_number":225,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":226,"context_line":"                            \"update_network_postcommit with error \""},{"line_number":227,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F81Y%3D","line":224,"updated":"2013-07-08 17:54:40.000000000","message":"Do we really want to keep processing when there\u0027s been an error?  Seems like the correct thing would be to immediately raise the exception.  Also you need to LOG.exception passing only the error message (the method will take care of logging the actual exception).  As currently setup, this will make troubleshooting hard.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":221,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":222,"context_line":"            try:"},{"line_number":223,"context_line":"                driver.obj.update_network_postcommit(context)"},{"line_number":224,"context_line":"            except Exception as e:"},{"line_number":225,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":226,"context_line":"                            \"update_network_postcommit with error \""},{"line_number":227,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F4VU%3D","line":224,"in_reply_to":"AAAAP3%2F%2F4gM%3D","updated":"2013-07-09 21:22:48.000000000","message":"I like this as an approach. For now I\u0027ve changed update_*_postcommit to raise an exception as soon as the first mechanism driver fails. For now this exception will jsut be returned all the way to the user, which will have to retry/undo the update or delete the resource.\n\nI like the idea of handling this within the ml2 plugin in the way you mention, though we probably need to worry about creating a loop (ie if the mechanism driver will always fail). I\u0027m putting this off for now (I\u0027ve added a TODO and comment) in the hopes of getting the initial ml2 mechanism driver infra merged.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"unresolved":false,"context_lines":[{"line_number":221,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":222,"context_line":"            try:"},{"line_number":223,"context_line":"                driver.obj.update_network_postcommit(context)"},{"line_number":224,"context_line":"            except Exception as e:"},{"line_number":225,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":226,"context_line":"                            \"update_network_postcommit with error \""},{"line_number":227,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F4gM%3D","line":224,"in_reply_to":"AAAAP3%2F%2F5jU%3D","updated":"2013-07-09 20:28:15.000000000","message":"Hi Andre -\nFYI regarding the update_*_postcommit comment.\nThe existing cisco subplugins work like this:\nupdate_network - we only call the OVS plugin on this event. i.e. no external device actions\nupdate_port - OVS plugin is called. if successful then external nexus device subplugin is called. if an error occurs on this event then OVS update_port plugin is called again with the original port attributes. Basically rolling back OVS to it\u0027s initial port state.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":221,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":222,"context_line":"            try:"},{"line_number":223,"context_line":"                driver.obj.update_network_postcommit(context)"},{"line_number":224,"context_line":"            except Exception as e:"},{"line_number":225,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":226,"context_line":"                            \"update_network_postcommit with error \""},{"line_number":227,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F5jU%3D","line":224,"in_reply_to":"AAAAP3%2F%2F81Y%3D","updated":"2013-07-09 15:30:43.000000000","message":"Thanks for the pointer to LOG.exception, I\u0027ve changed to using that.\n\nOn the question of continuing on error or not - this is the conclusion we reached in discussing this with Bob Kurura, Kyle Mestery, and Rich Curran:\n\n- when within the _precommit methods, return immediately on error as we\u0027re going to rollback the whole transaction\n\n- when in create_RESOURCE_postcommit, return immediately on error as we\u0027re going to delete the resource we\u0027re in the middle of creating, allowing the user to try again once the issue is resolved\n\n- when in delete_RESOURCE_postcommit, ignore the errors as we\u0027ve already deleted the resource in the database and it would be difficult / not clearly the desired behavior to revive the resource fully on error\n\n- when in update_RESOURCE_postcommit, things get tricky. We can\u0027t really delete the resource automatically, as this may cause a bunch of dependent things to unwind. It feels like either way we\u0027re going to want to notify the user of the error so that they can retry. Our choices are to either attempt to call all mechanism drivers or to just give up and return immediately. Thinking through this more, I can argue it both ways - if you attempt to call all mechanism drivers, you may have the best chance of things working after the call to update_RESOURCE. However if you\u0027re depending on ordering between mechanism drivers, this obviously won\u0027t work.\n\nI\u0027m leaning towards changing this to fail fast and just return an error immediately. We really shouldn\u0027t have MechanismDrivers raising exceptions in the normal case. If this is a transient problem, we\u0027ll want the user to retry anyway.\n\nAppreciate feedback from the group.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":265,"context_line":"            try:"},{"line_number":266,"context_line":"                driver.obj.delete_network_postcommit(context)"},{"line_number":267,"context_line":"            except Exception as e:"},{"line_number":268,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":269,"context_line":"                            \"delete_network_postcommit with error \""},{"line_number":270,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F81Q%3D","line":267,"updated":"2013-07-08 17:54:40.000000000","message":"Same comments as above on immediate raise and error handling.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":264,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":265,"context_line":"            try:"},{"line_number":266,"context_line":"                driver.obj.delete_network_postcommit(context)"},{"line_number":267,"context_line":"            except Exception as e:"},{"line_number":268,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":269,"context_line":"                            \"delete_network_postcommit with error \""},{"line_number":270,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7FE%3D","line":267,"in_reply_to":"AAAAP3%2F%2F81Q%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":304,"context_line":"            try:"},{"line_number":305,"context_line":"                driver.obj.create_port_postcommit(context)"},{"line_number":306,"context_line":"            except Exception as e:"},{"line_number":307,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":308,"context_line":"                            \"create_port_postcommit with error \""},{"line_number":309,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F81I%3D","line":306,"updated":"2013-07-08 17:54:40.000000000","message":"Same","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":303,"context_line":"        for driver in self.ordered_mech_drivers:"},{"line_number":304,"context_line":"            try:"},{"line_number":305,"context_line":"                driver.obj.create_port_postcommit(context)"},{"line_number":306,"context_line":"            except Exception as e:"},{"line_number":307,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in \""},{"line_number":308,"context_line":"                            \"create_port_postcommit with error \""},{"line_number":309,"context_line":"                            \"\u0027%(error)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F7FI%3D","line":306,"in_reply_to":"AAAAP3%2F%2F81I%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":83,"context_line":"        return self._aliases"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def __init__(self):"},{"line_number":86,"context_line":"        # First load drivers, then initialize DB, then initialize drivers"},{"line_number":87,"context_line":"        self.type_manager \u003d managers.TypeManager()"},{"line_number":88,"context_line":"        self.mechanism_manager \u003d managers.MechanismManager()"},{"line_number":89,"context_line":"        db.initialize()"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F958%3D","line":86,"updated":"2013-07-08 12:40:23.000000000","message":"Use docstring vs comment.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":83,"context_line":"        return self._aliases"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def __init__(self):"},{"line_number":86,"context_line":"        # First load drivers, then initialize DB, then initialize drivers"},{"line_number":87,"context_line":"        self.type_manager \u003d managers.TypeManager()"},{"line_number":88,"context_line":"        self.mechanism_manager \u003d managers.MechanismManager()"},{"line_number":89,"context_line":"        db.initialize()"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F5jE%3D","line":86,"in_reply_to":"AAAAP3%2F%2F8x8%3D","updated":"2013-07-09 15:30:43.000000000","message":"Yes, I think this is a comment on the ordering in which the methods are called.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        return self._aliases"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def __init__(self):"},{"line_number":86,"context_line":"        # First load drivers, then initialize DB, then initialize drivers"},{"line_number":87,"context_line":"        self.type_manager \u003d managers.TypeManager()"},{"line_number":88,"context_line":"        self.mechanism_manager \u003d managers.MechanismManager()"},{"line_number":89,"context_line":"        db.initialize()"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F8x8%3D","line":86,"in_reply_to":"AAAAP3%2F%2F958%3D","updated":"2013-07-08 17:54:40.000000000","message":"Not sure this comment would be appropriate for a doc string","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    # TODO(apech): Need to override bulk operations"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def create_network(self, context, network):"},{"line_number":192,"context_line":"        attrs \u003d network[\u0027network\u0027]"},{"line_number":193,"context_line":"        segment \u003d self._process_provider_create(context, attrs)"},{"line_number":194,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, attrs)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F95s%3D","line":191,"updated":"2013-07-08 12:40:23.000000000","message":"Docstrings for the visible functions.","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        try:"},{"line_number":217,"context_line":"            self.mechanism_manager.create_network_postcommit(mech_context)"},{"line_number":218,"context_line":"        except Exception:"},{"line_number":219,"context_line":"            LOG.error(_(\"mechanism_manager.create_network failed, \""},{"line_number":220,"context_line":"                        \"deleting network \u0027%s\u0027\"), result[\u0027id\u0027])"},{"line_number":221,"context_line":"            self.delete_network(context, result[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F8xU%3D","line":218,"updated":"2013-07-08 17:54:40.000000000","message":"Replace 219-223\n\nexcept:\n    with excutils.save_and_reraise_exception():\n         LOG.exception(_(\u0027\"mechanism_manager.create_network failed, deleting network \u0027%s\u0027\"), result[\u0027id\u0027])\n         self.delete_network(context, result[\u0027id\u0027])","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        try:"},{"line_number":217,"context_line":"            self.mechanism_manager.create_network_postcommit(mech_context)"},{"line_number":218,"context_line":"        except Exception:"},{"line_number":219,"context_line":"            LOG.error(_(\"mechanism_manager.create_network failed, \""},{"line_number":220,"context_line":"                        \"deleting network \u0027%s\u0027\"), result[\u0027id\u0027])"},{"line_number":221,"context_line":"            self.delete_network(context, result[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F5i4%3D","line":218,"in_reply_to":"AAAAP3%2F%2F8xU%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":297,"context_line":"            self.mechanism_manager.delete_network_postcommit(mech_context)"},{"line_number":298,"context_line":"        except ml2_exc.MechanismDriverError:"},{"line_number":299,"context_line":"            # One or more mechanism driver failed to delete the network."},{"line_number":300,"context_line":"            # Ideally we\u0027d notify the caller of the fact that an error"},{"line_number":301,"context_line":"            # occurred."},{"line_number":302,"context_line":"            pass"},{"line_number":303,"context_line":"        self.notifier.network_delete(context, id)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F95k%3D","line":300,"updated":"2013-07-08 12:40:23.000000000","message":"Add a TODO here?","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":297,"context_line":"            self.mechanism_manager.delete_network_postcommit(mech_context)"},{"line_number":298,"context_line":"        except ml2_exc.MechanismDriverError:"},{"line_number":299,"context_line":"            # One or more mechanism driver failed to delete the network."},{"line_number":300,"context_line":"            # Ideally we\u0027d notify the caller of the fact that an error"},{"line_number":301,"context_line":"            # occurred."},{"line_number":302,"context_line":"            pass"},{"line_number":303,"context_line":"        self.notifier.network_delete(context, id)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F5i0%3D","line":300,"in_reply_to":"AAAAP3%2F%2F95k%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"29740c3985fb29cb66f7228ecb2552b0beda8833","unresolved":false,"context_lines":[{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        try:"},{"line_number":322,"context_line":"            self.mechanism_manager.create_port_postcommit(mech_context)"},{"line_number":323,"context_line":"        except Exception:"},{"line_number":324,"context_line":"            LOG.error(_(\"mechanism_manager.create_port failed, \""},{"line_number":325,"context_line":"                        \"deleting port \u0027%s\u0027\"), result[\u0027id\u0027])"},{"line_number":326,"context_line":"            self.delete_port(context, result[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F8w8%3D","line":323,"updated":"2013-07-08 17:54:40.000000000","message":"Same as above need to use excutils.save_and_reraise_exception()","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        try:"},{"line_number":322,"context_line":"            self.mechanism_manager.create_port_postcommit(mech_context)"},{"line_number":323,"context_line":"        except Exception:"},{"line_number":324,"context_line":"            LOG.error(_(\"mechanism_manager.create_port failed, \""},{"line_number":325,"context_line":"                        \"deleting port \u0027%s\u0027\"), result[\u0027id\u0027])"},{"line_number":326,"context_line":"            self.delete_port(context, result[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAP3%2F%2F5iw%3D","line":323,"in_reply_to":"AAAAP3%2F%2F8w8%3D","updated":"2013-07-09 15:30:43.000000000","message":"Done","commit_id":"adaa06b2838e21dd0397219ff20cc529f488696c"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"unresolved":false,"context_lines":[{"line_number":240,"context_line":"                original_network\u003doriginal_network)"},{"line_number":241,"context_line":"            self.mechanism_manager.update_network_precommit(mech_context)"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"        # TODO(apech) - handle errors raised by update_port, potentially"},{"line_number":244,"context_line":"        # by re-calling update_network with the previous attributes. For"},{"line_number":245,"context_line":"        # now the error is propogated to the caller, which is expected to"},{"line_number":246,"context_line":"        # either undo/retry the operation or delete the resource."}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAP3%2F%2F2cs%3D","line":243,"updated":"2013-07-10 12:55:17.000000000","message":"typo - change to update_network.\nIf this is the only comment then please go ahead w/ commit.","commit_id":"63dfd8356ff1feb922b17a6f54f3e9de8980de8f"}],"quantum/plugins/ml2/config.py":[{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"7b70fdce5e0b459db89eae5952e9eeed52d4f111","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                help\u003d_(\"List of networking mechanism driver entrypoints to \""},{"line_number":33,"context_line":"                       \"be loaded from the quantum.ml2.mechanism_drivers \""},{"line_number":34,"context_line":"                       \"namespace. Mechanism drivers are called in the order \""},{"line_number":35,"context_line":"                       \"in which they are listed\")),"},{"line_number":36,"context_line":"]"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FdIM%3D","line":35,"updated":"2013-07-01 19:18:21.000000000","message":"Minor nit: end sentence with a period.","commit_id":"a0ee6eaba63cc822cfcec2d9e89b2fe3c9b10166"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":32,"context_line":"                help\u003d_(\"List of networking mechanism driver entrypoints to \""},{"line_number":33,"context_line":"                       \"be loaded from the quantum.ml2.mechanism_drivers \""},{"line_number":34,"context_line":"                       \"namespace. Mechanism drivers are called in the order \""},{"line_number":35,"context_line":"                       \"in which they are listed\")),"},{"line_number":36,"context_line":"]"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FcT0%3D","line":35,"in_reply_to":"AAAAPn%2F%2FdIM%3D","updated":"2013-07-01 21:02:51.000000000","message":"Done","commit_id":"a0ee6eaba63cc822cfcec2d9e89b2fe3c9b10166"}],"quantum/plugins/ml2/driver_api.py":[{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"eda4282ccc2368a2108db64e40b1d3342f9b91ff","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"    @abstractmethod"},{"line_number":191,"context_line":"    def update_network_db(self, original_network, updated_network):"},{"line_number":192,"context_line":"        \"\"\"Update values of a network."},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        :param original_network: dictionary describing the state of"},{"line_number":195,"context_line":"        the network prior to the call to update_network. Data"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9OI%3D","line":192,"updated":"2013-06-17 14:23:15.000000000","message":"Comment needs to be updated for \"_db\" description.\nNeed description of \"updated_network\".","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"4dfabf1ea487143a7f064d8077ba0ab48a47c967","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"    @abstractmethod"},{"line_number":191,"context_line":"    def update_network_db(self, original_network, updated_network):"},{"line_number":192,"context_line":"        \"\"\"Update values of a network."},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        :param original_network: dictionary describing the state of"},{"line_number":195,"context_line":"        the network prior to the call to update_network. Data"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9EI%3D","line":192,"in_reply_to":"AAAAPn%2F%2F9OI%3D","updated":"2013-06-17 14:34:19.000000000","message":"Thanks - fixed all one-line descriptions to be unique (rest of the comment bodies were right).","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"eda4282ccc2368a2108db64e40b1d3342f9b91ff","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        pass"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    @abstractmethod"},{"line_number":212,"context_line":"    def update_network(self, original_network, updated_network):"},{"line_number":213,"context_line":"        \"\"\"Update values of a network."},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        :param original_network: dictionary describing the state of"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9N0%3D","line":212,"updated":"2013-06-17 14:23:15.000000000","message":"Need description of \"updated_network\".","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"4dfabf1ea487143a7f064d8077ba0ab48a47c967","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        pass"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    @abstractmethod"},{"line_number":212,"context_line":"    def update_network(self, original_network, updated_network):"},{"line_number":213,"context_line":"        \"\"\"Update values of a network."},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        :param original_network: dictionary describing the state of"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9EE%3D","line":212,"in_reply_to":"AAAAPn%2F%2F9N0%3D","updated":"2013-06-17 14:34:19.000000000","message":"Done","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"eda4282ccc2368a2108db64e40b1d3342f9b91ff","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        pass"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"    @abstractmethod"},{"line_number":292,"context_line":"    def update_port_db(self, original_port, updated_port):"},{"line_number":293,"context_line":"        \"\"\"Update values of a port."},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        :param original_port: dictionary describing the state of"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9Nk%3D","line":292,"updated":"2013-06-17 14:23:15.000000000","message":"Comment needs to be updated for \"_db\" description.","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"4dfabf1ea487143a7f064d8077ba0ab48a47c967","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        pass"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"    @abstractmethod"},{"line_number":292,"context_line":"    def update_port_db(self, original_port, updated_port):"},{"line_number":293,"context_line":"        \"\"\"Update values of a port."},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        :param original_port: dictionary describing the state of"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9EA%3D","line":292,"in_reply_to":"AAAAPn%2F%2F9Nk%3D","updated":"2013-06-17 14:34:19.000000000","message":"Done","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"eda4282ccc2368a2108db64e40b1d3342f9b91ff","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        pass"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"    @abstractmethod"},{"line_number":332,"context_line":"    def delete_port_db(self, port_id):"},{"line_number":333,"context_line":"        \"\"\"Delete a port."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        :param port: dictionary describing the current state of the"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9Ng%3D","line":332,"updated":"2013-06-17 14:23:15.000000000","message":"Comment needs to be updated for \"_db\" description.","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"4dfabf1ea487143a7f064d8077ba0ab48a47c967","unresolved":false,"context_lines":[{"line_number":329,"context_line":"        pass"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"    @abstractmethod"},{"line_number":332,"context_line":"    def delete_port_db(self, port_id):"},{"line_number":333,"context_line":"        \"\"\"Delete a port."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        :param port: dictionary describing the current state of the"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9D8%3D","line":332,"in_reply_to":"AAAAPn%2F%2F9Ng%3D","updated":"2013-06-17 14:34:19.000000000","message":"Done","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"eda4282ccc2368a2108db64e40b1d3342f9b91ff","unresolved":false,"context_lines":[{"line_number":332,"context_line":"    def delete_port_db(self, port_id):"},{"line_number":333,"context_line":"        \"\"\"Delete a port."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        :param port: dictionary describing the current state of the"},{"line_number":336,"context_line":"        port, prior to the call to delete it. Data structure is"},{"line_number":337,"context_line":"        defined by QuantumPluginBaseV2.create_port, and all"},{"line_number":338,"context_line":"        extensions in the ml2 plugin."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9NQ%3D","line":335,"updated":"2013-06-17 14:23:15.000000000","message":"Typo. Rename port -\u003e port_id","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"4dfabf1ea487143a7f064d8077ba0ab48a47c967","unresolved":false,"context_lines":[{"line_number":332,"context_line":"    def delete_port_db(self, port_id):"},{"line_number":333,"context_line":"        \"\"\"Delete a port."},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"        :param port: dictionary describing the current state of the"},{"line_number":336,"context_line":"        port, prior to the call to delete it. Data structure is"},{"line_number":337,"context_line":"        defined by QuantumPluginBaseV2.create_port, and all"},{"line_number":338,"context_line":"        extensions in the ml2 plugin."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9C8%3D","line":335,"in_reply_to":"AAAAPn%2F%2F9NQ%3D","updated":"2013-06-17 14:34:19.000000000","message":"Actually, I changed the parameter from port_id to port (and clearly forgot to update this parameter name). The thinking is that delete_port_db and delete_port may need the full information of what state the port was in, as at the point these methods are called there\u0027s no way for it to figure it out itself (the info is deleted from the database already). The id is of course still available within the port dict. Same change was made for delete_network_db and delete_network.","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"eda4282ccc2368a2108db64e40b1d3342f9b91ff","unresolved":false,"context_lines":[{"line_number":347,"context_line":"    def delete_port(self, port_id):"},{"line_number":348,"context_line":"        \"\"\"Delete a port."},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        :param port: dictionary describing the current state of the"},{"line_number":351,"context_line":"        port, prior to the call to delete it. Data structure is"},{"line_number":352,"context_line":"        defined by QuantumPluginBaseV2.create_port, and all"},{"line_number":353,"context_line":"        extensions in the ml2 plugin."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9NM%3D","line":350,"updated":"2013-06-17 14:23:15.000000000","message":"Typo. Rename port -\u003e port_id","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"4dfabf1ea487143a7f064d8077ba0ab48a47c967","unresolved":false,"context_lines":[{"line_number":347,"context_line":"    def delete_port(self, port_id):"},{"line_number":348,"context_line":"        \"\"\"Delete a port."},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        :param port: dictionary describing the current state of the"},{"line_number":351,"context_line":"        port, prior to the call to delete it. Data structure is"},{"line_number":352,"context_line":"        defined by QuantumPluginBaseV2.create_port, and all"},{"line_number":353,"context_line":"        extensions in the ml2 plugin."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9C0%3D","line":350,"in_reply_to":"AAAAPn%2F%2F9NM%3D","updated":"2013-06-17 14:34:19.000000000","message":"Same, fixed","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7916,"name":"Luke Gorrie","email":"luke@snabb.co","username":"lukego"},"unresolved":false,"context_lines":[{"line_number":132,"context_line":"    \"\"\"Define stable abstract interface for ML2 mechanism drivers."},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    A mechanism driver is called on the creation, update, and deletion"},{"line_number":135,"context_line":"    of networks and ports. For every event, there are two methods that"},{"line_number":136,"context_line":"    get called - one within the database transaction (method suffix of"},{"line_number":137,"context_line":"    _db), one right afterwards."},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2F4QM%3D","line":135,"updated":"2013-06-19 08:07:39.000000000","message":"I would like to have callbacks for all the major OpenStack Networking database objects in my initial mechanism driver. Particularly, subnets and routers in addition to networks and ports.\n\nThe API initially supports only networks and ports. Should we simply add analogous callback functions for each other kind of object?\n\nIn that case there\u0027s a bit of a risk of combinatorial explosion in the number of functions in the API, with names like:\n    {create,update,delete}_{port,network,subnet,router,...}_{async,postcommit,bulk,...}\n\nSo it could be worth considering replacing e.g. update_network(...) and update_port(...) with simply update(what, ...) so that the functions in the API can remain stable while the arguments are extended.","commit_id":"4d69aaa0f4fd4981b0043f855fa45053cc1d2870"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"1145f7a5123c33acb2615230adf17f50526530db","unresolved":false,"context_lines":[{"line_number":132,"context_line":"    \"\"\"Define stable abstract interface for ML2 mechanism drivers."},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    A mechanism driver is called on the creation, update, and deletion"},{"line_number":135,"context_line":"    of networks and ports. For every event, there are two methods that"},{"line_number":136,"context_line":"    get called - one within the database transaction (method suffix of"},{"line_number":137,"context_line":"    _db), one right afterwards."},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2FzXo%3D","line":135,"in_reply_to":"AAAAPn%2F%2F4QM%3D","updated":"2013-06-20 21:28:52.000000000","message":"I like Luke\u0027s suggestion here, this seems like a more scalable way forward.","commit_id":"4d69aaa0f4fd4981b0043f855fa45053cc1d2870"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":132,"context_line":"    \"\"\"Define stable abstract interface for ML2 mechanism drivers."},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    A mechanism driver is called on the creation, update, and deletion"},{"line_number":135,"context_line":"    of networks and ports. For every event, there are two methods that"},{"line_number":136,"context_line":"    get called - one within the database transaction (method suffix of"},{"line_number":137,"context_line":"    _db), one right afterwards."},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2FvZM%3D","line":135,"in_reply_to":"AAAAPn%2F%2FzXo%3D","updated":"2013-06-23 16:08:59.000000000","message":"I have to disagree. The context passed for every resource change will be different, so it is not possible to handle every resource in a generic way. For every resource that can change, the mechanism driver either cares or it doesn\u0027t. In the case where you have separate methods for each resource, a new resource can be added without existing mechanism drivers caring. In the case where you have a single \"update\" method, the mechanism driver is now getting called with parameters it was never tested against.\n\nFurthermore, with a single mechanism driver, you\u0027d end up with an implementation that looks like:\n\ndef update( self, what, context ):\n   if what \u003d\u003d \"port\":\n      # do whatever it is you do for ports\n   elif what \u003d\u003d \"network\":\n     # do whatever it is you do for networks\n\netc. Aside from being ugly code, the most likely thing that implementations will do is push the per-resource actions into helper methods for clarity and code cleanliness. At that point the MechanismDriver might as well expose per-resource methods in the first place.","commit_id":"4d69aaa0f4fd4981b0043f855fa45053cc1d2870"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"7b70fdce5e0b459db89eae5952e9eeed52d4f111","unresolved":false,"context_lines":[{"line_number":141,"context_line":"class NetworkContext(MechanismDriverContext):"},{"line_number":142,"context_line":"    \"\"\"Context passed to MechanismDrivers for changes to network resources."},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    A NetworkContext instance wraps a port dictionary, as defined by"},{"line_number":145,"context_line":"    QuantumPluginBaseV2.create_network and all extensions in the ml2"},{"line_number":146,"context_line":"    plugin. It also provides helper methods for accessing other"},{"line_number":147,"context_line":"    relevant information. Results from expensive operations are cached"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FctM%3D","line":144,"updated":"2013-07-01 19:18:21.000000000","message":"I think you mean \"wraps a network dictionary\" not \"wraps a port dictionary\".","commit_id":"a0ee6eaba63cc822cfcec2d9e89b2fe3c9b10166"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":141,"context_line":"class NetworkContext(MechanismDriverContext):"},{"line_number":142,"context_line":"    \"\"\"Context passed to MechanismDrivers for changes to network resources."},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    A NetworkContext instance wraps a port dictionary, as defined by"},{"line_number":145,"context_line":"    QuantumPluginBaseV2.create_network and all extensions in the ml2"},{"line_number":146,"context_line":"    plugin. It also provides helper methods for accessing other"},{"line_number":147,"context_line":"    relevant information. Results from expensive operations are cached"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FcTw%3D","line":144,"in_reply_to":"AAAAPn%2F%2FctM%3D","updated":"2013-07-01 21:02:51.000000000","message":"Done","commit_id":"a0ee6eaba63cc822cfcec2d9e89b2fe3c9b10166"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"7b70fdce5e0b459db89eae5952e9eeed52d4f111","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    \"\"\""},{"line_number":151,"context_line":"    def __init__(self, plugin, plugin_context, network, segments\u003dNone):"},{"line_number":152,"context_line":"        super(NetworkContext, self).__init__(plugin, plugin_context)"},{"line_number":153,"context_line":"        self.network \u003d network"},{"line_number":154,"context_line":"        self._segments \u003d segments"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def get_network_segments(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FcqY%3D","line":153,"updated":"2013-07-01 19:18:21.000000000","message":"I\u0027m thinking it might be worth accessing the dictionaries and other data via functions rather than as public data members. This would help isolate drivers from implementation details of the core and plugin that could change. Dictionaries could be created on-demand if needed for backward compatibility for instance, or adjusted based on driver API versions. It might even be worth making the Context classes abstract, so drivers cannot depend on implementation details. Thoughts?","commit_id":"a0ee6eaba63cc822cfcec2d9e89b2fe3c9b10166"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":150,"context_line":"    \"\"\""},{"line_number":151,"context_line":"    def __init__(self, plugin, plugin_context, network, segments\u003dNone):"},{"line_number":152,"context_line":"        super(NetworkContext, self).__init__(plugin, plugin_context)"},{"line_number":153,"context_line":"        self.network \u003d network"},{"line_number":154,"context_line":"        self._segments \u003d segments"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def get_network_segments(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FcS0%3D","line":153,"in_reply_to":"AAAAPn%2F%2FcqY%3D","updated":"2013-07-01 21:02:51.000000000","message":"Yes, like the idea of forcing everything through methods for compatibility reasons, will change make this private and add a \u0027get_network\u0027 method.\n\nIn terms of hiding the implementation further, I\u0027m fine with keeping the abstract Context classes here and moving the implementation to a new file. Of course it is python so it\u0027s hard to really prevent this :) Unless you have a better idea, I\u0027ll create driver.py (in keeping with the driver_api.py naming). Let me know if you\u0027d rather see it elsewhere.","commit_id":"a0ee6eaba63cc822cfcec2d9e89b2fe3c9b10166"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"7b70fdce5e0b459db89eae5952e9eeed52d4f111","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        :param original_network: dictionary describing the state of"},{"line_number":259,"context_line":"        the network prior to the call to update_network. Data"},{"line_number":260,"context_line":"        structure is defined by QuantumPluginBaseV2.create_network,"},{"line_number":261,"context_line":"        and all extensions in the ml2 plugin."},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        Update values of a network, updating the associated resources"},{"line_number":264,"context_line":"        in the database. Called inside transaction context on session."}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FcpE%3D","line":261,"updated":"2013-07-01 19:18:21.000000000","message":"Should original_network be accessed via NetworkContext.get_original_network()?","commit_id":"a0ee6eaba63cc822cfcec2d9e89b2fe3c9b10166"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":258,"context_line":"        :param original_network: dictionary describing the state of"},{"line_number":259,"context_line":"        the network prior to the call to update_network. Data"},{"line_number":260,"context_line":"        structure is defined by QuantumPluginBaseV2.create_network,"},{"line_number":261,"context_line":"        and all extensions in the ml2 plugin."},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        Update values of a network, updating the associated resources"},{"line_number":264,"context_line":"        in the database. Called inside transaction context on session."}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FcTA%3D","line":261,"in_reply_to":"AAAAPn%2F%2FcpE%3D","updated":"2013-07-01 21:02:51.000000000","message":"I went back and forth on this one. The reason I kept it separate is that including it would mean that some methods of NetworkContext (ie get_original_network) would only be valid under certain circumstances (ie only when we\u0027re in an update call). At this point all methods are always valid, though we only have a minimal set of methods, so I\u0027m not sure this is a great argument. I do like having a single context argument passed to each method (especially for the versioning/compatibility reasons you bring up), let me revisit this.","commit_id":"a0ee6eaba63cc822cfcec2d9e89b2fe3c9b10166"}],"quantum/plugins/ml2/drivers/mechanism_test.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAPn%2F%2FS3g%3D","line":1,"updated":"2013-07-04 18:09:02.000000000","message":"does test file has to be in plugins/ directory?","commit_id":"49bcd0b894b9434b171df78c1d63307a70b8d433"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAP3%2F%2F%2FKE%3D","line":1,"in_reply_to":"AAAAPn%2F%2FS3g%3D","updated":"2013-07-07 19:56:48.000000000","message":"Moved under neutron/tests","commit_id":"49bcd0b894b9434b171df78c1d63307a70b8d433"}],"quantum/plugins/ml2/managers.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c1b28ae92318807531645bcf0a8ce0b513a86fdb","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        LOG.info(_(\"Loaded mechanism driver names: %s\"), self.names())"},{"line_number":130,"context_line":"        self._register_mechanisms()"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def _register_mechanisms(self):"},{"line_number":133,"context_line":"        for ext in self:"},{"line_number":134,"context_line":"            if ext in self.drivers:"},{"line_number":135,"context_line":"                LOG.error(_(\"Mechansim driver \u0027%s\u0027 ignored because\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9Y0%3D","line":132,"updated":"2013-06-17 12:36:40.000000000","message":"Is the expectation that this will only be called once?","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"97aece18766a7261bc8e47cbe20476300aac6009","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        LOG.info(_(\"Loaded mechanism driver names: %s\"), self.names())"},{"line_number":130,"context_line":"        self._register_mechanisms()"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def _register_mechanisms(self):"},{"line_number":133,"context_line":"        for ext in self:"},{"line_number":134,"context_line":"            if ext in self.drivers:"},{"line_number":135,"context_line":"                LOG.error(_(\"Mechansim driver \u0027%s\u0027 ignored because\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9G8%3D","line":132,"in_reply_to":"AAAAPn%2F%2F9Y0%3D","updated":"2013-06-17 14:17:44.000000000","message":"Yes - I added a comment to clarify","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c1b28ae92318807531645bcf0a8ce0b513a86fdb","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        self._register_mechanisms()"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def _register_mechanisms(self):"},{"line_number":133,"context_line":"        for ext in self:"},{"line_number":134,"context_line":"            if ext in self.drivers:"},{"line_number":135,"context_line":"                LOG.error(_(\"Mechansim driver \u0027%s\u0027 ignored because\""},{"line_number":136,"context_line":"                            \" driver is already registered\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9Yg%3D","line":133,"updated":"2013-06-17 12:36:40.000000000","message":"Guess I don\u0027t understand this line. Is MechanismManager an iterable? What will this extract from it (I don\u0027t have code for the parent class)?","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"97aece18766a7261bc8e47cbe20476300aac6009","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        self._register_mechanisms()"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def _register_mechanisms(self):"},{"line_number":133,"context_line":"        for ext in self:"},{"line_number":134,"context_line":"            if ext in self.drivers:"},{"line_number":135,"context_line":"                LOG.error(_(\"Mechansim driver \u0027%s\u0027 ignored because\""},{"line_number":136,"context_line":"                            \" driver is already registered\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9G0%3D","line":133,"in_reply_to":"AAAAPn%2F%2F9Yg%3D","updated":"2013-06-17 14:17:44.000000000","message":"Yes - see the definition of stevedore.named.NamedExtensionManager. The class itself is an iterable, returning instances for each item defined in cfg.CONF.ml2.mechanism_drivers.","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c1b28ae92318807531645bcf0a8ce0b513a86fdb","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            try:"},{"line_number":199,"context_line":"                driver.obj.update_network(original_network, updated_network)"},{"line_number":200,"context_line":"            except Exception as e:"},{"line_number":201,"context_line":"                LOG.error(_(\"Mechansim driver \u0027%(name)s\u0027 failed in\""},{"line_number":202,"context_line":"                            \"update_network with error \u0027%(error)s\u0027\"),"},{"line_number":203,"context_line":"                          {\u0027name\u0027: driver.name,"},{"line_number":204,"context_line":"                           \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9bM%3D","line":201,"updated":"2013-06-17 12:36:40.000000000","message":"add space at end of line.  Same issue in each of the following funtions\u0027 LOG message too.","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"97aece18766a7261bc8e47cbe20476300aac6009","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            try:"},{"line_number":199,"context_line":"                driver.obj.update_network(original_network, updated_network)"},{"line_number":200,"context_line":"            except Exception as e:"},{"line_number":201,"context_line":"                LOG.error(_(\"Mechansim driver \u0027%(name)s\u0027 failed in\""},{"line_number":202,"context_line":"                            \"update_network with error \u0027%(error)s\u0027\"),"},{"line_number":203,"context_line":"                          {\u0027name\u0027: driver.name,"},{"line_number":204,"context_line":"                           \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9Gw%3D","line":201,"in_reply_to":"AAAAPn%2F%2F9bM%3D","updated":"2013-06-17 14:17:44.000000000","message":"Done","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"1145f7a5123c33acb2615230adf17f50526530db","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    # List of registered mechanism drivers. Drivers are called in the"},{"line_number":116,"context_line":"    # order listed."},{"line_number":117,"context_line":"    drivers \u003d []"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def __init__(self):"},{"line_number":120,"context_line":"        # REVISIT(rkukura): Need way to make stevedore use our logging"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2FzXM%3D","line":117,"updated":"2013-06-20 21:28:52.000000000","message":"Nit: May make sense to call this \"mech_drivers\" instead of just drivers, or something similar.","commit_id":"4d69aaa0f4fd4981b0043f855fa45053cc1d2870"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    # List of registered mechanism drivers. Drivers are called in the"},{"line_number":116,"context_line":"    # order listed."},{"line_number":117,"context_line":"    drivers \u003d []"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def __init__(self):"},{"line_number":120,"context_line":"        # REVISIT(rkukura): Need way to make stevedore use our logging"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2FvZI%3D","line":117,"in_reply_to":"AAAAPn%2F%2FzXM%3D","updated":"2013-06-23 16:08:59.000000000","message":"Sure, that\u0027s fine with me. I was following the TypeManager class above. Should we change that to \"type_drivers\"?","commit_id":"4d69aaa0f4fd4981b0043f855fa45053cc1d2870"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"unresolved":false,"context_lines":[{"line_number":172,"context_line":"        cleanup. There is no guarantee that all mechanism drivers are"},{"line_number":173,"context_line":"        called in this case."},{"line_number":174,"context_line":"        \"\"\""},{"line_number":175,"context_line":"        for driver in self.mech_drivers:"},{"line_number":176,"context_line":"            driver.obj.create_network_postcommit(context)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    def update_network_precommit(self, context):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAPn%2F%2FaOo%3D","line":175,"updated":"2013-07-02 14:55:05.000000000","message":"Should we be catching errors from underlying drivers here with a \"try\" loop as we do in other _postcommit operations?","commit_id":"a4cd238e18d0076aa18a21301b16d8fb80ce43c6"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"unresolved":false,"context_lines":[{"line_number":262,"context_line":"        cleanup. There is no guarantee that all mechanism drivers are"},{"line_number":263,"context_line":"        called in this case."},{"line_number":264,"context_line":"        \"\"\""},{"line_number":265,"context_line":"        for driver in self.mech_drivers:"},{"line_number":266,"context_line":"            driver.obj.create_port_postcommit(context)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"    def update_port_precommit(self, context):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAPn%2F%2FaOY%3D","line":265,"updated":"2013-07-02 14:55:05.000000000","message":"Same thing here, it\u0027s possible for create_port to fail, we should probably use a \"try\" loop similar to other _postcommit operations.","commit_id":"a4cd238e18d0076aa18a21301b16d8fb80ce43c6"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"unresolved":false,"context_lines":[{"line_number":153,"context_line":"            driver.obj.initialize()"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def create_network_precommit(self, context):"},{"line_number":156,"context_line":"        \"\"\"Notify all mechansim drivers of a network creation"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Called within the database transaction. Errors raised by"},{"line_number":159,"context_line":"        mechanism drivers are left to propogate to the caller,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAPn%2F%2FW2E%3D","line":156,"updated":"2013-07-03 12:57:21.000000000","message":"period at end of sentence.","commit_id":"67166e0ce3e6a1d2d1a02bd76e316cbf534b7f9a"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"unresolved":false,"context_lines":[{"line_number":166,"context_line":"    def create_network_postcommit(self, context):"},{"line_number":167,"context_line":"        \"\"\"Notify all mechansim drivers of network creation."},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        Called after the database transaction. Errors raised by"},{"line_number":170,"context_line":"        mechanism drivers are left to propogate to the caller, where"},{"line_number":171,"context_line":"        the network will be deleted, triggering any required"},{"line_number":172,"context_line":"        cleanup. There is no guarantee that all mechanism drivers are"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAPn%2F%2FW1U%3D","line":169,"updated":"2013-07-03 12:57:21.000000000","message":"I noticed some inconsistencies that in some method comment headers you describe exceptions specifically (i.e. \":raises: ...\".\nIn some methods (that execute raise) you don\u0027t.\nNot sure if you were doing that on purpose.","commit_id":"67166e0ce3e6a1d2d1a02bd76e316cbf534b7f9a"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":227,"context_line":"        if error:"},{"line_number":228,"context_line":"            # Notify the caller that an error occurred while calling"},{"line_number":229,"context_line":"            # the mechanism drivers."},{"line_number":230,"context_line":"            raise exc.Error(\"update_network_postcommit failed\")"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def delete_network_precommit(self, context):"},{"line_number":233,"context_line":"        \"\"\"Notify all mechansim drivers of a network deletion."}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAPn%2F%2FWaM%3D","line":230,"updated":"2013-07-03 14:48:05.000000000","message":"In the cases where we are raising an error, should there be ML2 specific exceptions defined?","commit_id":"2b41c74ff3cd9486ed50d8267b2d00b72b9d1430"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":260,"context_line":"            try:"},{"line_number":261,"context_line":"                driver.obj.delete_network_postcommit(context)"},{"line_number":262,"context_line":"            except Exception as e:"},{"line_number":263,"context_line":"                LOG.error(_(\"Mechansim driver \u0027%(name)s\u0027 failed in\""},{"line_number":264,"context_line":"                            \" delete_network_postcommit with error\""},{"line_number":265,"context_line":"                            \" \u0027%(error)s\u0027\"),"},{"line_number":266,"context_line":"                          {\u0027name\u0027: driver.name,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAPn%2F%2FWaI%3D","line":263,"updated":"2013-07-03 14:48:05.000000000","message":"Typo: Mechanism","commit_id":"2b41c74ff3cd9486ed50d8267b2d00b72b9d1430"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":267,"context_line":"                            \" \u0027%(error)s\u0027\"),"},{"line_number":268,"context_line":"                          {\u0027name\u0027: driver.name,"},{"line_number":269,"context_line":"                           \u0027error\u0027: e})"},{"line_number":270,"context_line":"        if error:"},{"line_number":271,"context_line":"            # Notify the caller that an error occurred while calling"},{"line_number":272,"context_line":"            # the mechanism drivers."},{"line_number":273,"context_line":"            raise ml2_exc.MechanismDriverError("}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAPn%2F%2FS24%3D","line":270,"updated":"2013-07-04 18:09:02.000000000","message":"error is never set to True","commit_id":"49bcd0b894b9434b171df78c1d63307a70b8d433"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":267,"context_line":"                            \" \u0027%(error)s\u0027\"),"},{"line_number":268,"context_line":"                          {\u0027name\u0027: driver.name,"},{"line_number":269,"context_line":"                           \u0027error\u0027: e})"},{"line_number":270,"context_line":"        if error:"},{"line_number":271,"context_line":"            # Notify the caller that an error occurred while calling"},{"line_number":272,"context_line":"            # the mechanism drivers."},{"line_number":273,"context_line":"            raise ml2_exc.MechanismDriverError("}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAP3%2F%2F%2FKA%3D","line":270,"in_reply_to":"AAAAPn%2F%2FS24%3D","updated":"2013-07-07 19:56:48.000000000","message":"Done","commit_id":"49bcd0b894b9434b171df78c1d63307a70b8d433"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":381,"context_line":"                driver.obj.delete_port_postcommit(context)"},{"line_number":382,"context_line":"            except Exception as e:"},{"line_number":383,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in\""},{"line_number":384,"context_line":"                            \" delete_port_postcommit with error \u0027%(error)s\u0027\"),"},{"line_number":385,"context_line":"                          {\u0027name\u0027: driver.name,"},{"line_number":386,"context_line":"                           \u0027error\u0027: e})"},{"line_number":387,"context_line":"                error \u003d True"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAPn%2F%2FS2s%3D","line":384,"updated":"2013-07-04 18:09:02.000000000","message":"nit: add space on previous line and delete on this line","commit_id":"49bcd0b894b9434b171df78c1d63307a70b8d433"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":381,"context_line":"                driver.obj.delete_port_postcommit(context)"},{"line_number":382,"context_line":"            except Exception as e:"},{"line_number":383,"context_line":"                LOG.error(_(\"Mechanism driver \u0027%(name)s\u0027 failed in\""},{"line_number":384,"context_line":"                            \" delete_port_postcommit with error \u0027%(error)s\u0027\"),"},{"line_number":385,"context_line":"                          {\u0027name\u0027: driver.name,"},{"line_number":386,"context_line":"                           \u0027error\u0027: e})"},{"line_number":387,"context_line":"                error \u003d True"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAP3%2F%2F%2FJ8%3D","line":384,"in_reply_to":"AAAAPn%2F%2FS2s%3D","updated":"2013-07-07 19:56:48.000000000","message":"Done","commit_id":"49bcd0b894b9434b171df78c1d63307a70b8d433"}],"quantum/plugins/ml2/plugin.py":[{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"e43cda48ca376934c4fe26744199e748c2084108","unresolved":false,"context_lines":[{"line_number":307,"context_line":"                                                         result)"},{"line_number":308,"context_line":"            self._process_port_create_security_group(context, result, sgids)"},{"line_number":309,"context_line":"            self._extend_port_dict_binding(context, result)"},{"line_number":310,"context_line":"            self.mechanism_manager.create_port(result)"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"        try:"},{"line_number":313,"context_line":"            self.mechanism_manager.create_port(result)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9gQ%3D","line":310,"updated":"2013-06-17 11:21:54.000000000","message":"it probably should call create_port_db","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"97aece18766a7261bc8e47cbe20476300aac6009","unresolved":false,"context_lines":[{"line_number":307,"context_line":"                                                         result)"},{"line_number":308,"context_line":"            self._process_port_create_security_group(context, result, sgids)"},{"line_number":309,"context_line":"            self._extend_port_dict_binding(context, result)"},{"line_number":310,"context_line":"            self.mechanism_manager.create_port(result)"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"        try:"},{"line_number":313,"context_line":"            self.mechanism_manager.create_port(result)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9Gs%3D","line":310,"in_reply_to":"AAAAPn%2F%2F9gQ%3D","updated":"2013-06-17 14:17:44.000000000","message":"Ugh, thanks.\n\nDone","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"e43cda48ca376934c4fe26744199e748c2084108","unresolved":false,"context_lines":[{"line_number":335,"context_line":"                                                         attrs,"},{"line_number":336,"context_line":"                                                         updated_port)"},{"line_number":337,"context_line":"            self._extend_port_dict_binding(context, updated_port)"},{"line_number":338,"context_line":"            self.mechanism_manager.update_port(original_port, updated_port)"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"        # TODO(apech) - handle errors raised by update_port - want to"},{"line_number":341,"context_line":"        # complete Ml2Plugin.update_port as if no error occurred, but"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9gI%3D","line":338,"updated":"2013-06-17 11:21:54.000000000","message":"should be call to update_port_db","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"97aece18766a7261bc8e47cbe20476300aac6009","unresolved":false,"context_lines":[{"line_number":335,"context_line":"                                                         attrs,"},{"line_number":336,"context_line":"                                                         updated_port)"},{"line_number":337,"context_line":"            self._extend_port_dict_binding(context, updated_port)"},{"line_number":338,"context_line":"            self.mechanism_manager.update_port(original_port, updated_port)"},{"line_number":339,"context_line":""},{"line_number":340,"context_line":"        # TODO(apech) - handle errors raised by update_port - want to"},{"line_number":341,"context_line":"        # complete Ml2Plugin.update_port as if no error occurred, but"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9Go%3D","line":338,"in_reply_to":"AAAAPn%2F%2F9gI%3D","updated":"2013-06-17 14:17:44.000000000","message":"Done","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"e43cda48ca376934c4fe26744199e748c2084108","unresolved":false,"context_lines":[{"line_number":385,"context_line":"            port \u003d self.get_port(context, id)"},{"line_number":386,"context_line":"            self._delete_port_security_group_bindings(context, id)"},{"line_number":387,"context_line":"            super(Ml2Plugin, self).delete_port(context, id)"},{"line_number":388,"context_line":"            self.mechanism_manager.delete_port(port)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"        self.mechanism_manager.delete_port(port)"},{"line_number":391,"context_line":"        self.notify_security_groups_member_updated(context, port)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9gE%3D","line":388,"updated":"2013-06-17 11:21:54.000000000","message":"delete_port_db?","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"change_message_id":"97aece18766a7261bc8e47cbe20476300aac6009","unresolved":false,"context_lines":[{"line_number":385,"context_line":"            port \u003d self.get_port(context, id)"},{"line_number":386,"context_line":"            self._delete_port_security_group_bindings(context, id)"},{"line_number":387,"context_line":"            super(Ml2Plugin, self).delete_port(context, id)"},{"line_number":388,"context_line":"            self.mechanism_manager.delete_port(port)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"        self.mechanism_manager.delete_port(port)"},{"line_number":391,"context_line":"        self.notify_security_groups_member_updated(context, port)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPn%2F%2F9Gk%3D","line":388,"in_reply_to":"AAAAPn%2F%2F9gE%3D","updated":"2013-06-17 14:17:44.000000000","message":"Done","commit_id":"053f0840bbc63428f74a5e8fb21320acfcab4c6d"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"e6246083cdbd488a5910acd0cc4fb1c83e44b845","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        # TODO(rkukura): Implement filtering."},{"line_number":164,"context_line":"        return nets"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _extend_network_dict_segment(self, context, network):"},{"line_number":167,"context_line":"        id \u003d network[\u0027id\u0027]"},{"line_number":168,"context_line":"        segments \u003d db.get_network_segments(context.session, id)"},{"line_number":169,"context_line":"        network[\u0027segments\u0027] \u003d segments"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2F8HE%3D","line":166,"updated":"2013-06-17 20:44:43.000000000","message":"I\u0027m unsure whether using the network dict is the best short-term approach for passing the segment list to the MechanismDrivers. I\u0027m assuming that the API mechanism will not expose these to clients as attributes without additional work - that will be handled via another BP, possibly using a new segment resource type. But AFAIK, most or all items currently added to dictionaries in functions like this are intended to be part of the client API, so this approach could lead to confusion. Why not simply pass the segment list to the MechanismDriver methods as a separate parameter?\n\nAs an alternative to using either the network dict or a separate parameter, I wonder if we should define and instantiate a context class that gets passed to the driver methods. We can then extend this context class as needed without breaking existing drivers. We can also use the context class to defer potentially expensive operations (like db.get_network_segments()) until some driver asks for that item, and cache it in case other drivers ask for it. Any thoughts on this approach?","commit_id":"4d69aaa0f4fd4981b0043f855fa45053cc1d2870"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":163,"context_line":"        # TODO(rkukura): Implement filtering."},{"line_number":164,"context_line":"        return nets"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def _extend_network_dict_segment(self, context, network):"},{"line_number":167,"context_line":"        id \u003d network[\u0027id\u0027]"},{"line_number":168,"context_line":"        segments \u003d db.get_network_segments(context.session, id)"},{"line_number":169,"context_line":"        network[\u0027segments\u0027] \u003d segments"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2FvY8%3D","line":166,"in_reply_to":"AAAAPn%2F%2F8HE%3D","updated":"2013-06-23 16:08:59.000000000","message":"Changed MechanismDrivers to take a context instead.\n\nOne question on the context that I\u0027ll raised here is what to do about passing in the previous state of the resource (in the case of an update call). Right now I\u0027m still passing in the old resource dict separate from the context, as it felt ugly to have the context expose this, given that it isn\u0027t always set. In an ideal world you could see the full state (not just the resource) of the world previous to the change within the mechanism driver, but this would impose a cost on every mechanism driver to capture that full state prior to updating anything, which doesn\u0027t seem worth it. Appreciate your thoughts here.","commit_id":"4d69aaa0f4fd4981b0043f855fa45053cc1d2870"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        return [self._fields(net, fields) for net in nets]"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    def delete_network(self, context, id):"},{"line_number":283,"context_line":"        session \u003d context.session"},{"line_number":284,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":285,"context_line":"            network \u003d self.get_network(context, id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2F87U%3D","line":282,"updated":"2013-06-17 15:07:32.000000000","message":"For the delete methods (network/port), should the database delete  call be done after the manager delete call? Essentially in the reverse of create?","commit_id":"4d69aaa0f4fd4981b0043f855fa45053cc1d2870"},{"author":{"_account_id":7712,"name":"Andre Pech","email":"apech@aristanetworks.com","username":"apech"},"unresolved":false,"context_lines":[{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        return [self._fields(net, fields) for net in nets]"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    def delete_network(self, context, id):"},{"line_number":283,"context_line":"        session \u003d context.session"},{"line_number":284,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":285,"context_line":"            network \u003d self.get_network(context, id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2F8Cw%3D","line":282,"in_reply_to":"AAAAPn%2F%2F87U%3D","updated":"2013-06-23 16:08:59.000000000","message":"I had asked this question myself, and swore I had convinced myself that I was following the model that was there, but now that I look again you\u0027re right that we should be unwinding the reverse order. I\u0027ll fix this and the delete_port case.","commit_id":"4d69aaa0f4fd4981b0043f855fa45053cc1d2870"}]}
