)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"43656cd1fd9b2bfe26c09e8adf898c68a2eab797","unresolved":false,"context_lines":[{"line_number":32,"context_line":"are tuned, n/ws are deleted, and service gets restarted the"},{"line_number":33,"context_line":"orphaned driver list eventually becomes empty."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"DocImpact"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Change-Id: If08b304a9388058003d9f86f58295c6b5daef846"},{"line_number":38,"context_line":"Closes-Bug: 1311470"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a740942_c8515a64","line":35,"updated":"2015-12-04 01:13:04.000000000","message":"Please follow guidelines as detailed here:\n\nhttp://lists.openstack.org/pipermail/openstack-dev/2015-November/080294.html","commit_id":"ac680e709062d4410ba7f79f5bbaca1d295059af"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"fbaae46f1f03b8fc2c4d612aa58aa4541b0a8d4a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"are tuned, n/ws are deleted, and service gets restarted the"},{"line_number":33,"context_line":"orphaned driver list eventually becomes empty."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"DocImpact"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Change-Id: If08b304a9388058003d9f86f58295c6b5daef846"},{"line_number":38,"context_line":"Closes-Bug: 1311470"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a740942_8f9ee354","line":35,"in_reply_to":"7a740942_c8515a64","updated":"2015-12-04 11:48:16.000000000","message":"Done. Updated commit message to be more consistent with the latest changes.","commit_id":"ac680e709062d4410ba7f79f5bbaca1d295059af"}],"neutron/plugins/ml2/config.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"5de194da1e10c2334ecca4102957eadd023a4f3a","unresolved":false,"context_lines":[{"line_number":27,"context_line":"                       \"networks. The default value \u0027local\u0027 is useful for \""},{"line_number":28,"context_line":"                       \"single-box testing but provides no connectivity \""},{"line_number":29,"context_line":"                       \"between hosts.\")),"},{"line_number":30,"context_line":"    cfg.ListOpt(\u0027orphan_type_drivers\u0027,"},{"line_number":31,"context_line":"                default\u003d[],"},{"line_number":32,"context_line":"                help\u003d_(\"List of orphan network type driver entrypoints to be \""},{"line_number":33,"context_line":"                       \"loaded from the \u0027neutron.ml2.orphan_type_drivers\u0027 \""}],"source_content_type":"text/x-python","patch_set":9,"id":"7a740942_b2de8d6b","line":30,"updated":"2015-12-04 20:12:35.000000000","message":"This orphan_type_drivers isn\u0027t exactly intuitive for an operator because the issue isn\u0027t directly obvious.\n\nCan you just call it \u0027disabled_type_drivers\u0027? Then in the help clearly state that this should be a list of any drivers that were previously enabled in the type_drivers option so previously allocated segments can be properly deleted.","commit_id":"a3362f3398277359dcc8afae25f054573674c25f"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"9426d693908ae52cffbe2a8eaf5750c29d9d4ac2","unresolved":false,"context_lines":[{"line_number":27,"context_line":"                       \"networks. The default value \u0027local\u0027 is useful for \""},{"line_number":28,"context_line":"                       \"single-box testing but provides no connectivity \""},{"line_number":29,"context_line":"                       \"between hosts.\")),"},{"line_number":30,"context_line":"    cfg.ListOpt(\u0027orphan_type_drivers\u0027,"},{"line_number":31,"context_line":"                default\u003d[],"},{"line_number":32,"context_line":"                help\u003d_(\"List of orphan network type driver entrypoints to be \""},{"line_number":33,"context_line":"                       \"loaded from the \u0027neutron.ml2.orphan_type_drivers\u0027 \""}],"source_content_type":"text/x-python","patch_set":9,"id":"7a740942_9ec01be2","line":30,"in_reply_to":"7a740942_b2de8d6b","updated":"2015-12-07 06:57:45.000000000","message":"Done. Adjusted for this change all over the patch.","commit_id":"a3362f3398277359dcc8afae25f054573674c25f"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"ee79b598650d14fd9ff4dfe8f6a93989fe8dc649","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    cfg.ListOpt(\u0027orphan_type_drivers\u0027,"},{"line_number":31,"context_line":"                default\u003d[],"},{"line_number":32,"context_line":"                help\u003d_(\"List of orphan network type driver entrypoints to be \""},{"line_number":33,"context_line":"                       \"loaded from the \u0027neutron.ml2.orphan_type_drivers\u0027 \""},{"line_number":34,"context_line":"                       \"namespace. The deafult value is empty. Orphan network \""},{"line_number":35,"context_line":"                       \"segments are those which are already created, but do \""},{"line_number":36,"context_line":"                       \"not have their corresponding driver names configured \""}],"source_content_type":"text/x-python","patch_set":9,"id":"7a740942_2ffa4fbe","line":33,"updated":"2015-12-04 11:48:24.000000000","message":"Added help which was there only in the static example ml2_conf.ini which is now removed (latest genconfig change https://review.openstack.org/#/c/204206/).","commit_id":"a3362f3398277359dcc8afae25f054573674c25f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"35ec0aa1bc67357413f28905bbda1d0e16b5f62a","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                default\u003d[],"},{"line_number":32,"context_line":"                help\u003d_(\"List of network type driver entrypoints to be loaded \""},{"line_number":33,"context_line":"                       \"from the \u0027neutron.ml2.disabled_type_drivers\u0027 \""},{"line_number":34,"context_line":"                       \"namespace. The deafult value is empty. This should \""},{"line_number":35,"context_line":"                       \"be a list of drivers that were previously enabled \""},{"line_number":36,"context_line":"                       \"in \u0027neutron.ml2.type_drivers\u0027 option. These drivers \""},{"line_number":37,"context_line":"                       \"will be used to properly delete previously allocated \""}],"source_content_type":"text/x-python","patch_set":10,"id":"7a740942_5f4e2a70","line":34,"updated":"2015-12-07 09:17:28.000000000","message":"deafult \u003d\u003e default","commit_id":"c4dae76326fb034d1ddc7c75eb23d892fb4da7b4"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"76cba30139e8664dd3dac28748022cd2f87f8d2e","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                default\u003d[],"},{"line_number":32,"context_line":"                help\u003d_(\"List of network type driver entrypoints to be loaded \""},{"line_number":33,"context_line":"                       \"from the \u0027neutron.ml2.disabled_type_drivers\u0027 \""},{"line_number":34,"context_line":"                       \"namespace. The deafult value is empty. This should \""},{"line_number":35,"context_line":"                       \"be a list of drivers that were previously enabled \""},{"line_number":36,"context_line":"                       \"in \u0027neutron.ml2.type_drivers\u0027 option. These drivers \""},{"line_number":37,"context_line":"                       \"will be used to properly delete previously allocated \""}],"source_content_type":"text/x-python","patch_set":10,"id":"7a740942_73cb1d1f","line":34,"in_reply_to":"7a740942_5f4e2a70","updated":"2015-12-07 10:55:24.000000000","message":"Done","commit_id":"c4dae76326fb034d1ddc7c75eb23d892fb4da7b4"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"35ec0aa1bc67357413f28905bbda1d0e16b5f62a","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                       \"will be used to properly delete previously allocated \""},{"line_number":38,"context_line":"                       \"segment types, which do not have their corresponding \""},{"line_number":39,"context_line":"                       \"driver names configured in \u0027type_drivers\u0027 list during \""},{"line_number":40,"context_line":"                       \"subsequent runs.\")),"},{"line_number":41,"context_line":"    cfg.ListOpt(\u0027mechanism_drivers\u0027,"},{"line_number":42,"context_line":"                default\u003d[],"},{"line_number":43,"context_line":"                help\u003d_(\"An ordered list of networking mechanism driver \""}],"source_content_type":"text/x-python","patch_set":10,"id":"7a740942_3f247ead","line":40,"updated":"2015-12-07 09:17:28.000000000","message":"please add the reno release not for this\n\ni am not sure how an admin is going to maintain these when there are multiple services running.","commit_id":"c4dae76326fb034d1ddc7c75eb23d892fb4da7b4"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"76cba30139e8664dd3dac28748022cd2f87f8d2e","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                       \"will be used to properly delete previously allocated \""},{"line_number":38,"context_line":"                       \"segment types, which do not have their corresponding \""},{"line_number":39,"context_line":"                       \"driver names configured in \u0027type_drivers\u0027 list during \""},{"line_number":40,"context_line":"                       \"subsequent runs.\")),"},{"line_number":41,"context_line":"    cfg.ListOpt(\u0027mechanism_drivers\u0027,"},{"line_number":42,"context_line":"                default\u003d[],"},{"line_number":43,"context_line":"                help\u003d_(\"An ordered list of networking mechanism driver \""}],"source_content_type":"text/x-python","patch_set":10,"id":"7a740942_f3d70dbd","line":40,"in_reply_to":"7a740942_3f247ead","updated":"2015-12-07 10:55:24.000000000","message":"Done. Added the reno file for the option and mentioned the bug# in the fixes section.","commit_id":"c4dae76326fb034d1ddc7c75eb23d892fb4da7b4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"99a9c24e973d1d4c0d177d351143697211670fef","unresolved":false,"context_lines":[{"line_number":27,"context_line":"                       \"networks. The default value \u0027local\u0027 is useful for \""},{"line_number":28,"context_line":"                       \"single-box testing but provides no connectivity \""},{"line_number":29,"context_line":"                       \"between hosts.\")),"},{"line_number":30,"context_line":"    cfg.ListOpt(\u0027disabled_type_drivers\u0027,"},{"line_number":31,"context_line":"                default\u003d[],"},{"line_number":32,"context_line":"                help\u003d_(\"List of network type driver entrypoints to be loaded \""},{"line_number":33,"context_line":"                       \"from the \u0027neutron.ml2.disabled_type_drivers\u0027 \""}],"source_content_type":"text/x-python","patch_set":13,"id":"3a7e1126_9d5b4b2e","line":30,"range":{"start_line":30,"start_character":17,"end_line":30,"end_character":38},"updated":"2015-12-18 00:58:32.000000000","message":"I personally don\u0027t like this approach. I\u0027ll provide more input on the bug report.","commit_id":"ea257ee0fb536b9ec51b162721fbbee76cc262a4"}],"neutron/plugins/ml2/managers.py":[{"author":{"_account_id":14591,"name":"Lubosz Kosnik (diltram)","email":"lubosz.kosnik@intel.com","username":"diltram"},"change_message_id":"ebb0aa723e272e1cc669d7ef06463652b21bccce","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            else:"},{"line_number":179,"context_line":"                LOG.error(_LE(\"Network %s has no segments\"), id)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        orphan_types \u003d list(self.reg_types - set(cfg.CONF.ml2.type_drivers))"},{"line_number":182,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":183,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":184,"context_line":"            orphan_types,"}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_2f87bcd8","line":181,"updated":"2015-11-13 14:44:23.000000000","message":"Is that list is really needed?","commit_id":"e7a8e7d950a81a2450266295bcfc1a621d493638"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"16b382f11a2b9e0d22f3a17056ffb433ef42d4e4","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            else:"},{"line_number":179,"context_line":"                LOG.error(_LE(\"Network %s has no segments\"), id)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        orphan_types \u003d list(self.reg_types - set(cfg.CONF.ml2.type_drivers))"},{"line_number":182,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":183,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":184,"context_line":"            orphan_types,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_6daf32e4","line":181,"in_reply_to":"da85f559_2f87bcd8","updated":"2015-11-16 12:24:03.000000000","message":"I didn\u0027t understand what you asked. Did you mean \u0027Is that variable needed?\u0027 or that list itself? \nI didn\u0027t want the new (2nd) extension mgr to load all the drivers, only the ones that are not in the \u0027type_drivers\u0027 list, but is there configured for segments that got created in an earlier session/run. This way if one of the type is removed by the admin from support but still there are n/w segments created with that type, we\u0027ve the option to delete that segment and not leave the segment/record orphaned! Is that clear? or am I missing something?","commit_id":"e7a8e7d950a81a2450266295bcfc1a621d493638"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"308e8d55ee37df90a487a2ac90d35e701097e681","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":183,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":184,"context_line":"            orphan_types,"},{"line_number":185,"context_line":"            invoke_on_load\u003dTrue)"},{"line_number":186,"context_line":"        LOG.info(_LI(\"Loaded orphan type drivers: %s\"), em.names())"},{"line_number":187,"context_line":"        for driver in em:"},{"line_number":188,"context_line":"            network_type \u003d driver.obj.get_type()"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_4c4d7071","line":185,"updated":"2015-11-16 22:56:36.000000000","message":"What will happen if one of these drivers has an issue trying to load? I don\u0027t think we want that to be a fatal error since it\u0027s not something that the operator configured.","commit_id":"e7a8e7d950a81a2450266295bcfc1a621d493638"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"317d800fdfd8d9f5e3882995f32de3802d577f80","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":183,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":184,"context_line":"            orphan_types,"},{"line_number":185,"context_line":"            invoke_on_load\u003dTrue)"},{"line_number":186,"context_line":"        LOG.info(_LI(\"Loaded orphan type drivers: %s\"), em.names())"},{"line_number":187,"context_line":"        for driver in em:"},{"line_number":188,"context_line":"            network_type \u003d driver.obj.get_type()"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_074f3abe","line":185,"in_reply_to":"ba8a016a_4c4d7071","updated":"2015-11-17 03:11:47.000000000","message":"Can see if I can catch exceptions from extension manager.\nBut do you think it is relevant here? The drivers that are being loaded are actually the ones that was used to create segments in the first place. They are not there now in the \u0027type_drivers\u0027 list in a subsequent run, and that is why I am trying to load them. So there is no chance of errors!","commit_id":"e7a8e7d950a81a2450266295bcfc1a621d493638"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"9b26cd48f7f4b1e180943c8a533a95aedc6d1df4","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":183,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":184,"context_line":"            orphan_types,"},{"line_number":185,"context_line":"            invoke_on_load\u003dTrue)"},{"line_number":186,"context_line":"        LOG.info(_LI(\"Loaded orphan type drivers: %s\"), em.names())"},{"line_number":187,"context_line":"        for driver in em:"},{"line_number":188,"context_line":"            network_type \u003d driver.obj.get_type()"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_bd366be5","line":185,"in_reply_to":"ba8a016a_4c4d7071","updated":"2015-11-17 12:06:19.000000000","message":"I don\u0027t think, this will be an issue. Still, I\u0027ve added reporting code for exceptions from ExtensionManager like IOError, ImportError etc. I\u0027ve modified the test code to cover all of these cases. Please have a look at the test code mods as well.","commit_id":"e7a8e7d950a81a2450266295bcfc1a621d493638"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"50a2fb447dcb7a79fd956870c171911964cb8b1f","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":183,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":184,"context_line":"            orphan_types,"},{"line_number":185,"context_line":"            invoke_on_load\u003dTrue)"},{"line_number":186,"context_line":"        LOG.info(_LI(\"Loaded orphan type drivers: %s\"), em.names())"},{"line_number":187,"context_line":"        for driver in em:"},{"line_number":188,"context_line":"            network_type \u003d driver.obj.get_type()"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_437afdf2","line":185,"in_reply_to":"ba8a016a_bd366be5","updated":"2015-11-17 13:42:44.000000000","message":"It\u0027s possible that a type driver was disabled because it was having issues. We want to make sure that any errors coming from the type driver don\u0027t break the startup or the segment release if it\u0027s an orphaned driver.","commit_id":"e7a8e7d950a81a2450266295bcfc1a621d493638"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6eb008cc45b73f82847fd31d9e01b1557950e1f5","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        # Mapping from type name to DriverManager"},{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.orphan_drivers \u003d {}"},{"line_number":48,"context_line":"        self.reg_types \u003d set()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":51,"context_line":"                 cfg.CONF.ml2.type_drivers)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_1def7788","line":48,"updated":"2015-11-17 12:17:35.000000000","message":"consider reg_types \u003d\u003e supported_network_types","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"4542e0fe116432de2f83e1fc4759433b9bc57144","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        # Mapping from type name to DriverManager"},{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.orphan_drivers \u003d {}"},{"line_number":48,"context_line":"        self.reg_types \u003d set()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":51,"context_line":"                 cfg.CONF.ml2.type_drivers)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_9ddcc7e5","line":48,"updated":"2015-11-17 12:18:33.000000000","message":"reg_types is used only in reg_network_types method so no need to define it as an instance attribute","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"c2a6cc529f2802733b498a23793ce2d2c0eabe1a","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        # Mapping from type name to DriverManager"},{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.orphan_drivers \u003d {}"},{"line_number":48,"context_line":"        self.reg_types \u003d set()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":51,"context_line":"                 cfg.CONF.ml2.type_drivers)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_f3507160","line":48,"in_reply_to":"ba8a016a_1def7788","updated":"2015-11-18 08:12:21.000000000","message":"Done. \u0027existing_nw_types\u0027 seemed more accurate.","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"c2a6cc529f2802733b498a23793ce2d2c0eabe1a","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        # Mapping from type name to DriverManager"},{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.orphan_drivers \u003d {}"},{"line_number":48,"context_line":"        self.reg_types \u003d set()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":51,"context_line":"                 cfg.CONF.ml2.type_drivers)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_d3552d50","line":48,"in_reply_to":"ba8a016a_9ddcc7e5","updated":"2015-11-18 08:12:21.000000000","message":"Done","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"c2a6cc529f2802733b498a23793ce2d2c0eabe1a","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        self.orphan_drivers \u003d {}"},{"line_number":48,"context_line":"        self.reg_types \u003d set()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":51,"context_line":"                 cfg.CONF.ml2.type_drivers)"},{"line_number":52,"context_line":"        super(TypeManager, self).__init__(\u0027neutron.ml2.type_drivers\u0027,"},{"line_number":53,"context_line":"                                          cfg.CONF.ml2.type_drivers,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_13a09542","line":50,"updated":"2015-11-18 08:12:21.000000000","message":"\u0027type_drivers\u0027 are actually n/w driver types, not driver names. This will clarify \tCedric Brandily\u0027s comment below for mixing types and names.","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ace42b83092437911b94f76b31a7ef8866b5f904","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        self._check_external_network_type(cfg.CONF.ml2.external_network_type)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def _register_types(self):"},{"line_number":61,"context_line":"        for ext in self:"},{"line_number":62,"context_line":"            network_type \u003d ext.obj.get_type()"},{"line_number":63,"context_line":"            if network_type in self.drivers:"},{"line_number":64,"context_line":"                LOG.error(_LE(\"Type driver \u0027%(new_driver)s\u0027 ignored because\""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_d142053e","line":61,"updated":"2015-11-18 08:31:08.000000000","message":"This code highlights that type driver name !\u003d network_type","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6eb008cc45b73f82847fd31d9e01b1557950e1f5","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":169,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def reg_network_types(self, context, networks):"},{"line_number":172,"context_line":"        for network in networks:"},{"line_number":173,"context_line":"            id \u003d network[\u0027id\u0027]"},{"line_number":174,"context_line":"            segments \u003d db.get_network_segments(context.session, id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_dd5a4f83","line":171,"range":{"start_line":171,"start_character":8,"end_line":171,"end_character":25},"updated":"2015-11-17 12:17:35.000000000","message":"is reg register?\ncan you please write a docstring to explain what is being done here","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"4542e0fe116432de2f83e1fc4759433b9bc57144","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":169,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def reg_network_types(self, context, networks):"},{"line_number":172,"context_line":"        for network in networks:"},{"line_number":173,"context_line":"            id \u003d network[\u0027id\u0027]"},{"line_number":174,"context_line":"            segments \u003d db.get_network_segments(context.session, id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_dd832fcb","line":171,"updated":"2015-11-17 12:18:33.000000000","message":"use meaningful method names:\n\n discover_network_types","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"c2a6cc529f2802733b498a23793ce2d2c0eabe1a","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":169,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def reg_network_types(self, context, networks):"},{"line_number":172,"context_line":"        for network in networks:"},{"line_number":173,"context_line":"            id \u003d network[\u0027id\u0027]"},{"line_number":174,"context_line":"            segments \u003d db.get_network_segments(context.session, id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_b38f49cb","line":171,"in_reply_to":"ba8a016a_dd5a4f83","updated":"2015-11-18 08:12:21.000000000","message":"Done","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"c2a6cc529f2802733b498a23793ce2d2c0eabe1a","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":169,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def reg_network_types(self, context, networks):"},{"line_number":172,"context_line":"        for network in networks:"},{"line_number":173,"context_line":"            id \u003d network[\u0027id\u0027]"},{"line_number":174,"context_line":"            segments \u003d db.get_network_segments(context.session, id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_73c001e1","line":171,"in_reply_to":"ba8a016a_dd832fcb","updated":"2015-11-18 08:12:21.000000000","message":"Done","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"4542e0fe116432de2f83e1fc4759433b9bc57144","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            else:"},{"line_number":179,"context_line":"                LOG.error(_LE(\"Network %s has no segments\"), id)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        orphan_types \u003d list(self.reg_types - set(cfg.CONF.ml2.type_drivers))"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def report_load_failure(mgr, ep, err):"},{"line_number":184,"context_line":"            LOG.error(_LE(\"Failed to load orphan type driver \""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_9d736780","line":181,"updated":"2015-11-17 12:18:33.000000000","message":"You are mixing network types (self.reg_types) and type drivers names (cfg.CONF.ml2.type_drivers)\n\nMore generally, this code assumes wrongly that segments of network_type X are managed by the type_driver named X in stevedore namespace \"neutron.ml2.type_drivers\".","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"c2a6cc529f2802733b498a23793ce2d2c0eabe1a","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            else:"},{"line_number":179,"context_line":"                LOG.error(_LE(\"Network %s has no segments\"), id)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        orphan_types \u003d list(self.reg_types - set(cfg.CONF.ml2.type_drivers))"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def report_load_failure(mgr, ep, err):"},{"line_number":184,"context_line":"            LOG.error(_LE(\"Failed to load orphan type driver \""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_f6361fe6","line":181,"in_reply_to":"ba8a016a_9d736780","updated":"2015-11-18 08:12:21.000000000","message":"\u0027type_drivers\u0027 are actually n/w driver types, not driver names. I\u0027ve changed it  in the log above where it was wrongly mentioned as \u0027name\u0027. If you see the drivers\u0027 get_type() you will see that it is actually returning type, and I am using this type to build up the orphan driver list. These are the same types that gets configured for ml2.\u0027type_drivers\u0027 in ml2_conf.ini and in cfg.CONF.ml2.type_drivers.","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ace42b83092437911b94f76b31a7ef8866b5f904","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            else:"},{"line_number":179,"context_line":"                LOG.error(_LE(\"Network %s has no segments\"), id)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        orphan_types \u003d list(self.reg_types - set(cfg.CONF.ml2.type_drivers))"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def report_load_failure(mgr, ep, err):"},{"line_number":184,"context_line":"            LOG.error(_LE(\"Failed to load orphan type driver \""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_36ba676f","line":181,"in_reply_to":"ba8a016a_f6361fe6","updated":"2015-11-18 08:31:08.000000000","message":"An example is perhaps clearer. If i replace in setup.cfg:\n\n neutron.ml2.type_drivers \u003d\n   ..\n   vlan \u003d neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver\n\nby:\n\n neutron.ml2.type_drivers \u003d\n   ..\n   myvlan \u003d neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver\n\n\nThis code is not working because it should use:\n\n orphan_types \u003d self.reg_types - set(self.drivers.keys())","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6eb008cc45b73f82847fd31d9e01b1557950e1f5","unresolved":false,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        orphan_types \u003d list(self.reg_types - set(cfg.CONF.ml2.type_drivers))"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def report_load_failure(mgr, ep, err):"},{"line_number":184,"context_line":"            LOG.error(_LE(\"Failed to load orphan type driver \""},{"line_number":185,"context_line":"                          \"%(mod_name)s: %(err)s\"),"},{"line_number":186,"context_line":"                      {\u0027mod_name\u0027: ep.module_name,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_7d4563b1","line":183,"updated":"2015-11-17 12:17:35.000000000","message":"why do we need the nested method? Is this for unit tests?","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"c2a6cc529f2802733b498a23793ce2d2c0eabe1a","unresolved":false,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        orphan_types \u003d list(self.reg_types - set(cfg.CONF.ml2.type_drivers))"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        def report_load_failure(mgr, ep, err):"},{"line_number":184,"context_line":"            LOG.error(_LE(\"Failed to load orphan type driver \""},{"line_number":185,"context_line":"                          \"%(mod_name)s: %(err)s\"),"},{"line_number":186,"context_line":"                      {\u0027mod_name\u0027: ep.module_name,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_963553db","line":183,"in_reply_to":"ba8a016a_7d4563b1","updated":"2015-11-18 08:12:21.000000000","message":"The type driver could have been disabled by the operator due to some problems in the first place. So again when it is loaded into orphan driver list using stevedore ext mgr, wanted to log all the error that throws up from the ext mgr. So whenever there is any orphan n/w segment which cannot be reclaimed, we can see from the logs what had prevented them from getting released.\n\nI am using the logs for test cases as well.","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6eb008cc45b73f82847fd31d9e01b1557950e1f5","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        for driver in em:"},{"line_number":196,"context_line":"            network_type \u003d driver.obj.get_type()"},{"line_number":197,"context_line":"            if network_type in self.orphan_drivers:"},{"line_number":198,"context_line":"                LOG.error(_LE(\"Orphan type driver \u0027%(new_drv)s\u0027 ignored\""},{"line_number":199,"context_line":"                              \" because type driver \u0027%(old_drv)s\u0027 is\""},{"line_number":200,"context_line":"                              \" already registered for orphaned type\""},{"line_number":201,"context_line":"                              \" \u0027%(type)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_dde80f7f","line":198,"updated":"2015-11-17 12:17:35.000000000","message":"i prefer spaces at the end of the sentence","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"c2a6cc529f2802733b498a23793ce2d2c0eabe1a","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        for driver in em:"},{"line_number":196,"context_line":"            network_type \u003d driver.obj.get_type()"},{"line_number":197,"context_line":"            if network_type in self.orphan_drivers:"},{"line_number":198,"context_line":"                LOG.error(_LE(\"Orphan type driver \u0027%(new_drv)s\u0027 ignored\""},{"line_number":199,"context_line":"                              \" because type driver \u0027%(old_drv)s\u0027 is\""},{"line_number":200,"context_line":"                              \" already registered for orphaned type\""},{"line_number":201,"context_line":"                              \" \u0027%(type)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_9656b3d0","line":198,"in_reply_to":"ba8a016a_dde80f7f","updated":"2015-11-18 08:12:21.000000000","message":"Done","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e2ac43fd230853e58c929575640b946c191263c8","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                if driver:"},{"line_number":298,"context_line":"                    LOG.info(_LI(\"Releasing orphaned segment \u0027%s\u0027 using \""},{"line_number":299,"context_line":"                                 \"orphaned driver.\"), segment)"},{"line_number":300,"context_line":"                    driver.obj.release_segment(session, segment)"},{"line_number":301,"context_line":"                else:"},{"line_number":302,"context_line":"                    LOG.error(_LE(\"Failed to release segment \u0027%s\u0027 because \""},{"line_number":303,"context_line":"                                  \"network type is not supported.\"), segment)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_839465e2","line":300,"updated":"2015-11-17 13:43:48.000000000","message":"I think this will need a try/except wrapped around it in case there is something wrong with the type driver that caused the operator to disable it in the first place.","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"c2a6cc529f2802733b498a23793ce2d2c0eabe1a","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                if driver:"},{"line_number":298,"context_line":"                    LOG.info(_LI(\"Releasing orphaned segment \u0027%s\u0027 using \""},{"line_number":299,"context_line":"                                 \"orphaned driver.\"), segment)"},{"line_number":300,"context_line":"                    driver.obj.release_segment(session, segment)"},{"line_number":301,"context_line":"                else:"},{"line_number":302,"context_line":"                    LOG.error(_LE(\"Failed to release segment \u0027%s\u0027 because \""},{"line_number":303,"context_line":"                                  \"network type is not supported.\"), segment)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_b6689788","line":300,"in_reply_to":"ba8a016a_839465e2","updated":"2015-11-18 08:12:21.000000000","message":"Done. I\u0027ve added new test cases to cover them.","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"0428a96f4fe58f761439c17e010ad98c63fbab40","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.orphan_drivers \u003d {}"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        LOG.info(_LI(\"Configured type driver types: %s\"),"},{"line_number":50,"context_line":"                 cfg.CONF.ml2.type_drivers)"},{"line_number":51,"context_line":"        super(TypeManager, self).__init__(\u0027neutron.ml2.type_drivers\u0027,"},{"line_number":52,"context_line":"                                          cfg.CONF.ml2.type_drivers,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_db3e8d8b","line":49,"updated":"2015-11-18 17:12:06.000000000","message":"\"names\" is more correct from extension manager perspective. So reverted it...","commit_id":"d64ca5ba963597ee4dd393f076676789f7817f2a"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"04251c5e5e6bdb2c024c152758f4eb146c169e5b","unresolved":false,"context_lines":[{"line_number":187,"context_line":"            else:"},{"line_number":188,"context_line":"                LOG.error(_LE(\"Network %s has no segments\"), id)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        orphan_types \u003d list(existing_nw_types - set(cfg.CONF.ml2.type_drivers))"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        def report_load_failure(mgr, ep, err):"},{"line_number":193,"context_line":"            LOG.error(_LE(\"Failed to load orphan type driver \""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_11f40df0","line":190,"updated":"2015-11-18 08:35:33.000000000","message":"See PS3","commit_id":"d64ca5ba963597ee4dd393f076676789f7817f2a"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"0428a96f4fe58f761439c17e010ad98c63fbab40","unresolved":false,"context_lines":[{"line_number":187,"context_line":"            else:"},{"line_number":188,"context_line":"                LOG.error(_LE(\"Network %s has no segments\"), id)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        orphan_types \u003d list(existing_nw_types - set(cfg.CONF.ml2.type_drivers))"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        def report_load_failure(mgr, ep, err):"},{"line_number":193,"context_line":"            LOG.error(_LE(\"Failed to load orphan type driver \""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba8a016a_f8f03793","line":190,"in_reply_to":"ba8a016a_11f40df0","updated":"2015-11-18 17:12:06.000000000","message":"As per your example...\nyou are replacing in setup.cfg:\n neutron.ml2.type_drivers \u003d\n   ..\n   vlan \u003d neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver\nby:\n neutron.ml2.type_drivers \u003d\n   ..\n   myvlan \u003d neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver\n\nAs it is now implemented in master, if you do this and include the type in \u0027tenant_network_types\u0027, the q-svc (neutron-server) service won\u0027t start...\n\nWhat I have done is like this...\nIn setup.cfg, I change...\n\nneutron.ml2.type_drivers \u003d\n   ...\n    myvlan \u003d neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver\n\nThe rest I\u0027ve kept as is...Now I run \u0027python setup.py egg_info\u0027 to update...\n\n Now I change mlc2_conf.ini to...\n\n [ml2]\n tenant_network_types \u003d gre,myvlan\n extension_drivers \u003d port_security\n type_drivers \u003d local,flat,myvlan,gre,vxlan\n\nNow restart q-svc... it will exit with error...\n\n ERROR neutron.plugins.ml2.managers [-] No type driver for tenant  network_type: myvlan. Service terminated!\n\nThis check happens in _check_tenant_network_types(), and drivers list uses key from driver\u0027s .get_type() which you can see is hard coded and is same as the one\u0027s configured in setup.cfg. So here we\u0027ve a hard coded relation between the driver type and n/w type.\n\nNow we can assume that it didn\u0027t happen for configured ones in tenant_network_types, i.e. you created a segment using a proper driver configured with the proper name in ml2_conf as returned by its get_type(). Now you removed it from  \u0027tenant_network_types\u0027 and changed its name as you suggested in setup.cfg, ran setup update, and restarted q-svc. In this case too it will be make little difference if you keep the current code or change it to use the keys() as you suggest, because the orphan types is got from what is there in existing_nw_types which is not there in  cfg.CONF.ml2.type_drivers _or_ self.drivers.keys() and in both cases the result will be same...\n\n First case if it is cfg.CONF.ml2.type_drivers\n -------------------------------------------------------------\n\nexisting_nw_types contains the segment type which is same as drivers\u0027 get_type(). So it is not there in the type_drivers list. So we have types in orphan_types, but it will not be there in the stevedore namespace since we\u0027ve changed it in setup.cfg. So there is no orphan driver.\n\n Second case if it is self.drivers.keys()\n --------------------------------------------------------\n\nexisting_nw_types contains the segment type which is same as drivers\u0027 get_type(). It is also there in self.drivers.keys() list as well, since it uses get_type() as keys. So orphan_types will not have that type and so there is no orphan driver.\n\nIn both these cases the release_segment will work because the main drivers list has the driver to release the segment.\n\nAnyway I\u0027ve changed it as you suggested since I thought it is more symmetric (diff b/w lists, both built using drivers\u0027 .get_type()) .\n\nStill I am very curious to know the scenario where the old code didn\u0027t work!","commit_id":"d64ca5ba963597ee4dd393f076676789f7817f2a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3b97d46c64c74ad0170fec80519aa98aac58ce1c","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":168,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def discover_network_types(self, context, networks):"},{"line_number":171,"context_line":"        # Plugin calls this function by passing in all"},{"line_number":172,"context_line":"        # the existing networks. This function extracts"},{"line_number":173,"context_line":"        # all the unique network segment types from this"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_ee497cb8","line":170,"updated":"2015-11-23 19:13:28.000000000","message":"This could result in 10s of thousands of DB operations. This is an expensive operation to do on every server start just for a corner case.\n\nPlease adjust this patch to skip this giant network scan and to only invoke the driver loading when there is actually a segment that needs to be released that is orphaned.","commit_id":"5ff9a8c79a3d23f50a6c850d8d3e2e6560e7299c"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"2cd834b16c12ad36124684589de322b5bc09d197","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":168,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def discover_network_types(self, context, networks):"},{"line_number":171,"context_line":"        # Plugin calls this function by passing in all"},{"line_number":172,"context_line":"        # the existing networks. This function extracts"},{"line_number":173,"context_line":"        # all the unique network segment types from this"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_d0f26806","line":170,"in_reply_to":"ba8a016a_ee497cb8","updated":"2015-11-24 16:19:51.000000000","message":"Done. Found a way to piggyback on an existing get_networks() loop. Please see PS# 6","commit_id":"5ff9a8c79a3d23f50a6c850d8d3e2e6560e7299c"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"bc96fad69863b015a196e00b92a3be9be0ba8581","unresolved":false,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":182,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":183,"context_line":"            list(nw_types),"},{"line_number":184,"context_line":"            invoke_on_load\u003dTrue,"},{"line_number":185,"context_line":"            on_load_failure_callback\u003dreport_load_failure)"},{"line_number":186,"context_line":"        LOG.info(_LI(\"Loaded orphan type drivers: %s\"), em.names())"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a8ffd7b_4d124cb6","line":183,"updated":"2015-11-25 00:05:37.000000000","message":"This is an incorrect assumption: nothing ensures the type driver name matches the network type and even if you find a valid type driver what ensures that the type driver is the correct one (ie: many type drivers can provide networks with the same network types).\n\nIMO, the correct approach is to define a new option listing \"release-only\" type drivers instead of trying to infer them","commit_id":"610db4ca2a897c7139798a87527eb8e696a4e3fe"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"93a0f628b8b4c9fedeaec69c509737bbe10127a7","unresolved":false,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":182,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":183,"context_line":"            list(nw_types),"},{"line_number":184,"context_line":"            invoke_on_load\u003dTrue,"},{"line_number":185,"context_line":"            on_load_failure_callback\u003dreport_load_failure)"},{"line_number":186,"context_line":"        LOG.info(_LI(\"Loaded orphan type drivers: %s\"), em.names())"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a8ffd7b_daf1fece","line":183,"in_reply_to":"9a8ffd7b_4d124cb6","updated":"2015-11-25 09:40:20.000000000","message":"Agreed, I\u0027ve added a new option and kept the detection logic as is because  I didn\u0027t want to load up everything that\u0027s configured for release. The detection will happen and those types will be checked against the driver  types that gets loaded.","commit_id":"610db4ca2a897c7139798a87527eb8e696a4e3fe"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9ce5ff2ba718d0a9590da2d7916d5e501b662477","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            network[provider.NETWORK_TYPE] \u003d segment[api.NETWORK_TYPE]"},{"line_number":231,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":232,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":233,"context_line":"        self.discover_network_segments(context, segments)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def initialize(self):"},{"line_number":236,"context_line":"        for network_type, driver in six.iteritems(self.drivers):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_5dcb5a53","line":233,"updated":"2015-12-02 23:24:45.000000000","message":"This isn\u0027t a good place for this function to be called because it\u0027s an unexpected side effect of something that is just populating a dictionary.\n\nDuring the \u0027release_network_segments\u0027 call just try to lookup and initialize an orphaned driver if no normal driver is found. Then cache that result for the segment type.\n\nSo the only time orphan drivers are initialized is when a segment is released with the type they support.","commit_id":"ac680e709062d4410ba7f79f5bbaca1d295059af"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"fbaae46f1f03b8fc2c4d612aa58aa4541b0a8d4a","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            network[provider.NETWORK_TYPE] \u003d segment[api.NETWORK_TYPE]"},{"line_number":231,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":232,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":233,"context_line":"        self.discover_network_segments(context, segments)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def initialize(self):"},{"line_number":236,"context_line":"        for network_type, driver in six.iteritems(self.drivers):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_0f18b31c","line":233,"in_reply_to":"7a740942_7f1d8dbc","updated":"2015-12-04 11:48:16.000000000","message":"Done. Also changed the function name to be more consistent.","commit_id":"ac680e709062d4410ba7f79f5bbaca1d295059af"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"1d9c45096d864bcd9987d4614b40ec678460ea53","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            network[provider.NETWORK_TYPE] \u003d segment[api.NETWORK_TYPE]"},{"line_number":231,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":232,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":233,"context_line":"        self.discover_network_segments(context, segments)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def initialize(self):"},{"line_number":236,"context_line":"        for network_type, driver in six.iteritems(self.drivers):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_7f1d8dbc","line":233,"in_reply_to":"9a8ffd7b_412db044","updated":"2015-12-03 19:26:34.000000000","message":"You don\u0027t need to detect all of them in release_network_segments. You only need to detect the ones that are being released.\n\n(e.g. if that is called and it returns a segment of vxlan and a segment of gre and the gre is orphaned, then you try to load the gre driver if it\u0027s not already loaded).","commit_id":"ac680e709062d4410ba7f79f5bbaca1d295059af"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"af4c0b6c4f1ee2ece8b18b51692695c6ace2d481","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            network[provider.NETWORK_TYPE] \u003d segment[api.NETWORK_TYPE]"},{"line_number":231,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":232,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":233,"context_line":"        self.discover_network_segments(context, segments)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"    def initialize(self):"},{"line_number":236,"context_line":"        for network_type, driver in six.iteritems(self.drivers):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_412db044","line":233,"in_reply_to":"9a8ffd7b_5dcb5a53","updated":"2015-12-03 03:34:32.000000000","message":"This cannot be done in release_network_segments() because I don\u0027t get the full list of existing networks segments there. What I do in discover_network_segments() is detecting existing network segment types and finding orphaned ones among them. If there are orphaned ones, then only it will look into the configuration \u0027orphan_type_drivers\u0027 and load ones that match types specified there. Otherwise all the ones in \u0027orphan_type_drivers\u0027  list will have to be loaded unnecessarily. On top of this the release_network_segments() gets called in multiple processes, so each process will try to do the same ops for loading orphaned segment type drivers.\n\nThis change was done based on an earlier review comment to avoid enumerating all the networks and segments in the system, as it will cause lots of DB ops. So I wanted to piggyback on an existing segments enumerating code so as to be very optimal. \n\nI understand this is a side effect of calling the function extend_network_dict_provider(), but functionally I believe this is the correct way of doing it as per review discussions at this stage.\n\nShould I rename the extend_network_dict_provider() to be clear about what ops it does? _or_\nShould I be enumerating the segments in a different function specially for discovery after the call to extend_network_dict_provider() \n\nPlease provide your suggestions.","commit_id":"ac680e709062d4410ba7f79f5bbaca1d295059af"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"35ec0aa1bc67357413f28905bbda1d0e16b5f62a","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            value \u003d None"},{"line_number":150,"context_line":"        return value"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def discover_orphaned_network_segments(self, segments):"},{"line_number":153,"context_line":"        # This function extracts unique network segment"},{"line_number":154,"context_line":"        # types from segment list. Drivers for types"},{"line_number":155,"context_line":"        # which are not configured in \u0027type_drivers\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a740942_bf5e2e10","line":152,"updated":"2015-12-07 09:17:28.000000000","message":"this is an internal method please us _ as a prefix","commit_id":"c4dae76326fb034d1ddc7c75eb23d892fb4da7b4"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"76cba30139e8664dd3dac28748022cd2f87f8d2e","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            value \u003d None"},{"line_number":150,"context_line":"        return value"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def discover_orphaned_network_segments(self, segments):"},{"line_number":153,"context_line":"        # This function extracts unique network segment"},{"line_number":154,"context_line":"        # types from segment list. Drivers for types"},{"line_number":155,"context_line":"        # which are not configured in \u0027type_drivers\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a740942_6e03320e","line":152,"in_reply_to":"7a740942_bf5e2e10","updated":"2015-12-07 10:55:24.000000000","message":"Done","commit_id":"c4dae76326fb034d1ddc7c75eb23d892fb4da7b4"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"751cde52df0cc30adf42a9c9d9b49fb3d1420b63","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        return value"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _discover_orphaned_network_segments(self, segments):"},{"line_number":153,"context_line":"        # This function extracts unique network segment"},{"line_number":154,"context_line":"        # types from segment list. Drivers for types"},{"line_number":155,"context_line":"        # which are not configured in \u0027type_drivers\u0027"},{"line_number":156,"context_line":"        # are loaded and stored in the orphan type"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_f7b6eef7","line":153,"updated":"2015-12-08 01:07:40.000000000","message":"prefer a docstring over a comment: the 2nd one is skipped by doc generators","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"0381d34a92df087570b1f114b8384519cbdf5a31","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        return value"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _discover_orphaned_network_segments(self, segments):"},{"line_number":153,"context_line":"        # This function extracts unique network segment"},{"line_number":154,"context_line":"        # types from segment list. Drivers for types"},{"line_number":155,"context_line":"        # which are not configured in \u0027type_drivers\u0027"},{"line_number":156,"context_line":"        # are loaded and stored in the orphan type"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_b3095386","line":153,"in_reply_to":"7a740942_f7b6eef7","updated":"2015-12-08 07:48:10.000000000","message":"Done","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"751cde52df0cc30adf42a9c9d9b49fb3d1420b63","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                      {\u0027mod_name\u0027: ep.module_name,"},{"line_number":184,"context_line":"                       \u0027err\u0027: err})"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":187,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":188,"context_line":"            cfg.CONF.ml2.disabled_type_drivers,"},{"line_number":189,"context_line":"            invoke_on_load\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_37da364d","line":186,"updated":"2015-12-08 01:07:40.000000000","message":"imo, \"orphan\" type drivers should be loaded once like normal type drivers\n\nit\u0027s a bit strange not to check if there is overlapping between normal and orphan type driver lists","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"0381d34a92df087570b1f114b8384519cbdf5a31","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                      {\u0027mod_name\u0027: ep.module_name,"},{"line_number":184,"context_line":"                       \u0027err\u0027: err})"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":187,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":188,"context_line":"            cfg.CONF.ml2.disabled_type_drivers,"},{"line_number":189,"context_line":"            invoke_on_load\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_73044b49","line":186,"in_reply_to":"7a740942_37da364d","updated":"2015-12-08 07:48:10.000000000","message":"This was moved here based on earlier comments. This was done so as to delay the loading and registering as late as possible, only when a orphan\u0027ed segment is detected, and it has not encountered any loading errors previously.\n\nOverlapping is not checked because, if there is overlapping then this issue will not happen because the segment will be deleted by the driver loaded from the normal one. Also we\u0027ll not come to this statement if there is overlapping because there won\u0027t be orphan segments. \norphan_types \u003d nw_types - set(self.drivers.keys()), we\u0027re diff\u0027ing with the keys, i.e. nw segment type.","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"b5a4e9ecd55d14795e6b00719fa587f63ca6e0b5","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            value \u003d None"},{"line_number":150,"context_line":"        return value"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _discover_orphaned_network_segments(self, segments):"},{"line_number":153,"context_line":"        \"\"\"Discover orphan network segments with no type drivers."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        This function extracts unique network segment types"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_41c9c0ab","line":152,"updated":"2015-12-09 23:07:36.000000000","message":"this method is not thread-safe: we can initialize the same driver multiple times if we have multiple concurrent network releases","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"075451930f2272f5e6dec1e9767e7c68a23f9cbb","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            value \u003d None"},{"line_number":150,"context_line":"        return value"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _discover_orphaned_network_segments(self, segments):"},{"line_number":153,"context_line":"        \"\"\"Discover orphan network segments with no type drivers."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        This function extracts unique network segment types"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_28e7b0ad","line":152,"in_reply_to":"7a740942_41c9c0ab","updated":"2015-12-10 04:30:11.000000000","message":"Yes, I am glad that this came in review. If you see my earlier patches and comments I\u0027ve been voicing this issue. If you delete networks in groups, then this will get called in multiple LWPs/threads and each will load up its own drivers. \n\nMy original idea was to go through the entire list of network segments, detect the orphan ones. For that I enumerated all the segments, but that was too expensive to do as per reviews. Then I moved that detection to an existing segment enumerating loop, I was surprised that this enum was being called many times even while listing the networks and deleting over and over again :-).\n\nAfter that patch (#6 iirc), then it was suggested to do this only while releasing.\n\nWhat is your suggestion? I wanted not to load up all drivers mentioned in disabled_type_drivers, only the ones that didn\u0027t have their names in type_drivers.\n\nSince we now have a config var for this, I could remove all these detection, simply load up these drivers during init and call release segment if the main driver for that type is not found. Then there is no need for try catch during release_segment as well.","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"28561dad6cadb649d70caf412f2a8c2e18f15059","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                      {\u0027mod_name\u0027: ep.module_name,"},{"line_number":186,"context_line":"                       \u0027err\u0027: err})"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":189,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":190,"context_line":"            cfg.CONF.ml2.disabled_type_drivers,"},{"line_number":191,"context_line":"            invoke_on_load\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_db736314","line":188,"updated":"2015-12-09 22:19:49.000000000","message":"I understand the lazy load concern(PS11) BUT this method is called even if there is no orphan segment in the network to release. Moreover this method loads orphan segments for every release of a network with orphan segments and IMO this method is too long/complex.","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"075451930f2272f5e6dec1e9767e7c68a23f9cbb","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                      {\u0027mod_name\u0027: ep.module_name,"},{"line_number":186,"context_line":"                       \u0027err\u0027: err})"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":189,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":190,"context_line":"            cfg.CONF.ml2.disabled_type_drivers,"},{"line_number":191,"context_line":"            invoke_on_load\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_6817f854","line":188,"in_reply_to":"7a740942_2637eae4","updated":"2015-12-10 04:30:11.000000000","message":"Please. I\u0027ve given mine above.","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"b233eb873f2e27419629c0463084ee9071ed4b6e","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                      {\u0027mod_name\u0027: ep.module_name,"},{"line_number":186,"context_line":"                       \u0027err\u0027: err})"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":189,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":190,"context_line":"            cfg.CONF.ml2.disabled_type_drivers,"},{"line_number":191,"context_line":"            invoke_on_load\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_2637eae4","line":188,"in_reply_to":"7a740942_db736314","updated":"2015-12-09 22:20:26.000000000","message":"I will propose an alternative solution in PS13","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"075451930f2272f5e6dec1e9767e7c68a23f9cbb","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                      {\u0027mod_name\u0027: ep.module_name,"},{"line_number":186,"context_line":"                       \u0027err\u0027: err})"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        em \u003d stevedore.named.NamedExtensionManager("},{"line_number":189,"context_line":"            \u0027neutron.ml2.type_drivers\u0027,"},{"line_number":190,"context_line":"            cfg.CONF.ml2.disabled_type_drivers,"},{"line_number":191,"context_line":"            invoke_on_load\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_e82448c7","line":188,"in_reply_to":"7a740942_db736314","updated":"2015-12-10 04:30:11.000000000","message":"See my comments above. Do you agree with the solution I propose there? i.e I will not try any of this detection, will simply load up all those drivers mentioned in \u0027disabled_type_drivers\u0027 during init, just as normal drivers, and try to delete with those drivers if main drivers are not enabled for that type. \n\nThat way it is much simpler, no need to do fancy orphan type detection and enumeration of segments.","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"164ec9fad2edc8fd52f908ddce71d0d2e8b36c28","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        for driver in em:"},{"line_number":195,"context_line":"            network_type \u003d driver.obj.get_type()"},{"line_number":196,"context_line":"            if network_type not in orphan_types:"},{"line_number":197,"context_line":"                LOG.error(_LE(\"Orphan type \u0027%(new_type)s\u0027 ignored \""},{"line_number":198,"context_line":"                              \"because it is not among the orphaned \""},{"line_number":199,"context_line":"                              \"types detected \u0027%(types)s\u0027\"),"},{"line_number":200,"context_line":"                          {\u0027new_type\u0027: network_type,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_460b167e","line":197,"updated":"2015-12-09 22:51:27.000000000","message":"iiuc, it will log an error if we have orphan drivers for GRE and VXLAN and segments contains only orphan GRE segments","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"075451930f2272f5e6dec1e9767e7c68a23f9cbb","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        for driver in em:"},{"line_number":195,"context_line":"            network_type \u003d driver.obj.get_type()"},{"line_number":196,"context_line":"            if network_type not in orphan_types:"},{"line_number":197,"context_line":"                LOG.error(_LE(\"Orphan type \u0027%(new_type)s\u0027 ignored \""},{"line_number":198,"context_line":"                              \"because it is not among the orphaned \""},{"line_number":199,"context_line":"                              \"types detected \u0027%(types)s\u0027\"),"},{"line_number":200,"context_line":"                          {\u0027new_type\u0027: network_type,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_4816bc56","line":197,"in_reply_to":"7a740942_460b167e","updated":"2015-12-10 04:30:11.000000000","message":"Yes","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"164ec9fad2edc8fd52f908ddce71d0d2e8b36c28","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                              \"types detected \u0027%(types)s\u0027\"),"},{"line_number":200,"context_line":"                          {\u0027new_type\u0027: network_type,"},{"line_number":201,"context_line":"                           \u0027types\u0027: orphan_types})"},{"line_number":202,"context_line":"            elif network_type in self.orphan_drivers:"},{"line_number":203,"context_line":"                LOG.error(_LE(\"Orphan type driver \u0027%(new_drv)s\u0027 ignored \""},{"line_number":204,"context_line":"                              \"because type driver \u0027%(old_drv)s\u0027 is \""},{"line_number":205,"context_line":"                              \"already registered for orphaned type \""}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_81fec803","line":202,"updated":"2015-12-09 22:51:27.000000000","message":"iiuc, in some cases new_drv \u003d\u003d old_drv, failing usecase\n\n 0) we have orphan driver for VXLAN and GRE\n 1) release a network with GRE segments\n 1.1) we log an error in L197 because VXLAN is not in orphan_types\n 1.2) we add GRE to self.orphan_drivers\n 1.3) delete the network\n 2) release a network with VXLAN segments\n 2.1) we log an error in L197 because GRE is not in orphan_types\n 2.2) we log an error in L203 because GRE is already loaded (argh)\n 2.3) we add VXLAN to self.orphan_drivers\n 2.4) delete the network\n ....\n X) release a network with unsupported orphan segments\n X.1)  we log an error in L197 because GRE is not in orphan_types\n X.2)  we log an error in L197 because VXLAN is not in orphan_types\n X.3) we log an error in L203 because GRE is already loaded\n X.4) we log an error in L203 because VXLAN is already loaded\n ...\n error logs in X) append over and over for unsupported orphan segments\n error logs in 1)/2) append until we have loaded all orphan segments","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"075451930f2272f5e6dec1e9767e7c68a23f9cbb","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                              \"types detected \u0027%(types)s\u0027\"),"},{"line_number":200,"context_line":"                          {\u0027new_type\u0027: network_type,"},{"line_number":201,"context_line":"                           \u0027types\u0027: orphan_types})"},{"line_number":202,"context_line":"            elif network_type in self.orphan_drivers:"},{"line_number":203,"context_line":"                LOG.error(_LE(\"Orphan type driver \u0027%(new_drv)s\u0027 ignored \""},{"line_number":204,"context_line":"                              \"because type driver \u0027%(old_drv)s\u0027 is \""},{"line_number":205,"context_line":"                              \"already registered for orphaned type \""}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_5ed2f635","line":202,"in_reply_to":"7a740942_81fec803","updated":"2015-12-10 04:30:11.000000000","message":"2.2) we log an error in L203 because GRE is already loaded (argh)\n\u003e\u003e I believe it won\u0027t, because it is inside \u0027elif\u0027\n\n X.3) we log an error in L203 because GRE is already loaded\n X.4) we log an error in L203 because VXLAN is already loaded\n\u003e\u003e I believe it won\u0027t, because it is inside \u0027elif\u0027\n\n error logs in X) append over and over for unsupported orphan segments\n error logs in 1)/2) append until we have loaded all orphan segments\n\u003e\u003e both are same cases and only log in L197 is logged, and that\u0027s because it is getting called for individual nw segments and not for all segments in the system. And that too repeatedly because we are doing it all the time during release in individual LWPs.\n\nPlease see my views earlier and provide suggestion. Since the disabled list now is admin/user configured value, we can follow a simple loading \u0026 delete similar to main driver list.","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"b5a4e9ecd55d14795e6b00719fa587f63ca6e0b5","unresolved":false,"context_lines":[{"line_number":326,"context_line":"                    # Try releasing the segment using orphan driver"},{"line_number":327,"context_line":"                    # There could be something wrong with the type"},{"line_number":328,"context_line":"                    # driver that prompted the operator to disable"},{"line_number":329,"context_line":"                    # it in the first place."},{"line_number":330,"context_line":"                    try:"},{"line_number":331,"context_line":"                        driver.obj.release_segment(session, segment)"},{"line_number":332,"context_line":"                    except Exception:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_e1a9cc7c","line":329,"updated":"2015-12-09 23:07:36.000000000","message":"don\u0027t understand why we do this: we could have the same trouble with \"normal\" segments","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"075451930f2272f5e6dec1e9767e7c68a23f9cbb","unresolved":false,"context_lines":[{"line_number":326,"context_line":"                    # Try releasing the segment using orphan driver"},{"line_number":327,"context_line":"                    # There could be something wrong with the type"},{"line_number":328,"context_line":"                    # driver that prompted the operator to disable"},{"line_number":329,"context_line":"                    # it in the first place."},{"line_number":330,"context_line":"                    try:"},{"line_number":331,"context_line":"                        driver.obj.release_segment(session, segment)"},{"line_number":332,"context_line":"                    except Exception:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_bec43a5f","line":329,"in_reply_to":"7a740942_c1761006","updated":"2015-12-10 04:30:11.000000000","message":"Was done based on earlier reviews. Since now, we\u0027ve a user/admin configured list we can remove this and leave it up.","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"68e7b207e897d13e81f68cca2c8db23db234674a","unresolved":false,"context_lines":[{"line_number":326,"context_line":"                    # Try releasing the segment using orphan driver"},{"line_number":327,"context_line":"                    # There could be something wrong with the type"},{"line_number":328,"context_line":"                    # driver that prompted the operator to disable"},{"line_number":329,"context_line":"                    # it in the first place."},{"line_number":330,"context_line":"                    try:"},{"line_number":331,"context_line":"                        driver.obj.release_segment(session, segment)"},{"line_number":332,"context_line":"                    except Exception:"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_c1761006","line":329,"in_reply_to":"7a740942_e1a9cc7c","updated":"2015-12-09 23:13:45.000000000","message":"moreover if a db exception is raised then the transaction is broken and transaction commit( or next query) will crash.","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"18d708e5e5274daa3c858306b3b1f43b0cde2905","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            if driver:"},{"line_number":281,"context_line":"                driver.obj.release_segment(session, segment)"},{"line_number":282,"context_line":"            else:"},{"line_number":283,"context_line":"                driver \u003d self.disabled_drivers.get(network_type)"},{"line_number":284,"context_line":"                if driver:"},{"line_number":285,"context_line":"                    LOG.info(_LI(\"Releasing segment \u0027%s\u0027 using \""},{"line_number":286,"context_line":"                                 \"disabled type driver.\"), segment)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a7e1126_8d684fbc","line":283,"updated":"2015-12-17 05:45:23.000000000","message":"instead of loading disabled drivers on startup,\nhave you considered to try to load the driver here,\nassuming the corresponding driver is (\u0027type_%s\u0027 % network_type) ?","commit_id":"ea257ee0fb536b9ec51b162721fbbee76cc262a4"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"d98278f67beb87ba8ea76b7f45ff359ea4378996","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            if driver:"},{"line_number":281,"context_line":"                driver.obj.release_segment(session, segment)"},{"line_number":282,"context_line":"            else:"},{"line_number":283,"context_line":"                driver \u003d self.disabled_drivers.get(network_type)"},{"line_number":284,"context_line":"                if driver:"},{"line_number":285,"context_line":"                    LOG.info(_LI(\"Releasing segment \u0027%s\u0027 using \""},{"line_number":286,"context_line":"                                 \"disabled type driver.\"), segment)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a7e1126_c90aa8d2","line":283,"in_reply_to":"3a7e1126_8d684fbc","updated":"2015-12-17 12:20:07.000000000","message":"There was a lot of back and forth on this very same issue. And finally we\u0027ve decided on this approach. \n\nThe problem with doing it here is many...\n1) It will not be thread safe, i.e. it\u0027ll be called in many LWPs\n2) For the very same reason mentioned above the loading will happen many time.\n\nYou can see the comments from Kevin, Cedric in the history and why we decided on this approach.","commit_id":"ea257ee0fb536b9ec51b162721fbbee76cc262a4"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"e9496ca7fc60456b1b0c1827c6482dfa78d78c67","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            if driver:"},{"line_number":281,"context_line":"                driver.obj.release_segment(session, segment)"},{"line_number":282,"context_line":"            else:"},{"line_number":283,"context_line":"                driver \u003d self.disabled_drivers.get(network_type)"},{"line_number":284,"context_line":"                if driver:"},{"line_number":285,"context_line":"                    LOG.info(_LI(\"Releasing segment \u0027%s\u0027 using \""},{"line_number":286,"context_line":"                                 \"disabled type driver.\"), segment)"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a7e1126_ac608a36","line":283,"in_reply_to":"3a7e1126_c90aa8d2","updated":"2015-12-17 12:39:17.000000000","message":"ok, i\u0027ll read the discussion.","commit_id":"ea257ee0fb536b9ec51b162721fbbee76cc262a4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2a5b6ba08e8c11046a56b50d3399ce4814a9558a","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    def __init__(self):"},{"line_number":45,"context_line":"        # Mapping from type name to DriverManager"},{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.disabled_drivers \u003d {}"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":50,"context_line":"                 cfg.CONF.ml2.type_drivers)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a7b0d38_484b3e5a","line":47,"updated":"2015-12-22 18:55:26.000000000","message":"Is my understanding correct in assuming that after the init phase this variable will contain all the registered type drivers minus the ones that have been specified in neutron.ml2.type_drivers?","commit_id":"b866c87b28be767c225484a1bef16618657c764b"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"69f9abbc4918840c39c2d42d0a1531befeeb24d6","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    def __init__(self):"},{"line_number":45,"context_line":"        # Mapping from type name to DriverManager"},{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.disabled_drivers \u003d {}"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":50,"context_line":"                 cfg.CONF.ml2.type_drivers)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a7b0d38_7c626eda","line":47,"in_reply_to":"1a7b0d38_484b3e5a","updated":"2015-12-23 02:33:52.000000000","message":"Yes, all of them in the namespace - the ones in \u0027type_drivers\u0027. Drivers for same types with different names, the first one will be picked and the rest will be ignored.","commit_id":"b866c87b28be767c225484a1bef16618657c764b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ebb80fa53f3af882ee69df7ecbb2b39e257dbefc","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    def __init__(self):"},{"line_number":45,"context_line":"        # Mapping from type name to DriverManager"},{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.disabled_drivers \u003d {}"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":50,"context_line":"                 cfg.CONF.ml2.type_drivers)"}],"source_content_type":"text/x-python","patch_set":14,"id":"da6ed579_b5ba19bf","line":47,"in_reply_to":"1a7b0d38_7c626eda","updated":"2016-01-18 10:32:54.000000000","message":"\"the first one will be picked and the rest will be ignored\" \u003d\u003e so we don\u0027t know what we will load","commit_id":"b866c87b28be767c225484a1bef16618657c764b"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"6e928a4b269117f3f6171a94ef366bd17738e791","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    def __init__(self):"},{"line_number":45,"context_line":"        # Mapping from type name to DriverManager"},{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.disabled_drivers \u003d {}"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":50,"context_line":"                 cfg.CONF.ml2.type_drivers)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a7b0d38_fc573ec8","line":47,"in_reply_to":"1a7b0d38_7c626eda","updated":"2015-12-23 02:43:44.000000000","message":"Do you see any issues with that?","commit_id":"b866c87b28be767c225484a1bef16618657c764b"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"e063361df3bc376900b7eeab67877cc53bb352fb","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    def __init__(self):"},{"line_number":45,"context_line":"        # Mapping from type name to DriverManager"},{"line_number":46,"context_line":"        self.drivers \u003d {}"},{"line_number":47,"context_line":"        self.disabled_drivers \u003d {}"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        LOG.info(_LI(\"Configured type driver names: %s\"),"},{"line_number":50,"context_line":"                 cfg.CONF.ml2.type_drivers)"}],"source_content_type":"text/x-python","patch_set":14,"id":"da6ed579_309b89cb","line":47,"in_reply_to":"da6ed579_b5ba19bf","updated":"2016-01-18 15:09:09.000000000","message":"As per the docs on stevedore http://docs.openstack.org/developer/stevedore/tutorial/loading.html\n\n\"The order the plugins are loaded is undefined, and depends on the order packages are found on the import path as well as the way the metadata files are read. If the order extensions are used matters, try the NamedExtensionManager.\"\n\nwhich is exactly I am trying to avoid because I am trying to avoid another config option. So yes, if there are redundant entries I believe we won\u0027t know what will be loaded first.\n\nBTW, in this existing code what would have guaranteed the order for names specified in type_drivers? It\u0027s the same case there too, since the \u0027name_order\u0027 option is not being used!","commit_id":"b866c87b28be767c225484a1bef16618657c764b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ebb80fa53f3af882ee69df7ecbb2b39e257dbefc","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                           \u0027type\u0027: network_type})"},{"line_number":69,"context_line":"            elif ext.name in cfg.CONF.ml2.type_drivers:"},{"line_number":70,"context_line":"                self.drivers[network_type] \u003d ext"},{"line_number":71,"context_line":"            elif network_type in self.disabled_drivers:"},{"line_number":72,"context_line":"                LOG.error(_LE(\"Type driver \u0027%(new_drv)s\u0027 ignored because \""},{"line_number":73,"context_line":"                              \"type driver \u0027%(old_drv)s\u0027 is already \""},{"line_number":74,"context_line":"                              \"registered for disabled type \u0027%(type)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"da6ed579_72483788","line":71,"range":{"start_line":71,"start_character":33,"end_line":71,"end_character":37},"updated":"2016-01-18 10:32:54.000000000","message":"We can have multiple \"disabled\" drivers (ie: not in cfg.CONF.ml2.type_drivers) supporting the same vif_type: typically a broken driver and a fixed driver ... what ensures we will load the right one? Indeed it\u0027s uneasy\n\nWe can end with 2 drivers(A,B)  for the vif_type if A is a disabled driver, B a driver and A is visited before B","commit_id":"b866c87b28be767c225484a1bef16618657c764b"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"e063361df3bc376900b7eeab67877cc53bb352fb","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                           \u0027type\u0027: network_type})"},{"line_number":69,"context_line":"            elif ext.name in cfg.CONF.ml2.type_drivers:"},{"line_number":70,"context_line":"                self.drivers[network_type] \u003d ext"},{"line_number":71,"context_line":"            elif network_type in self.disabled_drivers:"},{"line_number":72,"context_line":"                LOG.error(_LE(\"Type driver \u0027%(new_drv)s\u0027 ignored because \""},{"line_number":73,"context_line":"                              \"type driver \u0027%(old_drv)s\u0027 is already \""},{"line_number":74,"context_line":"                              \"registered for disabled type \u0027%(type)s\u0027\"),"}],"source_content_type":"text/x-python","patch_set":14,"id":"da6ed579_93b91f18","line":71,"range":{"start_line":71,"start_character":33,"end_line":71,"end_character":37},"in_reply_to":"da6ed579_72483788","updated":"2016-01-18 15:09:09.000000000","message":"Same explanation as above, the order cannot be specified based on what I understood from the stevedore docs. Same problem exists with the named type_drivers option in the current impl as well.\n\nIn any case we\u0027re looking at only the release segment code to work for broken driver case, and not all of its functionality!!!\n\nWith this patch, the assumption is \"if a name is specified in the \u0027type_drivers\u0027 option, the driver specified for that type in the namespace be \u0027a\u0027 good one.\n\nAren\u0027t these fair assumptions?","commit_id":"b866c87b28be767c225484a1bef16618657c764b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ebb80fa53f3af882ee69df7ecbb2b39e257dbefc","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":179,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def initialize(self):"},{"line_number":182,"context_line":"        for network_type, driver in six.iteritems(self.drivers):"},{"line_number":183,"context_line":"            LOG.info(_LI(\"Initializing driver for type \u0027%s\u0027\"), network_type)"},{"line_number":184,"context_line":"            driver.obj.initialize()"}],"source_content_type":"text/x-python","patch_set":14,"id":"da6ed579_d5330df5","line":181,"range":{"start_line":181,"start_character":8,"end_line":181,"end_character":18},"updated":"2016-01-18 10:32:54.000000000","message":"It means we initialize quite[1] every driver even if there are unused \u003d\u003e dead code running\n\n[1] at most one per vif_type","commit_id":"b866c87b28be767c225484a1bef16618657c764b"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"e063361df3bc376900b7eeab67877cc53bb352fb","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            network[provider.PHYSICAL_NETWORK] \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":179,"context_line":"            network[provider.SEGMENTATION_ID] \u003d segment[api.SEGMENTATION_ID]"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    def initialize(self):"},{"line_number":182,"context_line":"        for network_type, driver in six.iteritems(self.drivers):"},{"line_number":183,"context_line":"            LOG.info(_LI(\"Initializing driver for type \u0027%s\u0027\"), network_type)"},{"line_number":184,"context_line":"            driver.obj.initialize()"}],"source_content_type":"text/x-python","patch_set":14,"id":"da6ed579_0ecae2a1","line":181,"range":{"start_line":181,"start_character":8,"end_line":181,"end_character":18},"in_reply_to":"da6ed579_d5330df5","updated":"2016-01-18 15:09:09.000000000","message":"Yes. There was not a clean way to check whether a driver is already initialized or not, and doing it at release time is not feasible too!!!","commit_id":"b866c87b28be767c225484a1bef16618657c764b"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":14591,"name":"Lubosz Kosnik (diltram)","email":"lubosz.kosnik@intel.com","username":"diltram"},"change_message_id":"ebb0aa723e272e1cc669d7ef06463652b21bccce","unresolved":false,"context_lines":[{"line_number":1306,"context_line":"                   driver_api.PHYSICAL_NETWORK: \u0027physnet1\u0027,"},{"line_number":1307,"context_line":"                   driver_api.ID: 1,"},{"line_number":1308,"context_line":"                   driver_api.SEGMENTATION_ID: 1}"},{"line_number":1309,"context_line":"        with mock.patch(\u0027neutron.plugins.ml2.managers.LOG\u0027) as log:"},{"line_number":1310,"context_line":"            with mock.patch(\u0027neutron.plugins.ml2.managers.db\u0027) as db:"},{"line_number":1311,"context_line":"                db.get_network_segments.return_value \u003d (segment,)"},{"line_number":1312,"context_line":"                self.driver.type_manager.release_network_segments("}],"source_content_type":"text/x-python","patch_set":2,"id":"da85f559_af9bac71","line":1309,"updated":"2015-11-13 14:44:23.000000000","message":"It can be using one with statement divided by comma","commit_id":"e7a8e7d950a81a2450266295bcfc1a621d493638"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"9b26cd48f7f4b1e180943c8a533a95aedc6d1df4","unresolved":false,"context_lines":[{"line_number":1306,"context_line":"                   driver_api.PHYSICAL_NETWORK: \u0027physnet1\u0027,"},{"line_number":1307,"context_line":"                   driver_api.ID: 1,"},{"line_number":1308,"context_line":"                   driver_api.SEGMENTATION_ID: 1}"},{"line_number":1309,"context_line":"        with mock.patch(\u0027neutron.plugins.ml2.managers.LOG\u0027) as log:"},{"line_number":1310,"context_line":"            with mock.patch(\u0027neutron.plugins.ml2.managers.db\u0027) as db:"},{"line_number":1311,"context_line":"                db.get_network_segments.return_value \u003d (segment,)"},{"line_number":1312,"context_line":"                self.driver.type_manager.release_network_segments("}],"source_content_type":"text/x-python","patch_set":2,"id":"ba8a016a_5d917f98","line":1309,"in_reply_to":"da85f559_af9bac71","updated":"2015-11-17 12:06:19.000000000","message":"Done","commit_id":"e7a8e7d950a81a2450266295bcfc1a621d493638"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"27cf249bd78d6f9c7376121800e0abfc1b6c9365","unresolved":false,"context_lines":[{"line_number":1344,"context_line":"        self.assertEqual(\u0027vlan\u0027, network[\u0027network\u0027][pnet.NETWORK_TYPE])"},{"line_number":1345,"context_line":"        self.assertEqual(1, network[\u0027network\u0027][pnet.SEGMENTATION_ID])"},{"line_number":1346,"context_line":""},{"line_number":1347,"context_line":"    def test_release_segment_orphan_type_driver_vlan_IOError(self):"},{"line_number":1348,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"},{"line_number":1349,"context_line":"                            \u0027admin_state_up\u0027: True,"},{"line_number":1350,"context_line":"                            \u0027shared\u0027: False,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_5d565fd3","line":1347,"updated":"2015-11-17 12:13:01.000000000","message":"Added new vlan test cases to cover the errors while loading the orphan type drivers using ExtensionManager.","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"27cf249bd78d6f9c7376121800e0abfc1b6c9365","unresolved":false,"context_lines":[{"line_number":1565,"context_line":"        self.assertEqual(\u0027gre\u0027, network[\u0027network\u0027][pnet.NETWORK_TYPE])"},{"line_number":1566,"context_line":"        self.assertEqual(1, network[\u0027network\u0027][pnet.SEGMENTATION_ID])"},{"line_number":1567,"context_line":""},{"line_number":1568,"context_line":"    def test_release_segment_orphan_type_driver_gre_IOError(self):"},{"line_number":1569,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"},{"line_number":1570,"context_line":"                            \u0027admin_state_up\u0027: True,"},{"line_number":1571,"context_line":"                            \u0027shared\u0027: False,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba8a016a_3d627bae","line":1568,"updated":"2015-11-17 12:13:01.000000000","message":"Added new gre test cases to cover the errors while loading the orphan type drivers using ExtensionManager.","commit_id":"51d72351611e9be105850d2af0355652774879bd"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"751cde52df0cc30adf42a9c9d9b49fb3d1420b63","unresolved":false,"context_lines":[{"line_number":1282,"context_line":"                    \"Failed to release segment \u0027%s\u0027 because \""},{"line_number":1283,"context_line":"                    \"network type is not supported.\", segment)"},{"line_number":1284,"context_line":""},{"line_number":1285,"context_line":"    def test_release_segment_disabled_type_drivers_vlan(self):"},{"line_number":1286,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"},{"line_number":1287,"context_line":"                            \u0027admin_state_up\u0027: True,"},{"line_number":1288,"context_line":"                            \u0027shared\u0027: False,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_5774a234","line":1285,"updated":"2015-12-08 01:07:40.000000000","message":"it seems there is a lot of duplicated code between tests","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"0381d34a92df087570b1f114b8384519cbdf5a31","unresolved":false,"context_lines":[{"line_number":1282,"context_line":"                    \"Failed to release segment \u0027%s\u0027 because \""},{"line_number":1283,"context_line":"                    \"network type is not supported.\", segment)"},{"line_number":1284,"context_line":""},{"line_number":1285,"context_line":"    def test_release_segment_disabled_type_drivers_vlan(self):"},{"line_number":1286,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"},{"line_number":1287,"context_line":"                            \u0027admin_state_up\u0027: True,"},{"line_number":1288,"context_line":"                            \u0027shared\u0027: False,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_962d22aa","line":1285,"in_reply_to":"7a740942_5774a234","updated":"2015-12-08 07:48:10.000000000","message":"Done. Refactored code heavily to reduce duplication.","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"751cde52df0cc30adf42a9c9d9b49fb3d1420b63","unresolved":false,"context_lines":[{"line_number":1313,"context_line":"                mock.patch(\u0027neutron.plugins.ml2.managers.db\u0027) as db,\\"},{"line_number":1314,"context_line":"                mock.patch.object(type_vlan.VlanTypeDriver,"},{"line_number":1315,"context_line":"                                  \u0027release_segment\u0027) as rs:"},{"line_number":1316,"context_line":"                db.get_network.return_value \u003d data"},{"line_number":1317,"context_line":"                db.get_network_segments.return_value \u003d (segment,)"},{"line_number":1318,"context_line":"                self.driver.delete_network(self.context, network_id)"},{"line_number":1319,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_17a37ab3","line":1316,"updated":"2015-12-08 01:07:40.000000000","message":"incorrect indentation","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"0381d34a92df087570b1f114b8384519cbdf5a31","unresolved":false,"context_lines":[{"line_number":1313,"context_line":"                mock.patch(\u0027neutron.plugins.ml2.managers.db\u0027) as db,\\"},{"line_number":1314,"context_line":"                mock.patch.object(type_vlan.VlanTypeDriver,"},{"line_number":1315,"context_line":"                                  \u0027release_segment\u0027) as rs:"},{"line_number":1316,"context_line":"                db.get_network.return_value \u003d data"},{"line_number":1317,"context_line":"                db.get_network_segments.return_value \u003d (segment,)"},{"line_number":1318,"context_line":"                self.driver.delete_network(self.context, network_id)"},{"line_number":1319,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_59012d04","line":1316,"in_reply_to":"7a740942_17a37ab3","updated":"2015-12-08 07:48:10.000000000","message":"Done","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"751cde52df0cc30adf42a9c9d9b49fb3d1420b63","unresolved":false,"context_lines":[{"line_number":1352,"context_line":"                mock.patch(\u0027neutron.plugins.ml2.managers.db\u0027) as db,\\"},{"line_number":1353,"context_line":"                mock.patch.object(type_vlan.VlanTypeDriver,"},{"line_number":1354,"context_line":"                                  \u0027release_segment\u0027) as rs:"},{"line_number":1355,"context_line":"                db.get_network.return_value \u003d data"},{"line_number":1356,"context_line":"                db.get_network_segments.return_value \u003d (segment,)"},{"line_number":1357,"context_line":"                self.driver.delete_network(self.context, network_id)"},{"line_number":1358,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_d7a8928e","line":1355,"updated":"2015-12-08 01:07:40.000000000","message":"itto","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"0381d34a92df087570b1f114b8384519cbdf5a31","unresolved":false,"context_lines":[{"line_number":1352,"context_line":"                mock.patch(\u0027neutron.plugins.ml2.managers.db\u0027) as db,\\"},{"line_number":1353,"context_line":"                mock.patch.object(type_vlan.VlanTypeDriver,"},{"line_number":1354,"context_line":"                                  \u0027release_segment\u0027) as rs:"},{"line_number":1355,"context_line":"                db.get_network.return_value \u003d data"},{"line_number":1356,"context_line":"                db.get_network_segments.return_value \u003d (segment,)"},{"line_number":1357,"context_line":"                self.driver.delete_network(self.context, network_id)"},{"line_number":1358,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_7906691e","line":1355,"in_reply_to":"7a740942_d7a8928e","updated":"2015-12-08 07:48:10.000000000","message":"Done","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"751cde52df0cc30adf42a9c9d9b49fb3d1420b63","unresolved":false,"context_lines":[{"line_number":1360,"context_line":"                    \"No disabled_type_drivers configured.\")"},{"line_number":1361,"context_line":"                rs.assert_not_called()"},{"line_number":1362,"context_line":""},{"line_number":1363,"context_line":"    def test_release_segment_disabled_type_drivers_vlan_IOError(self):"},{"line_number":1364,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"},{"line_number":1365,"context_line":"                            \u0027admin_state_up\u0027: True,"},{"line_number":1366,"context_line":"                            \u0027shared\u0027: False,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_178a9a1b","line":1363,"updated":"2015-12-08 01:07:40.000000000","message":"it\u0027s not a unit test, it performs 2 tests","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"0381d34a92df087570b1f114b8384519cbdf5a31","unresolved":false,"context_lines":[{"line_number":1360,"context_line":"                    \"No disabled_type_drivers configured.\")"},{"line_number":1361,"context_line":"                rs.assert_not_called()"},{"line_number":1362,"context_line":""},{"line_number":1363,"context_line":"    def test_release_segment_disabled_type_drivers_vlan_IOError(self):"},{"line_number":1364,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"},{"line_number":1365,"context_line":"                            \u0027admin_state_up\u0027: True,"},{"line_number":1366,"context_line":"                            \u0027shared\u0027: False,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_36478e78","line":1363,"in_reply_to":"7a740942_178a9a1b","updated":"2015-12-08 07:48:10.000000000","message":"The second test is just a functional assertion. If there is any error from the orphan type driver during loading or release_segment call, the segment won\u0027t be released and segment ID can\u0027t be reused. The 2nd test just re-confirms that the segment ID can\u0027t be re-used.\n\nI added it because I thought that the functionality is complete with that 2nd assertion. Do you want me to remove that? If you think it is irrelevant and non-conforming, I\u0027ll remove it. It\u0027s not a must have check.","commit_id":"cc7c172745baf1d00b8287f488304e19c15f9174"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"403b34e9571dfb54befd6df6eda75071f25f0237","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"                                 test_bindings.PortBindingsVnicTestCaseMixin):"},{"line_number":1019,"context_line":"    pass"},{"line_number":1020,"context_line":""},{"line_number":1021,"context_line":""},{"line_number":1022,"context_line":"class TestMultiSegmentNetworks(Ml2PluginV2TestCase):"},{"line_number":1023,"context_line":""},{"line_number":1024,"context_line":"    def setUp(self, plugin\u003dNone):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_8c783ffa","line":1021,"updated":"2015-12-09 23:43:51.000000000","message":"it also affects mono segment?","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":18289,"name":"Sreekumar S","email":"sreesiv@gmail.com","username":"sreesiv"},"change_message_id":"075451930f2272f5e6dec1e9767e7c68a23f9cbb","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"                                 test_bindings.PortBindingsVnicTestCaseMixin):"},{"line_number":1019,"context_line":"    pass"},{"line_number":1020,"context_line":""},{"line_number":1021,"context_line":""},{"line_number":1022,"context_line":"class TestMultiSegmentNetworks(Ml2PluginV2TestCase):"},{"line_number":1023,"context_line":""},{"line_number":1024,"context_line":"    def setUp(self, plugin\u003dNone):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_dea2669a","line":1021,"in_reply_to":"7a740942_8c783ffa","updated":"2015-12-10 04:30:11.000000000","message":"Yes, it will. But isn\u0027t that a special case of Multi Segment as far as this issue goes. Or am I wrong in assuming that?\n\nShould I move these?","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c38916055765e1ae6feb5112c161cc92e5fd570f","unresolved":false,"context_lines":[{"line_number":1018,"context_line":"                                 test_bindings.PortBindingsVnicTestCaseMixin):"},{"line_number":1019,"context_line":"    pass"},{"line_number":1020,"context_line":""},{"line_number":1021,"context_line":""},{"line_number":1022,"context_line":"class TestMultiSegmentNetworks(Ml2PluginV2TestCase):"},{"line_number":1023,"context_line":""},{"line_number":1024,"context_line":"    def setUp(self, plugin\u003dNone):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a740942_74b9d978","line":1021,"in_reply_to":"7a740942_dea2669a","updated":"2015-12-10 23:05:33.000000000","message":"It concerns also mono segment as users can request to delete a mono-segment network on an orphan segment","commit_id":"352fe23374dff98b60a6b69b291e8bc9f7c3cd08"}]}
