)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Implement migration of legacy routers to distributed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch addresses the necessary changes required"},{"line_number":10,"context_line":"for the router migration or convertion from legacy"},{"line_number":11,"context_line":"to distributed."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Right now we will be supporting migration from legacy"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"baada198_4141f361","line":10,"updated":"2014-07-18 19:22:24.000000000","message":"nit: conversion","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Implement migration of legacy routers to distributed"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch addresses the necessary changes required"},{"line_number":10,"context_line":"for the router migration or convertion from legacy"},{"line_number":11,"context_line":"to distributed."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Right now we will be supporting migration from legacy"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"baada198_9a237004","line":10,"in_reply_to":"baada198_4141f361","updated":"2014-07-18 20:34:31.000000000","message":"will fit it.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1e8c7b880d83daa0110c080cd8bd4bc3d6430b12","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     1b621fc8 (Merge \"Split up metering test case into plugin + test case\")"},{"line_number":2,"context_line":"Author:     Carl Baldwin \u003ccarl.baldwin@hp.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2014-07-09 19:44:31 +0000"},{"line_number":4,"context_line":"Commit:     Swaminathan Vasudevan \u003cswaminathan.vasudevan@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-07-21 22:54:22 -0700"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"baada198_b98406d4","line":2,"updated":"2014-07-23 15:52:38.000000000","message":"I probably won\u0027t be the principle author of this patch.  Mike, Swami, or whoever will be the principle author should run \u0027git commit\u0027 with \u0027--reset-author\u0027 to change the author line here.  e.g. ...\n\n% git commit --amend --reset-author\n\nI don\u0027t feel comfortable taking the credit if I didn\u0027t actually do the work.  ;)","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"}],"neutron/common/constants.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":20,"context_line":"NET_STATUS_DOWN \u003d \u0027DOWN\u0027"},{"line_number":21,"context_line":"NET_STATUS_ERROR \u003d \u0027ERROR\u0027"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED \u003d \"LEG-TO-DIST\""},{"line_number":24,"context_line":"ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY \u003d \"DIST-TO-LEG\""},{"line_number":25,"context_line":"ROUTER_MIG_STATUS_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_24efad1f","line":23,"updated":"2014-07-18 19:22:24.000000000","message":"I don\u0027t want to sound pedantic, but what about:\n\nROUTER_STATUS_LEGACY_TO_DVR \u003d \u0027TO_DVR\u0027\n\nit\u0027s much shorter than:\n\nROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":20,"context_line":"NET_STATUS_DOWN \u003d \u0027DOWN\u0027"},{"line_number":21,"context_line":"NET_STATUS_ERROR \u003d \u0027ERROR\u0027"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED \u003d \"LEG-TO-DIST\""},{"line_number":24,"context_line":"ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY \u003d \"DIST-TO-LEG\""},{"line_number":25,"context_line":"ROUTER_MIG_STATUS_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_3a32645e","line":23,"in_reply_to":"baada198_24efad1f","updated":"2014-07-18 20:34:31.000000000","message":"Understood, will fix it.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":21,"context_line":"NET_STATUS_ERROR \u003d \u0027ERROR\u0027"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED \u003d \"LEG-TO-DIST\""},{"line_number":24,"context_line":"ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY \u003d \"DIST-TO-LEG\""},{"line_number":25,"context_line":"ROUTER_MIG_STATUS_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"ROUTER_STATUS_DOWN \u003d \u0027DOWN\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_64f525ec","line":24,"updated":"2014-07-18 19:22:24.000000000","message":"this could be:\n\nROUTER_STATUS_DVR_TO_LEGACY\n\nBut according the comment on next file not sure this makes sense.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":21,"context_line":"NET_STATUS_ERROR \u003d \u0027ERROR\u0027"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED \u003d \"LEG-TO-DIST\""},{"line_number":24,"context_line":"ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY \u003d \"DIST-TO-LEG\""},{"line_number":25,"context_line":"ROUTER_MIG_STATUS_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"ROUTER_STATUS_DOWN \u003d \u0027DOWN\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_5a37184d","line":24,"in_reply_to":"baada198_64f525ec","updated":"2014-07-18 20:34:31.000000000","message":"Will fix it.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED \u003d \"LEG-TO-DIST\""},{"line_number":24,"context_line":"ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY \u003d \"DIST-TO-LEG\""},{"line_number":25,"context_line":"ROUTER_MIG_STATUS_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"ROUTER_STATUS_DOWN \u003d \u0027DOWN\u0027"},{"line_number":28,"context_line":"ROUTER_STATUS_ERROR \u003d \u0027ERROR\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_84c4f992","line":25,"updated":"2014-07-18 19:22:24.000000000","message":"Do we need to distinguish between this and ROUTER_STATUS_ERROR?","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED \u003d \"LEG-TO-DIST\""},{"line_number":24,"context_line":"ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY \u003d \"DIST-TO-LEG\""},{"line_number":25,"context_line":"ROUTER_MIG_STATUS_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"ROUTER_STATUS_DOWN \u003d \u0027DOWN\u0027"},{"line_number":28,"context_line":"ROUTER_STATUS_ERROR \u003d \u0027ERROR\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_7a269c17","line":25,"in_reply_to":"baada198_84c4f992","updated":"2014-07-18 20:34:31.000000000","message":"Yes, it would be helpful to have an error state just for the migration, so that people can track it down.\r\nThis should be different than the regular error.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0dc89a6ca454615bef7c6c6d852fdb5f527655b9","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_STATUS_LEGACY_TO_DVR \u003d \"LEGACY-TO-DVR\""},{"line_number":24,"context_line":"ROUTER_STATUS_DVR_TO_LEGACY \u003d \"DVR-TO-LEGACY\""},{"line_number":25,"context_line":"ROUTER_STATUS_MIGRATION_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"PORT_STATUS_ACTIVE \u003d \u0027ACTIVE\u0027"},{"line_number":28,"context_line":"PORT_STATUS_BUILD \u003d \u0027BUILD\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_9dd24afb","line":25,"updated":"2014-07-28 09:39:29.000000000","message":"I might be mistaken but I\u0027ve not seen the constants at lines 24 and 25 used in the rest of this patch.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"442dec7678cdc897decdc3e31910907f52c5e778","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_STATUS_LEGACY_TO_DVR \u003d \"LEGACY-TO-DVR\""},{"line_number":24,"context_line":"ROUTER_STATUS_DVR_TO_LEGACY \u003d \"DVR-TO-LEGACY\""},{"line_number":25,"context_line":"ROUTER_STATUS_MIGRATION_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"PORT_STATUS_ACTIVE \u003d \u0027ACTIVE\u0027"},{"line_number":28,"context_line":"PORT_STATUS_BUILD \u003d \u0027BUILD\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_bd29353c","line":25,"in_reply_to":"baada198_5e1c0c66","updated":"2014-07-31 15:08:45.000000000","message":"Should this be a WIP?","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d6c077d89fc67d81eba8cdd0b911eadf9652307","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_STATUS_LEGACY_TO_DVR \u003d \"LEGACY-TO-DVR\""},{"line_number":24,"context_line":"ROUTER_STATUS_DVR_TO_LEGACY \u003d \"DVR-TO-LEGACY\""},{"line_number":25,"context_line":"ROUTER_STATUS_MIGRATION_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"PORT_STATUS_ACTIVE \u003d \u0027ACTIVE\u0027"},{"line_number":28,"context_line":"PORT_STATUS_BUILD \u003d \u0027BUILD\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_5e1c0c66","line":25,"in_reply_to":"baada198_9dd24afb","updated":"2014-07-28 23:23:15.000000000","message":"Hi salvatore,\nYes it will be used by the scheduler. Will be adding in the scheduler code.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"57a8e83b0343eeac74ad84b7a4f90c54b2762897","unresolved":false,"context_lines":[{"line_number":21,"context_line":"NET_STATUS_ERROR \u003d \u0027ERROR\u0027"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_STATUS_LEGACY_TO_DVR \u003d \"LEGACY-TO-DVR\""},{"line_number":24,"context_line":"ROUTER_STATUS_DVR_TO_LEGACY \u003d \"DVR-TO-LEGACY\""},{"line_number":25,"context_line":"ROUTER_STATUS_MIGRATION_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"PORT_STATUS_ACTIVE \u003d \u0027ACTIVE\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_fddee53c","line":24,"updated":"2014-09-15 00:22:37.000000000","message":"This and the next constant don\u0027t seem to have been used anywhere.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"b3e4df51c6a11e66b7eddd2ee659608eac4dbc38","unresolved":false,"context_lines":[{"line_number":21,"context_line":"NET_STATUS_ERROR \u003d \u0027ERROR\u0027"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"ROUTER_STATUS_LEGACY_TO_DVR \u003d \"LEGACY-TO-DVR\""},{"line_number":24,"context_line":"ROUTER_STATUS_DVR_TO_LEGACY \u003d \"DVR-TO-LEGACY\""},{"line_number":25,"context_line":"ROUTER_STATUS_MIGRATION_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"PORT_STATUS_ACTIVE \u003d \u0027ACTIVE\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_4aa389b1","line":24,"in_reply_to":"fa98f980_fddee53c","updated":"2014-09-16 15:48:16.000000000","message":"These were added for future use.  Initially we will only support migration from Legacy to DVR, not DVR to Legacy.  Additionally, we may need to mark the state as an error at some point.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":704,"name":"Edgar Magana","email":"emagana@gmail.com","username":"emagana"},"change_message_id":"c614e983317c249f791ef41ebe8c50effaa352ce","unresolved":false,"context_lines":[{"line_number":23,"context_line":"ROUTER_STATUS_ACTIVE \u003d \"ACTIVE\""},{"line_number":24,"context_line":"ROUTER_STATUS_LEGACY_TO_DVR \u003d \"LEGACY-TO-DVR\""},{"line_number":25,"context_line":"ROUTER_STATUS_DVR_TO_LEGACY \u003d \"DVR-TO-LEGACY\""},{"line_number":26,"context_line":"ROUTER_STATUS_MIGRATION_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"PORT_STATUS_ACTIVE \u003d \u0027ACTIVE\u0027"},{"line_number":29,"context_line":"PORT_STATUS_BUILD \u003d \u0027BUILD\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a8c0949_49833704","line":26,"updated":"2014-11-05 11:14:20.000000000","message":"Is is really needed to have the migration constants as permanent entries in the tree for a process that just going to happen in one or max two release cycles?\nI am not against the migration of course, I suggest to not have these two constants at all:\nROUTER_STATUS_LEGACY_TO_DVR \u003d \"LEGACY-TO-DVR\"\nROUTER_STATUS_DVR_TO_LEGACY \u003d \"DVR-TO-LEGACY\"\n\nWe can also have more generic names for DVR migration such as:\nROUTER_MIGRATION_STATUS \u003d \"...\n\nWhy do we need Migration from Legacy to DVR, that for me should not be a supported use case. IMHO","commit_id":"0faabf4f56fcc141e2633c15f752cf2aab3f5acf"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"67daedc7d2f6de5e0364fa48832e2d21640b1afb","unresolved":false,"context_lines":[{"line_number":23,"context_line":"ROUTER_STATUS_ACTIVE \u003d \"ACTIVE\""},{"line_number":24,"context_line":"ROUTER_STATUS_LEGACY_TO_DVR \u003d \"LEGACY-TO-DVR\""},{"line_number":25,"context_line":"ROUTER_STATUS_DVR_TO_LEGACY \u003d \"DVR-TO-LEGACY\""},{"line_number":26,"context_line":"ROUTER_STATUS_MIGRATION_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"PORT_STATUS_ACTIVE \u003d \u0027ACTIVE\u0027"},{"line_number":29,"context_line":"PORT_STATUS_BUILD \u003d \u0027BUILD\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a8c0949_8545fb18","line":26,"in_reply_to":"7a8c0949_49833704","updated":"2014-11-05 17:10:25.000000000","message":"I think the most common case will be the legacy to DVR case.  Most people will only have legacy routers and will want to migrate them to DVR with the least impact.  That is the point of this patch.\nWe could make them more generic I suppose and remove the \"DVR\" part of the name.  I\u0027d like to hear more from the community when it comes to name change debates.","commit_id":"0faabf4f56fcc141e2633c15f752cf2aab3f5acf"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"adbd634b0c9259a31404cbb16bc241dee75d3ac1","unresolved":false,"context_lines":[{"line_number":23,"context_line":"ROUTER_STATUS_ACTIVE \u003d \"ACTIVE\""},{"line_number":24,"context_line":"ROUTER_STATUS_LEGACY_TO_DVR \u003d \"LEGACY-TO-DVR\""},{"line_number":25,"context_line":"ROUTER_STATUS_DVR_TO_LEGACY \u003d \"DVR-TO-LEGACY\""},{"line_number":26,"context_line":"ROUTER_STATUS_MIGRATION_ERROR \u003d \"MIGRATION-ERROR\""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"PORT_STATUS_ACTIVE \u003d \u0027ACTIVE\u0027"},{"line_number":29,"context_line":"PORT_STATUS_BUILD \u003d \u0027BUILD\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a8c0949_65e9ef7f","line":26,"in_reply_to":"7a8c0949_49833704","updated":"2014-11-05 17:47:19.000000000","message":"We won\u0027t know when users are ready to make the migration, that can happen when they are comfortable. This means that we might want to keep legacy router support for quite a while.\n\nAlternatively we might want to deprecate legacy routers sooner rather than later (M?), in which case we can drop these constants when the legacy router support gets dropped. In the meantime I don\u0027t think this is the biggest problem I see with this patch.","commit_id":"0faabf4f56fcc141e2633c15f752cf2aab3f5acf"}],"neutron/db/l3_agentschedulers_db.py":[{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"81a0affa78179a0df5322a1c95619693442b788f","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        \"\"\""},{"line_number":216,"context_line":"        cur_agents \u003d self.list_l3_agents_hosting_router("},{"line_number":217,"context_line":"            context, router_id)[\u0027agents\u0027]"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        for agent in cur_agents:"},{"line_number":220,"context_line":"            self._unbind_router(context, router_id, agent[\u0027id\u0027])"},{"line_number":221,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_6ecf9756","line":218,"updated":"2014-08-21 22:50:13.000000000","message":"I was hitting db errors due to multiple session.begin calls deeper in the call stack.  Since the lower levels of _unbind_router and schedule_router() have session.begin calls, I figured it was safe to remove this higher level one.  If someone thinks there is a better way - please comment.","commit_id":"fc6e912542ef339c359d6ca2e641021e74e0c01b"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"81a0affa78179a0df5322a1c95619693442b788f","unresolved":false,"context_lines":[{"line_number":232,"context_line":"            for agent in cur_agents:"},{"line_number":233,"context_line":"                l3_notifier.router_removed_from_agent("},{"line_number":234,"context_line":"                    context, router_id, agent[\u0027host\u0027])"},{"line_number":235,"context_line":"            for added_agent in new_agents:"},{"line_number":236,"context_line":"                l3_notifier.router_added_to_agent("},{"line_number":237,"context_line":"                    context, [router_id], added_agent[\u0027host\u0027])"},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_ee0ac788","line":235,"updated":"2014-08-21 22:50:13.000000000","message":"In the DVR case, we were were not notifying all the new agents, only ONE.","commit_id":"fc6e912542ef339c359d6ca2e641021e74e0c01b"}],"neutron/db/l3_dvr_db.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d3fc8665cc8934dcc7585b9d57eba1a45ab98a46","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                       \"is not supported\"), router_db[\u0027id\u0027])"},{"line_number":75,"context_line":"            raise NotImplementedError()"},{"line_number":76,"context_line":"        elif (not router_db.extra_attributes.distributed and"},{"line_number":77,"context_line":"            router_res.get(\u0027distributed\u0027)):"},{"line_number":78,"context_line":"            # TODO(carl_baldwin): revise centralized-\u003edistributed migration"},{"line_number":79,"context_line":"            LOG.info(_(\"Distributing centralized router: %s\"), router_db[\u0027id\u0027])"},{"line_number":80,"context_line":"            raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_3aa8afda","line":77,"updated":"2014-07-11 14:40:26.000000000","message":"Grrr.  I must have deleted some characters here","commit_id":"ae82c0751dbf33ead80b4d5937cf4c9c949e4de1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            router_res.get(\u0027distributed\u0027) is False):"},{"line_number":73,"context_line":"            LOG.info(_(\"Centralizing distributed router %s \""},{"line_number":74,"context_line":"                       \"is not supported\"), router_db[\u0027id\u0027])"},{"line_number":75,"context_line":"            router_db[\u0027status\u0027] \u003d ("},{"line_number":76,"context_line":"                l3_const.ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY)"},{"line_number":77,"context_line":"            raise NotImplementedError()"},{"line_number":78,"context_line":"        elif (not router_db.extra_attributes.distributed and"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_443e618c","line":75,"updated":"2014-07-18 19:22:24.000000000","message":"not sure this makes sense. The status won\u0027t be stored because of the Exception and following rollback. Am I missing something?","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            router_res.get(\u0027distributed\u0027) is False):"},{"line_number":73,"context_line":"            LOG.info(_(\"Centralizing distributed router %s \""},{"line_number":74,"context_line":"                       \"is not supported\"), router_db[\u0027id\u0027])"},{"line_number":75,"context_line":"            router_db[\u0027status\u0027] \u003d ("},{"line_number":76,"context_line":"                l3_const.ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY)"},{"line_number":77,"context_line":"            raise NotImplementedError()"},{"line_number":78,"context_line":"        elif (not router_db.extra_attributes.distributed and"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_9aa0d091","line":75,"in_reply_to":"baada198_443e618c","updated":"2014-07-18 20:34:31.000000000","message":"Will fix it.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":79,"context_line":"              router_res.get(\u0027distributed\u0027) is True):"},{"line_number":80,"context_line":"            router_db[\u0027status\u0027] \u003d ("},{"line_number":81,"context_line":"                l3_const.ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED)"},{"line_number":82,"context_line":"        else:"},{"line_number":83,"context_line":"            LOG.info(\"Regular Router Update\")"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _update_distributed_attr("}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_c4ba710a","line":82,"updated":"2014-07-18 19:22:24.000000000","message":"this else block can be omitted IMO","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":79,"context_line":"              router_res.get(\u0027distributed\u0027) is True):"},{"line_number":80,"context_line":"            router_db[\u0027status\u0027] \u003d ("},{"line_number":81,"context_line":"                l3_const.ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED)"},{"line_number":82,"context_line":"        else:"},{"line_number":83,"context_line":"            LOG.info(\"Regular Router Update\")"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _update_distributed_attr("}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_7aca1c50","line":82,"in_reply_to":"baada198_c4ba710a","updated":"2014-07-18 20:34:31.000000000","message":"Will fix it.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                L3_NAT_with_dvr_db_mixin, self)._update_router_db("},{"line_number":101,"context_line":"                    context, router_id, data, gw_info)"},{"line_number":102,"context_line":"            self._validate_router_migration(router_db, data)"},{"line_number":103,"context_line":"            # FIXME(swami): need to add migration status so that the scheduler"},{"line_number":104,"context_line":"            # can pick the migration request and move stuff over. For now"},{"line_number":105,"context_line":"            # only the distributed flag and router interface\u0027s owner change."},{"line_number":106,"context_line":"            # Instead of complaining on _validate_router_migration, let\u0027s"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_c4c43162","line":103,"updated":"2014-07-18 19:22:24.000000000","message":"this FIXME maybe out of date.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                L3_NAT_with_dvr_db_mixin, self)._update_router_db("},{"line_number":101,"context_line":"                    context, router_id, data, gw_info)"},{"line_number":102,"context_line":"            self._validate_router_migration(router_db, data)"},{"line_number":103,"context_line":"            # FIXME(swami): need to add migration status so that the scheduler"},{"line_number":104,"context_line":"            # can pick the migration request and move stuff over. For now"},{"line_number":105,"context_line":"            # only the distributed flag and router interface\u0027s owner change."},{"line_number":106,"context_line":"            # Instead of complaining on _validate_router_migration, let\u0027s"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_bac0342c","line":103,"in_reply_to":"baada198_c4c43162","updated":"2014-07-18 20:34:31.000000000","message":"Will remove it.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":111,"context_line":"            router \u003d self._get_router(context, router_id)"},{"line_number":112,"context_line":"            gw_port \u003d router.gw_port"},{"line_number":113,"context_line":"            if (not gw_port is None) and ("},{"line_number":114,"context_line":"                router[\u0027status\u0027] \u003d\u003d l3_const."},{"line_number":115,"context_line":"                    ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED):"},{"line_number":116,"context_line":"                snat_p_list \u003d self.create_snat_intf_ports_if_not_exists("}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_a4481d2e","line":113,"updated":"2014-07-18 19:22:24.000000000","message":"this can be:\n\n  if gw_port and router[\u0027status\u0027] \u003d\u003d ...:\n\nWhy did you do it this way? Am I missing something?","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":111,"context_line":"            router \u003d self._get_router(context, router_id)"},{"line_number":112,"context_line":"            gw_port \u003d router.gw_port"},{"line_number":113,"context_line":"            if (not gw_port is None) and ("},{"line_number":114,"context_line":"                router[\u0027status\u0027] \u003d\u003d l3_const."},{"line_number":115,"context_line":"                    ROUTER_MIG_STATUS_LEGACY_TO_DISTRIBUTED):"},{"line_number":116,"context_line":"                snat_p_list \u003d self.create_snat_intf_ports_if_not_exists("}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_dabde8b2","line":113,"in_reply_to":"baada198_a4481d2e","updated":"2014-07-18 20:34:31.000000000","message":"You are right. I will fix it.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                if not snat_p_list:"},{"line_number":119,"context_line":"                    LOG.debug(\"SNAT interface ports not created: %s\","},{"line_number":120,"context_line":"                               snat_p_list)"},{"line_number":121,"context_line":"            if (not gw_port is None) and ("},{"line_number":122,"context_line":"                router[\u0027status\u0027] \u003d\u003d l3_const."},{"line_number":123,"context_line":"                    ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY):"},{"line_number":124,"context_line":"                self.delete_csnat_router_interface_ports("}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_c4727149","line":121,"updated":"2014-07-18 19:22:24.000000000","message":"We should never reach here. Unless we plan to support the DVR to Legacy case.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5bd707c52d5760a845c47108462f5a0a88521462","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                if not snat_p_list:"},{"line_number":119,"context_line":"                    LOG.debug(\"SNAT interface ports not created: %s\","},{"line_number":120,"context_line":"                               snat_p_list)"},{"line_number":121,"context_line":"            if (not gw_port is None) and ("},{"line_number":122,"context_line":"                router[\u0027status\u0027] \u003d\u003d l3_const."},{"line_number":123,"context_line":"                    ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY):"},{"line_number":124,"context_line":"                self.delete_csnat_router_interface_ports("}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_b57da5b4","line":121,"in_reply_to":"baada198_bad754ed","updated":"2014-07-18 21:17:51.000000000","message":"thing is this code is unreachable under the current circumstances...so it\u0027s going to inevitably rot without us knowing.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                if not snat_p_list:"},{"line_number":119,"context_line":"                    LOG.debug(\"SNAT interface ports not created: %s\","},{"line_number":120,"context_line":"                               snat_p_list)"},{"line_number":121,"context_line":"            if (not gw_port is None) and ("},{"line_number":122,"context_line":"                router[\u0027status\u0027] \u003d\u003d l3_const."},{"line_number":123,"context_line":"                    ROUTER_MIG_STATUS_DISTRIBUTED_TO_LEGACY):"},{"line_number":124,"context_line":"                self.delete_csnat_router_interface_ports("}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_bad754ed","line":121,"in_reply_to":"baada198_c4727149","updated":"2014-07-18 20:34:31.000000000","message":"I thought if we do support this in future, then we can still leave it there.\r\nBut if you feel that we have to remove it, then we can remove it.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"94b2ee9edc25f2d2d7a62403320dde882576a0e5","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port\u0027)"},{"line_number":185,"context_line":"            self.delete_floatingip_agent_gateway_port(admin_ctx, fip_hostid)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def delete_floatingip(self, context, id):"},{"line_number":188,"context_line":"        floatingip \u003d self._get_floatingip(context, id)"},{"line_number":189,"context_line":"        router_id \u003d floatingip[\u0027router_id\u0027]"},{"line_number":190,"context_line":"        router \u003d self._get_router(context, router_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_041389b8","line":187,"updated":"2014-07-18 19:22:24.000000000","message":"I wonder if we can break out the super function to minimize code dup here. You could move the with block in its own method (_delete_floatingip_db) and override it to do lines 190-200 call the super method and then do lines 206-209. Your call.","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"63bcfc31823cdc614d1939592a38f7070bf019c2","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port\u0027)"},{"line_number":185,"context_line":"            self.delete_floatingip_agent_gateway_port(admin_ctx, fip_hostid)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def delete_floatingip(self, context, id):"},{"line_number":188,"context_line":"        floatingip \u003d self._get_floatingip(context, id)"},{"line_number":189,"context_line":"        router_id \u003d floatingip[\u0027router_id\u0027]"},{"line_number":190,"context_line":"        router \u003d self._get_router(context, router_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_1a0a008a","line":187,"in_reply_to":"baada198_041389b8","updated":"2014-07-18 20:34:31.000000000","message":"Will fix it","commit_id":"0c221b9a70c2e9d6ec04fb621feb12dd092c4620"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f4dbaedaf10de0768adde661367f9df9001ee007","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        port_db \u003d self._core_plugin._get_port("},{"line_number":174,"context_line":"            context, floatingip_db[\u0027fixed_port_id\u0027])"},{"line_number":175,"context_line":"        fip_hostid \u003d self.get_vm_port_hostid(context, port_db[\u0027id\u0027])"},{"line_number":176,"context_line":"        if fip_hostid:"},{"line_number":177,"context_line":"            agt_gw_flag \u003d self.check_fips_availability_on_host("},{"line_number":178,"context_line":"                context, fip_id, fip_hostid)"},{"line_number":179,"context_line":"            return agt_gw_flag, fip_hostid"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_4731fca0","line":176,"updated":"2014-07-19 00:04:30.000000000","message":"I think that in case fip_hostid is None, you\u0027ll get a:\n\n   TypeError: \u0027NoneType\u0027 object is not iterable\n\nin line 158 or 189","commit_id":"70b8f9ce97a075daff5d84d135188ee8bf533dcc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"dca289dc0799f50fac6d2b27520e420463f873d3","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        port_db \u003d self._core_plugin._get_port("},{"line_number":174,"context_line":"            context, floatingip_db[\u0027fixed_port_id\u0027])"},{"line_number":175,"context_line":"        fip_hostid \u003d self.get_vm_port_hostid(context, port_db[\u0027id\u0027])"},{"line_number":176,"context_line":"        if fip_hostid:"},{"line_number":177,"context_line":"            agt_gw_flag \u003d self.check_fips_availability_on_host("},{"line_number":178,"context_line":"                context, fip_id, fip_hostid)"},{"line_number":179,"context_line":"            return agt_gw_flag, fip_hostid"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_aac37f88","line":176,"in_reply_to":"baada198_274a4883","updated":"2014-07-19 00:59:45.000000000","message":"it depends; is fip_hostid always supposed to be there, or are there circumstances where it\u0027s ok it\u0027s missing? From the code I assumed it was the latter..but then there\u0027s an error how the return value of this method is handled.","commit_id":"70b8f9ce97a075daff5d84d135188ee8bf533dcc"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"200a5068d628344e3698c6d6099265cfaaafbaa9","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        port_db \u003d self._core_plugin._get_port("},{"line_number":174,"context_line":"            context, floatingip_db[\u0027fixed_port_id\u0027])"},{"line_number":175,"context_line":"        fip_hostid \u003d self.get_vm_port_hostid(context, port_db[\u0027id\u0027])"},{"line_number":176,"context_line":"        if fip_hostid:"},{"line_number":177,"context_line":"            agt_gw_flag \u003d self.check_fips_availability_on_host("},{"line_number":178,"context_line":"                context, fip_id, fip_hostid)"},{"line_number":179,"context_line":"            return agt_gw_flag, fip_hostid"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_274a4883","line":176,"in_reply_to":"baada198_4731fca0","updated":"2014-07-19 00:40:04.000000000","message":"Do you want to raise an error in case of \"fip_hostid\" is None  before returning the value.\nAnd only if not None, then return the value.\nLet me know your thoughts.","commit_id":"70b8f9ce97a075daff5d84d135188ee8bf533dcc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"549101249739c8bcd19b7f4429ca331589d0ecee","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        port_db \u003d self._core_plugin._get_port("},{"line_number":174,"context_line":"            context, floatingip_db[\u0027fixed_port_id\u0027])"},{"line_number":175,"context_line":"        fip_hostid \u003d self.get_vm_port_hostid(context, port_db[\u0027id\u0027])"},{"line_number":176,"context_line":"        if fip_hostid:"},{"line_number":177,"context_line":"            agt_gw_flag \u003d self.check_fips_availability_on_host("},{"line_number":178,"context_line":"                context, fip_id, fip_hostid)"},{"line_number":179,"context_line":"            return agt_gw_flag, fip_hostid"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_ecd47e48","line":176,"in_reply_to":"baada198_568dfa7a","updated":"2014-07-21 19:05:22.000000000","message":"so why do you check if it is not?","commit_id":"70b8f9ce97a075daff5d84d135188ee8bf533dcc"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"2745be2f8d5e0ef7b57d2aa2ebac27edd728776c","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        port_db \u003d self._core_plugin._get_port("},{"line_number":174,"context_line":"            context, floatingip_db[\u0027fixed_port_id\u0027])"},{"line_number":175,"context_line":"        fip_hostid \u003d self.get_vm_port_hostid(context, port_db[\u0027id\u0027])"},{"line_number":176,"context_line":"        if fip_hostid:"},{"line_number":177,"context_line":"            agt_gw_flag \u003d self.check_fips_availability_on_host("},{"line_number":178,"context_line":"                context, fip_id, fip_hostid)"},{"line_number":179,"context_line":"            return agt_gw_flag, fip_hostid"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_568dfa7a","line":176,"in_reply_to":"baada198_aac37f88","updated":"2014-07-21 17:23:48.000000000","message":"Yes \"fip_hostid\" is always supposted to be there. The fip ports will always have a port-binding that is associated to its host and so will return a valid host_id.","commit_id":"70b8f9ce97a075daff5d84d135188ee8bf533dcc"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"2c0ae2373eef1b9aa36343b80746556d931aca55","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            router_db.extra_attributes.update(data)"},{"line_number":100,"context_line":"            self._update_distributed_attr("},{"line_number":101,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":102,"context_line":"            router \u003d self._get_router(context, router_id)"},{"line_number":103,"context_line":"            gw_port \u003d router.gw_port"},{"line_number":104,"context_line":"            if gw_port and router[\u0027status\u0027] \u003d\u003d ("},{"line_number":105,"context_line":"                l3_const.ROUTER_STATUS_LEGACY_TO_DVR):"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_9885cad1","line":102,"updated":"2014-07-22 11:47:38.000000000","message":"why fetching router again?","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"784d722f822abeef1e5b5e28769501702348d57c","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":102,"context_line":"            router \u003d self._get_router(context, router_id)"},{"line_number":103,"context_line":"            gw_port \u003d router.gw_port"},{"line_number":104,"context_line":"            if gw_port and router[\u0027status\u0027] \u003d\u003d ("},{"line_number":105,"context_line":"                l3_const.ROUTER_STATUS_LEGACY_TO_DVR):"},{"line_number":106,"context_line":"                snat_p_list \u003d self.create_snat_intf_ports_if_not_exists("},{"line_number":107,"context_line":"                    context.elevated(), router[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_0de1812a","line":104,"updated":"2014-07-22 10:05:18.000000000","message":"can gw_port be None? If yes can you please add a comment explaining that?","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3f09f6ded8dbaba34acd69e13cd15d6eebe0a891","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":102,"context_line":"            router \u003d self._get_router(context, router_id)"},{"line_number":103,"context_line":"            gw_port \u003d router.gw_port"},{"line_number":104,"context_line":"            if gw_port and router[\u0027status\u0027] \u003d\u003d ("},{"line_number":105,"context_line":"                l3_const.ROUTER_STATUS_LEGACY_TO_DVR):"},{"line_number":106,"context_line":"                snat_p_list \u003d self.create_snat_intf_ports_if_not_exists("},{"line_number":107,"context_line":"                    context.elevated(), router[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_5d8f8b2e","line":104,"in_reply_to":"baada198_0de1812a","updated":"2014-07-22 17:13:16.000000000","message":"Yes, gateway port can be None, when you create a router, we don\u0027t set or assign gateway immediately. \nFor a DVR to function we don\u0027t need to set a gateway for the East-West routing.","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"784d722f822abeef1e5b5e28769501702348d57c","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                snat_p_list \u003d self.create_snat_intf_ports_if_not_exists("},{"line_number":107,"context_line":"                    context.elevated(), router[\u0027id\u0027])"},{"line_number":108,"context_line":"                if not snat_p_list:"},{"line_number":109,"context_line":"                    LOG.debug(\"SNAT interface ports not created: %s\","},{"line_number":110,"context_line":"                              snat_p_list)"},{"line_number":111,"context_line":"            return router_db"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_6d1d9d62","line":109,"updated":"2014-07-22 10:05:18.000000000","message":"if this is an error condition consider raising the log level","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3f09f6ded8dbaba34acd69e13cd15d6eebe0a891","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                snat_p_list \u003d self.create_snat_intf_ports_if_not_exists("},{"line_number":107,"context_line":"                    context.elevated(), router[\u0027id\u0027])"},{"line_number":108,"context_line":"                if not snat_p_list:"},{"line_number":109,"context_line":"                    LOG.debug(\"SNAT interface ports not created: %s\","},{"line_number":110,"context_line":"                              snat_p_list)"},{"line_number":111,"context_line":"            return router_db"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_fd7f7f15","line":109,"in_reply_to":"baada198_6d1d9d62","updated":"2014-07-22 17:13:16.000000000","message":"Will do.","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"784d722f822abeef1e5b5e28769501702348d57c","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        if fip_hostid:"},{"line_number":171,"context_line":"            agt_gw_flag \u003d self.check_fips_availability_on_host("},{"line_number":172,"context_line":"                context, fip_id, fip_hostid)"},{"line_number":173,"context_line":"        if agt_gw_flag and fip_hostid:"},{"line_number":174,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port\u0027)"},{"line_number":175,"context_line":"            self.delete_floatingip_agent_gateway_port(context, fip_hostid)"},{"line_number":176,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_b2fe3038","line":173,"updated":"2014-07-22 10:05:18.000000000","message":"Is possible that agt_gw_flag is None and fip_hostid is not None? Is this a \"normal\" condition or an error condition? In the second case shouldn\u0027t the error condition at least be logged? In any case could you please add a comment?","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3f09f6ded8dbaba34acd69e13cd15d6eebe0a891","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        if fip_hostid:"},{"line_number":171,"context_line":"            agt_gw_flag \u003d self.check_fips_availability_on_host("},{"line_number":172,"context_line":"                context, fip_id, fip_hostid)"},{"line_number":173,"context_line":"        if agt_gw_flag and fip_hostid:"},{"line_number":174,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port\u0027)"},{"line_number":175,"context_line":"            self.delete_floatingip_agent_gateway_port(context, fip_hostid)"},{"line_number":176,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_5df22b9c","line":173,"in_reply_to":"baada198_b2fe3038","updated":"2014-07-22 17:13:16.000000000","message":"agt_gw_flag will always return \"True\" or \"False\".\nIn a realtime fip_hostid will not be None.\nOnly if there is \"agt_gw_flag\" is True and if the \"fip_hostid\" exists then we go ahead and delete the port.\nOtherwise, if the \"fip_hostid\" is none, there many not be any ports in that host for removal.","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"784d722f822abeef1e5b5e28769501702348d57c","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                    admin_ctx, floatingip, id)"},{"line_number":186,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":187,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":188,"context_line":"        except Exception:"},{"line_number":189,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":190,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_f2c0a82d","line":188,"updated":"2014-07-22 10:05:18.000000000","message":"The Exception is not logged nor re-raised. It that on purpose? We might miss some valuable information","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"58609baad5a5143ff433be0a0f0529069ff89d50","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                    admin_ctx, floatingip, id)"},{"line_number":186,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":187,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":188,"context_line":"        except Exception:"},{"line_number":189,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":190,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_beea6f72","line":188,"in_reply_to":"baada198_78ce362f","updated":"2014-07-22 13:54:02.000000000","message":"All in all I think this test needs some coverage.","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"2c0ae2373eef1b9aa36343b80746556d931aca55","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                    admin_ctx, floatingip, id)"},{"line_number":186,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":187,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":188,"context_line":"        except Exception:"},{"line_number":189,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":190,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_78ce362f","line":188,"in_reply_to":"baada198_f2c0a82d","updated":"2014-07-22 11:47:38.000000000","message":"+1 here","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3f09f6ded8dbaba34acd69e13cd15d6eebe0a891","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                    admin_ctx, floatingip, id)"},{"line_number":186,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":187,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":188,"context_line":"        except Exception:"},{"line_number":189,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":190,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_dd62bb3c","line":188,"in_reply_to":"baada198_f2c0a82d","updated":"2014-07-22 17:13:16.000000000","message":"In this case, theoretically speaking the \"self._get_router(context, router_id) should return a router, but in some of the test cases it is returning an error stating \"Router\" is None.\nSo in order to handle this case, I have to raise an exception without any logging an errors, but just to call the super class to do the actual delete.","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"2390c321e39de5c91cd3e98a1ac85dc0c5b9b210","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":188,"context_line":"        except Exception:"},{"line_number":189,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":190,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    def add_router_interface(self, context, router_id, interface_info):"},{"line_number":193,"context_line":"        add_by_port, add_by_sub \u003d self._validate_interface_info(interface_info)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_94f6605c","line":190,"updated":"2014-07-22 16:28:17.000000000","message":"Put this line outside of the exception block so that lines 186-187 can be deleted.","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3f09f6ded8dbaba34acd69e13cd15d6eebe0a891","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":188,"context_line":"        except Exception:"},{"line_number":189,"context_line":"            super(L3_NAT_with_dvr_db_mixin,"},{"line_number":190,"context_line":"                  self).delete_floatingip(context, id)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    def add_router_interface(self, context, router_id, interface_info):"},{"line_number":193,"context_line":"        add_by_port, add_by_sub \u003d self._validate_interface_info(interface_info)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_bdb9877e","line":190,"in_reply_to":"baada198_94f6605c","updated":"2014-07-22 17:13:16.000000000","message":"As I mentioned above, I need not raise any exception errors in this case rather than calling the super class.","commit_id":"0d05782e8fb705d72783ac3a1eb6a3fb4a31ec4e"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0dc89a6ca454615bef7c6c6d852fdb5f527655b9","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            self._update_distributed_attr("},{"line_number":101,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":102,"context_line":"            if router_db[\u0027gw_port_id\u0027] and router_db[\u0027status\u0027] \u003d\u003d ("},{"line_number":103,"context_line":"                l3_const.ROUTER_STATUS_LEGACY_TO_DVR):"},{"line_number":104,"context_line":"                snat_p_list \u003d self.create_snat_intf_ports_if_not_exists("},{"line_number":105,"context_line":"                    context.elevated(), router_db[\u0027id\u0027])"},{"line_number":106,"context_line":"                if not snat_p_list:"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_1de71ae4","line":103,"updated":"2014-07-28 09:39:29.000000000","message":"These are just questions to understand whether I did understand correctly the migration process:\n\n1) I expect the router status to be updated again once the migration has been completed. I expect there might be some sort of feedback from agents once all the snat interface ports have been setup. And the transition would be just that the router will go back to ACTIVE once that\u0027s completed. Is this correct?\n\n2) Is there a need to check also for fip agent gw ports? If we transform a router with a floating IP on a host which has no agent gw port yet, should we create it here?","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d6c077d89fc67d81eba8cdd0b911eadf9652307","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            self._update_distributed_attr("},{"line_number":101,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":102,"context_line":"            if router_db[\u0027gw_port_id\u0027] and router_db[\u0027status\u0027] \u003d\u003d ("},{"line_number":103,"context_line":"                l3_const.ROUTER_STATUS_LEGACY_TO_DVR):"},{"line_number":104,"context_line":"                snat_p_list \u003d self.create_snat_intf_ports_if_not_exists("},{"line_number":105,"context_line":"                    context.elevated(), router_db[\u0027id\u0027])"},{"line_number":106,"context_line":"                if not snat_p_list:"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_3eecb828","line":103,"in_reply_to":"baada198_1de71ae4","updated":"2014-07-28 23:23:15.000000000","message":"To answer your questions.\n1) Yes your understanding is right. This intermediate state is the for the scheduler to understand the transition and based on that the scheduler should take action on those routers, such as scheduling the router to the right agent and removing the old routers. After this action the scheduler/agent should set the state of the Router back to \"ACTIVE\".\n\n2) The FIP agent gateway port may already reside in a compute node where the VM is hosted. Before we migrate and deploy the FIP namespace for the legacy router, the agent will check if the node has a FIP namespace, if does not have one, it will request the Plugin to create one, otherwise it will use the existing one that is already available in that compute Node.\n\nHope I have answered your questions here.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0dc89a6ca454615bef7c6c6d852fdb5f527655b9","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    context.elevated(), router_db[\u0027id\u0027])"},{"line_number":106,"context_line":"                if not snat_p_list:"},{"line_number":107,"context_line":"                    LOG.debug(\"SNAT interface ports not created: %s\","},{"line_number":108,"context_line":"                              snat_p_list)"},{"line_number":109,"context_line":"            return router_db"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_825109db","line":108,"updated":"2014-07-28 09:39:29.000000000","message":"will this mean that the router will be stuck forever in legacy_to_dvr status?","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d6c077d89fc67d81eba8cdd0b911eadf9652307","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    context.elevated(), router_db[\u0027id\u0027])"},{"line_number":106,"context_line":"                if not snat_p_list:"},{"line_number":107,"context_line":"                    LOG.debug(\"SNAT interface ports not created: %s\","},{"line_number":108,"context_line":"                              snat_p_list)"},{"line_number":109,"context_line":"            return router_db"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_5ec6cc9c","line":108,"in_reply_to":"baada198_825109db","updated":"2014-07-28 23:23:15.000000000","message":"We don\u0027t expect to see this condition, because snat_p_list might always return a list of snat ports. We will end up in this situation only where there are no interfaces associated with the router.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0dc89a6ca454615bef7c6c6d852fdb5f527655b9","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def _validate_fip_agent_gw_port_and_delete("},{"line_number":164,"context_line":"            self, context, floatingip_db, fip_id):"},{"line_number":165,"context_line":"        \"\"\"Helper function to validate the fip agent gw port delete.\"\"\""},{"line_number":166,"context_line":"        agt_gw_flag \u003d False"},{"line_number":167,"context_line":"        port_db \u003d self._core_plugin._get_port("},{"line_number":168,"context_line":"            context, floatingip_db[\u0027fixed_port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_5ff34a9e","line":165,"updated":"2014-07-28 09:39:29.000000000","message":"Can I be really pedant and say that this docstring doesn\u0027t add anything to what one can derive from the function name?\n\nIf you have time to spare it won\u0027t be bad to add a few more lines.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d6c077d89fc67d81eba8cdd0b911eadf9652307","unresolved":false,"context_lines":[{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def _validate_fip_agent_gw_port_and_delete("},{"line_number":164,"context_line":"            self, context, floatingip_db, fip_id):"},{"line_number":165,"context_line":"        \"\"\"Helper function to validate the fip agent gw port delete.\"\"\""},{"line_number":166,"context_line":"        agt_gw_flag \u003d False"},{"line_number":167,"context_line":"        port_db \u003d self._core_plugin._get_port("},{"line_number":168,"context_line":"            context, floatingip_db[\u0027fixed_port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_be452816","line":165,"in_reply_to":"baada198_5ff34a9e","updated":"2014-07-28 23:23:15.000000000","message":"Sure I will add more to the docstring.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0dc89a6ca454615bef7c6c6d852fdb5f527655b9","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        if fip_hostid:"},{"line_number":171,"context_line":"            agt_gw_flag \u003d self.check_fips_availability_on_host("},{"line_number":172,"context_line":"                context, fip_id, fip_hostid)"},{"line_number":173,"context_line":"        if agt_gw_flag and fip_hostid:"},{"line_number":174,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port\u0027)"},{"line_number":175,"context_line":"            self.delete_floatingip_agent_gateway_port(context, fip_hostid)"},{"line_number":176,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_823029ea","line":173,"updated":"2014-07-28 09:39:29.000000000","message":"I wonder if the code below can just be indented and executed only if agt_gw_flag.\n\nBut this is nit-picking however, do as you feel it\u0027s better.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d6c077d89fc67d81eba8cdd0b911eadf9652307","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        if fip_hostid:"},{"line_number":171,"context_line":"            agt_gw_flag \u003d self.check_fips_availability_on_host("},{"line_number":172,"context_line":"                context, fip_id, fip_hostid)"},{"line_number":173,"context_line":"        if agt_gw_flag and fip_hostid:"},{"line_number":174,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port\u0027)"},{"line_number":175,"context_line":"            self.delete_floatingip_agent_gateway_port(context, fip_hostid)"},{"line_number":176,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_9e714479","line":173,"in_reply_to":"baada198_823029ea","updated":"2014-07-28 23:23:15.000000000","message":"I think I need the check for fip_hostid as well. So I will leave it the way it is now.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0dc89a6ca454615bef7c6c6d852fdb5f527655b9","unresolved":false,"context_lines":[{"line_number":174,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port\u0027)"},{"line_number":175,"context_line":"            self.delete_floatingip_agent_gateway_port(context, fip_hostid)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def delete_floatingip(self, context, id):"},{"line_number":178,"context_line":"        floatingip \u003d self._get_floatingip(context, id)"},{"line_number":179,"context_line":"        router_id \u003d floatingip[\u0027router_id\u0027]"},{"line_number":180,"context_line":"        admin_ctx \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_df2e7af9","line":177,"updated":"2014-07-28 09:39:29.000000000","message":"the changes in this method are adding additional logic which will probably require a unit tests as well. What do you reckon?","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d6c077d89fc67d81eba8cdd0b911eadf9652307","unresolved":false,"context_lines":[{"line_number":174,"context_line":"            LOG.debug(\u0027Deleting the Agent GW Port\u0027)"},{"line_number":175,"context_line":"            self.delete_floatingip_agent_gateway_port(context, fip_hostid)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def delete_floatingip(self, context, id):"},{"line_number":178,"context_line":"        floatingip \u003d self._get_floatingip(context, id)"},{"line_number":179,"context_line":"        router_id \u003d floatingip[\u0027router_id\u0027]"},{"line_number":180,"context_line":"        admin_ctx \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_de673cb6","line":177,"in_reply_to":"baada198_df2e7af9","updated":"2014-07-28 23:23:15.000000000","message":"Yes I do realize that and working on it.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0dc89a6ca454615bef7c6c6d852fdb5f527655b9","unresolved":false,"context_lines":[{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def delete_floatingip(self, context, id):"},{"line_number":178,"context_line":"        floatingip \u003d self._get_floatingip(context, id)"},{"line_number":179,"context_line":"        router_id \u003d floatingip[\u0027router_id\u0027]"},{"line_number":180,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":181,"context_line":"        try:"},{"line_number":182,"context_line":"            router \u003d self._get_router(context, router_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_ffe33ed5","line":179,"updated":"2014-07-28 09:39:29.000000000","message":"I think it\u0027s not unlikely that one tries to delete a disassociated floating ip.\nIn this case router_id would be None, if I\u0027m not mistaken, and therefore we might just avoid grabbing an elevated context and attempting to fetch a router.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d6c077d89fc67d81eba8cdd0b911eadf9652307","unresolved":false,"context_lines":[{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def delete_floatingip(self, context, id):"},{"line_number":178,"context_line":"        floatingip \u003d self._get_floatingip(context, id)"},{"line_number":179,"context_line":"        router_id \u003d floatingip[\u0027router_id\u0027]"},{"line_number":180,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":181,"context_line":"        try:"},{"line_number":182,"context_line":"            router \u003d self._get_router(context, router_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_5eb08cfc","line":179,"in_reply_to":"baada198_ffe33ed5","updated":"2014-07-28 23:23:15.000000000","message":"You are right, the only reason I was fetching the router is to check the router extension and if it is a dvr go ahead and delete the additional FIP agent gateway port that we created.\nOtherwise for all routers this will be called.\n\nThe worst case is we might have to then call the _validate_fip_agent_gw_port_and_delete for all routers.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0dc89a6ca454615bef7c6c6d852fdb5f527655b9","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                self._validate_fip_agent_gw_port_and_delete("},{"line_number":185,"context_line":"                    admin_ctx, floatingip, id)"},{"line_number":186,"context_line":"        #    super(L3_NAT_with_dvr_db_mixin,"},{"line_number":187,"context_line":"        #          self).delete_floatingip(context, id)"},{"line_number":188,"context_line":"        except Exception:"},{"line_number":189,"context_line":"            LOG.debug(\u0027Router not found\u0027)"},{"line_number":190,"context_line":"        super(L3_NAT_with_dvr_db_mixin,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_ff95fe31","line":187,"updated":"2014-07-28 09:39:29.000000000","message":"commented out code can probably be removed","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3d6c077d89fc67d81eba8cdd0b911eadf9652307","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                self._validate_fip_agent_gw_port_and_delete("},{"line_number":185,"context_line":"                    admin_ctx, floatingip, id)"},{"line_number":186,"context_line":"        #    super(L3_NAT_with_dvr_db_mixin,"},{"line_number":187,"context_line":"        #          self).delete_floatingip(context, id)"},{"line_number":188,"context_line":"        except Exception:"},{"line_number":189,"context_line":"            LOG.debug(\u0027Router not found\u0027)"},{"line_number":190,"context_line":"        super(L3_NAT_with_dvr_db_mixin,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_bec8c875","line":187,"in_reply_to":"baada198_ff95fe31","updated":"2014-07-28 23:23:15.000000000","message":"I forgot to remove it. will remove it.","commit_id":"c00f786050bd8f8f4914bda0afc1f0086d97c1f3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"36c5586b7589213622cfa2af2eca8298c9c0c918","unresolved":false,"context_lines":[{"line_number":549,"context_line":"            candidates \u003d l3_plugin.get_l3_agent_candidates(context,"},{"line_number":550,"context_line":"                router_dict, active_agents)"},{"line_number":551,"context_line":"        if candidates:"},{"line_number":552,"context_line":"            l3_plugin.reschedule_router(context, id, candidates)"},{"line_number":553,"context_line":"            router_dict[\u0027status\u0027] \u003d \u0027ACTIVE\u0027"},{"line_number":554,"context_line":"        return super(L3_NAT_with_dvr_db_mixin, self).update_router(context,"},{"line_number":555,"context_line":"            id, router)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_fb74d505","line":552,"updated":"2014-08-06 13:47:52.000000000","message":"I understand that you are expecting this function to get called on router update which further will invoking reschedule_router.\nAt the end you are invoking superclass update_router method.\nConsidering the case where router update is invoked with attribute then super class reschedule_router will also get invoked.\nThis may result in reschedule_router getting called twice.","commit_id":"20da3c4f8a7203dcd86eaca08aeb4b176cee2365"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"053e55d021f12546128b36d3be322c600b7c13db","unresolved":false,"context_lines":[{"line_number":549,"context_line":"            candidates \u003d l3_plugin.get_l3_agent_candidates(context,"},{"line_number":550,"context_line":"                router_dict, active_agents)"},{"line_number":551,"context_line":"        if candidates:"},{"line_number":552,"context_line":"            l3_plugin.reschedule_router(context, id, candidates)"},{"line_number":553,"context_line":"            router_dict[\u0027status\u0027] \u003d \u0027ACTIVE\u0027"},{"line_number":554,"context_line":"        return super(L3_NAT_with_dvr_db_mixin, self).update_router(context,"},{"line_number":555,"context_line":"            id, router)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_ea98706b","line":552,"in_reply_to":"baada198_fb74d505","updated":"2014-08-06 21:45:26.000000000","message":"I considered that and I wasn\u0027t sure of an optimal and \"clean\" way to only call reschedule once.  I wanted to share this as-is and get more input.","commit_id":"20da3c4f8a7203dcd86eaca08aeb4b176cee2365"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"81a0affa78179a0df5322a1c95619693442b788f","unresolved":false,"context_lines":[{"line_number":574,"context_line":"        else:"},{"line_number":575,"context_line":"            return super(L3_NAT_with_dvr_db_mixin, self).update_router(context,"},{"line_number":576,"context_line":"                id, router)"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":""},{"line_number":579,"context_line":"def _is_distributed_router(router):"},{"line_number":580,"context_line":"    \"\"\"Return True if router to be handled is distributed.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_2e383f3c","line":577,"updated":"2014-08-21 22:50:13.000000000","message":"I improved the overloading on this patch - we should only reschedule once.  If the router is migrating the new code above will be called, otherwise the super will be called.","commit_id":"fc6e912542ef339c359d6ca2e641021e74e0c01b"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"325e32e3f90f0efbcdbecb42cdc626510b565978","unresolved":false,"context_lines":[{"line_number":574,"context_line":"        else:"},{"line_number":575,"context_line":"            return super(L3_NAT_with_dvr_db_mixin, self).update_router(context,"},{"line_number":576,"context_line":"                id, router)"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":""},{"line_number":579,"context_line":"def _is_distributed_router(router):"},{"line_number":580,"context_line":"    \"\"\"Return True if router to be handled is distributed.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_c3887473","line":577,"in_reply_to":"1abeadc6_2e383f3c","updated":"2014-08-22 10:34:18.000000000","message":"You can use update_router() method logic that is implemented in this patch 112576 (https://review.openstack.org/#/c/112576/) to address this.","commit_id":"fc6e912542ef339c359d6ca2e641021e74e0c01b"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"3bcf51ac9c85c0660775c1312594a6f2f0602d42","unresolved":false,"context_lines":[{"line_number":574,"context_line":"        else:"},{"line_number":575,"context_line":"            return super(L3_NAT_with_dvr_db_mixin, self).update_router(context,"},{"line_number":576,"context_line":"                id, router)"},{"line_number":577,"context_line":""},{"line_number":578,"context_line":""},{"line_number":579,"context_line":"def _is_distributed_router(router):"},{"line_number":580,"context_line":"    \"\"\"Return True if router to be handled is distributed.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_1a0f2289","line":577,"in_reply_to":"1abeadc6_c3887473","updated":"2014-08-22 15:38:33.000000000","message":"Vinod - what aspect of the other patch are you referring to?  The code above will do the normal path unless the router is in migration transition.  Do you think that is insufficient?  What is missing/wrong/insufficient above that is implemented in the other patch?  Please let me know so we can resolve any issues.","commit_id":"fc6e912542ef339c359d6ca2e641021e74e0c01b"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0d4c991ceb2b9a6ef668b567c91e20551c0ec6f8","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                       \"is not supported\"), router_db[\u0027id\u0027])"},{"line_number":79,"context_line":"            raise NotImplementedError()"},{"line_number":80,"context_line":"        elif (not router_db.extra_attributes.distributed and"},{"line_number":81,"context_line":"              router_res.get(\u0027distributed\u0027) is True):"},{"line_number":82,"context_line":"            # TODO(Swami): Add a check for Services FWaaS and VPNaaS"},{"line_number":83,"context_line":"            router_db[\u0027status\u0027] \u003d ("},{"line_number":84,"context_line":"                l3_const.ROUTER_STATUS_LEGACY_TO_DVR)"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_6102b93f","line":81,"updated":"2014-09-10 14:36:07.000000000","message":"is True seems unnecessary. But I guess you wanted consistency with L76.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"57a8e83b0343eeac74ad84b7a4f90c54b2762897","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                    context.elevated(), router_db[\u0027id\u0027])"},{"line_number":115,"context_line":"                if not snat_p_list:"},{"line_number":116,"context_line":"                    LOG.debug(\"SNAT interface ports not created: %s\","},{"line_number":117,"context_line":"                              snat_p_list)"},{"line_number":118,"context_line":"            return router_db"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_bd637daf","line":117,"updated":"2014-09-15 00:22:37.000000000","message":"If we get to here (not snap_p_list) then snap_p_list won\u0027t have any info. right? Should this be something else?","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"b3e4df51c6a11e66b7eddd2ee659608eac4dbc38","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                    context.elevated(), router_db[\u0027id\u0027])"},{"line_number":115,"context_line":"                if not snat_p_list:"},{"line_number":116,"context_line":"                    LOG.debug(\"SNAT interface ports not created: %s\","},{"line_number":117,"context_line":"                              snat_p_list)"},{"line_number":118,"context_line":"            return router_db"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_4a91c945","line":117,"in_reply_to":"fa98f980_bd637daf","updated":"2014-09-16 15:48:16.000000000","message":"it should LOG \u0027None\u0027 but I see your point, we could LOG something more useful like gw_port_id or router_db[\u0027id\u0027]","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d7a4ea437e96f62e184e2d6cb21ccfdb5f2fc365","unresolved":false,"context_lines":[{"line_number":572,"context_line":""},{"line_number":573,"context_line":"    def update_router(self, context, id, router):"},{"line_number":574,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":575,"context_line":"        router_dict \u003d self.get_router(context, id)"},{"line_number":576,"context_line":"        if router_dict[\u0027status\u0027] \u003d\u003d l3_const.ROUTER_STATUS_LEGACY_TO_DVR:"},{"line_number":577,"context_line":"            l3_plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":578,"context_line":"                constants.L3_ROUTER_NAT)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baa201ad_a211605f","line":575,"updated":"2014-10-09 20:35:39.000000000","message":"There is problem here.\nAt this point the state of the router will be \"ACTIVE\" and will not be \"ROUTER_STATUS_LEGACY_TO_DVR\".\nOnly after \"_update_router_db is called it will change the status.\nSo this has to be addressed.","commit_id":"269a7fb5745bb0bdf236b8cbc62eda40ec68c0e6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1b080a75dbd45770debe57a0daa394957f4c85dc","unresolved":false,"context_lines":[{"line_number":573,"context_line":"    def update_router(self, context, id, router):"},{"line_number":574,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":575,"context_line":"        router_dict \u003d self.get_router(context, id)"},{"line_number":576,"context_line":"        if router_dict[\u0027status\u0027] \u003d\u003d l3_const.ROUTER_STATUS_LEGACY_TO_DVR:"},{"line_number":577,"context_line":"            l3_plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":578,"context_line":"                constants.L3_ROUTER_NAT)"},{"line_number":579,"context_line":"            router_db \u003d self._update_router_db(context, id,"}],"source_content_type":"text/x-python","patch_set":29,"id":"baa201ad_105b92f6","line":576,"updated":"2014-10-07 23:23:22.000000000","message":"Consider reversing this check to bring L590/L591 up if there in a reason to crack this patch open again.  It just reads better when the simple case is handled first with a return statement and the rest is not indented.","commit_id":"269a7fb5745bb0bdf236b8cbc62eda40ec68c0e6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1b080a75dbd45770debe57a0daa394957f4c85dc","unresolved":false,"context_lines":[{"line_number":585,"context_line":"            if candidates:"},{"line_number":586,"context_line":"                l3_plugin.reschedule_router(context, id, candidates)"},{"line_number":587,"context_line":"                router_dict[\u0027status\u0027] \u003d \u0027ACTIVE\u0027"},{"line_number":588,"context_line":"            return self._make_router_dict(router_db)"},{"line_number":589,"context_line":"        else:"},{"line_number":590,"context_line":"            return super(L3_NAT_with_dvr_db_mixin, self).update_router(context,"},{"line_number":591,"context_line":"                id, router)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baa201ad_f308d829","line":588,"updated":"2014-10-07 23:23:22.000000000","message":"I\u0027m concerned with not calling super here in this branch.  This update_router method is overridden heavily in the class hierarchy.  Not calling super may break the call chain in unpredictable ways.\n\nFor example, this mixin and ExtraRoute_dbonly_mixin both have update_router defined.  Neither is dependent on the other.  Given how python orders super calls, I can\u0027t predict which one would be called first.  If ExtraRouter_dbonly_mixin is called first, it calls super and this one will be called.  All is good.  However, if this one is called first and it does not call super, then the whole chain is broken.  ExtraRouter_dbonly_mixin\u0027s update_router may not be called!  This seems like a big problem to me.\n\nI constructed this dot graph to show the inheritance hierarchy.  The red classes override update_router.  Quite a mess, right?  You can turn this in to an svg with \"dot -Tsvg\"\n\n  digraph update_router {\n    L3_HA_NAT_db_mixin -\u003e L3_NAT_with_dvr_db_mixin;\n    L3_NAT_with_dvr_db_mixin -\u003e L3_NAT_db_mixin;\n    L3_NAT_with_dvr_db_mixin -\u003e ExtraAttributesMixin;\n    ExtraRoute_dbonly_mixin -\u003e L3_NAT_dbonly_mixin;\n    L3_NAT_dbonly_mixin -\u003e RouterPluginBase;\n    L3_NAT_db_mixin -\u003e L3_NAT_dbonly_mixin;\n    L3_NAT_db_mixin -\u003e L3RpcNotifierMixin;\n    L3_NAT_db_mixin [ color\u003d\"red\" ];\n    L3_NAT_dbonly_mixin [ color\u003d\"red\" ];\n    L3_NAT_with_dvr_db_mixin [ color\u003d\"red\" ];\n    RouterPluginBase [ color\u003d\"red\" ];\n    ExtraRoute_dbonly_mixin [ color\u003d\"red\" ];\n    L3RouterPlugin -\u003e CommonDbMixin;\n    L3RouterPlugin -\u003e ExtraRoute_db_mixin;\n    L3RouterPlugin -\u003e L3_HA_NAT_db_mixin;\n    L3RouterPlugin -\u003e L3_NAT_db_mixin;\n    L3RouterPlugin -\u003e L3_DVRsch_db_mixin;\n    L3RouterPlugin -\u003e L3_HA_scheduler_db_mixin;\n    ExtraRoute_db_mixin -\u003e ExtraRoute_dbonly_mixin;\n    L3_DVRsch_db_mixin -\u003e L3AgentSchedulerDbMixin;\n    L3_HA_scheduler_db_mixin -\u003e L3AgentSchedulerDbMixin;\n    L3AgentSchedulerDbMixin -\u003e L3AgentSchedulerPluginBase;\n    L3AgentSchedulerDbMixin -\u003e AgentSchedulerDbMixin;\n    AgentSchedulerDbMixin -\u003e AgentDbMixin;\n    AgentDbMixin -\u003e AgentPluginBase;\n    ExtraAttributesMixin -\u003e object;\n    L3RpcNotifierMixin -\u003e object;\n    RouterPluginBase -\u003e object;\n    AgentPluginBase -\u003e object;\n    L3AgentSchedulerPluginBase -\u003e object;\n  }","commit_id":"269a7fb5745bb0bdf236b8cbc62eda40ec68c0e6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8c38c8012e5592e3f8fafbb40998e068326538b9","unresolved":false,"context_lines":[{"line_number":615,"context_line":"        router_dict \u003d super(L3_NAT_with_dvr_db_mixin,"},{"line_number":616,"context_line":"                            self).update_router(context, id, router)"},{"line_number":617,"context_line":"        if router_dict[\u0027status\u0027] \u003d\u003d l3_const.ROUTER_STATUS_LEGACY_TO_DVR:"},{"line_number":618,"context_line":"            l3_plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":619,"context_line":"                constants.L3_ROUTER_NAT)"},{"line_number":620,"context_line":"            active_agents \u003d l3_plugin.get_l3_agents(context, active\u003dTrue)"},{"line_number":621,"context_line":"            candidates \u003d l3_plugin.get_l3_agent_candidates(context,"}],"source_content_type":"text/x-python","patch_set":30,"id":"9aa7fdbe_03613039","line":618,"updated":"2014-10-21 04:23:46.000000000","message":"This is the L3 plugin!  l3_plugin \u003d\u003d self","commit_id":"a6fbc164a4b63abaa883141b26ae687966b9b181"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8c38c8012e5592e3f8fafbb40998e068326538b9","unresolved":false,"context_lines":[{"line_number":623,"context_line":"            if candidates:"},{"line_number":624,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":625,"context_line":"                    l3_plugin.reschedule_router(context, id, candidates)"},{"line_number":626,"context_line":"                    router_db \u003d self._get_router(context, id)"},{"line_number":627,"context_line":"                    router_db.update({\u0027status\u0027: \u0027ACTIVE\u0027})"},{"line_number":628,"context_line":"        return router_dict"},{"line_number":629,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"9aa7fdbe_433c18e3","line":626,"updated":"2014-10-21 04:23:46.000000000","message":"I have to wonder if there is a way to update this without retrieving it first.","commit_id":"a6fbc164a4b63abaa883141b26ae687966b9b181"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"447162690bbdfaab9de3d6babbce13c63a53f47b","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from neutron.extensions import portbindings"},{"line_number":27,"context_line":"from neutron.openstack.common import log as logging"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"DEVICE_OWNER_DVR_INTERFACE \u003d l3_const.DEVICE_OWNER_DVR_INTERFACE"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_4d735215","side":"PARENT","line":29,"updated":"2014-11-04 09:47:21.000000000","message":":\u0027(\n\n(random whitespace change)","commit_id":"fd37ce7d943ab1c2dbc1cf3b6f0187c227f658ad"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"447162690bbdfaab9de3d6babbce13c63a53f47b","unresolved":false,"context_lines":[{"line_number":76,"context_line":"                       \"is not supported\"), router_db[\u0027id\u0027])"},{"line_number":77,"context_line":"            raise NotImplementedError()"},{"line_number":78,"context_line":"        elif (not router_db.extra_attributes.distributed and"},{"line_number":79,"context_line":"              router_res.get(\u0027distributed\u0027) is True):"},{"line_number":80,"context_line":"            # TODO(Swami): Add a check for Services FWaaS and VPNaaS"},{"line_number":81,"context_line":"            router_db[\u0027status\u0027] \u003d ("},{"line_number":82,"context_line":"                l3_const.ROUTER_STATUS_LEGACY_TO_DVR)"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_4de19299","line":79,"updated":"2014-11-04 09:47:21.000000000","message":"suggestion for readability:  It might help to extract temporaries with a name that self documents this boolean check (and the one on L73).\n\n  migrating_to_distributed \u003d (not router_db.extra_attributes.distributed and\n\t\t\t      router_res.get(\u0027distributed\u0027) is True)\n  migrating_from_distributed \u003d (router_db.extra_attributes.distributed and\n                                router_res.get(\u0027distributed\u0027) is False):\n  if migrating_from_distributed:\n      ...\n  elif migrating_to_distributed:\n      ...","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"201a3a43246142e1ded101a9dd201f3471a5a440","unresolved":false,"context_lines":[{"line_number":76,"context_line":"                       \"is not supported\"), router_db[\u0027id\u0027])"},{"line_number":77,"context_line":"            raise NotImplementedError()"},{"line_number":78,"context_line":"        elif (not router_db.extra_attributes.distributed and"},{"line_number":79,"context_line":"              router_res.get(\u0027distributed\u0027) is True):"},{"line_number":80,"context_line":"            # TODO(Swami): Add a check for Services FWaaS and VPNaaS"},{"line_number":81,"context_line":"            router_db[\u0027status\u0027] \u003d ("},{"line_number":82,"context_line":"                l3_const.ROUTER_STATUS_LEGACY_TO_DVR)"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_b7107f02","line":79,"in_reply_to":"7a8c0949_4de19299","updated":"2014-11-04 16:32:21.000000000","message":"I\u0027ll try to clean this up a bit.","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5136f5211906722e80e36f10d4c4153b52d59716","unresolved":false,"context_lines":[{"line_number":609,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"    def update_router(self, context, id, router):"},{"line_number":612,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":613,"context_line":"        router_dict \u003d super(L3_NAT_with_dvr_db_mixin,"},{"line_number":614,"context_line":"                            self).update_router(context, id, router)"},{"line_number":615,"context_line":"        if router_dict[\u0027status\u0027] \u003d\u003d l3_const.ROUTER_STATUS_LEGACY_TO_DVR:"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_d05b592c","line":612,"updated":"2014-11-04 10:17:36.000000000","message":"this docstring is at clash with the method name.","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"201a3a43246142e1ded101a9dd201f3471a5a440","unresolved":false,"context_lines":[{"line_number":609,"context_line":"                                                  l3_port_check\u003dFalse)"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"    def update_router(self, context, id, router):"},{"line_number":612,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":613,"context_line":"        router_dict \u003d super(L3_NAT_with_dvr_db_mixin,"},{"line_number":614,"context_line":"                            self).update_router(context, id, router)"},{"line_number":615,"context_line":"        if router_dict[\u0027status\u0027] \u003d\u003d l3_const.ROUTER_STATUS_LEGACY_TO_DVR:"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_1747931e","line":612,"in_reply_to":"7a8c0949_d05b592c","updated":"2014-11-04 16:32:21.000000000","message":"I will update this.","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5136f5211906722e80e36f10d4c4153b52d59716","unresolved":false,"context_lines":[{"line_number":618,"context_line":"                router_dict, active_agents)"},{"line_number":619,"context_line":"            if candidates:"},{"line_number":620,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":621,"context_line":"                    self.reschedule_router(context, id, candidates)"},{"line_number":622,"context_line":"                    router_db \u003d self._get_router(context, id)"},{"line_number":623,"context_line":"                    router_db.update({\u0027status\u0027: \u0027ACTIVE\u0027})"},{"line_number":624,"context_line":"        return router_dict"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_d0451918","line":621,"updated":"2014-11-04 10:17:36.000000000","message":"this will call into an RPC method and it might lead to a deadlock. Perhaps it\u0027s not a big issue, but if we are migrating lots or routers at once I fear this might be affected","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"201a3a43246142e1ded101a9dd201f3471a5a440","unresolved":false,"context_lines":[{"line_number":618,"context_line":"                router_dict, active_agents)"},{"line_number":619,"context_line":"            if candidates:"},{"line_number":620,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":621,"context_line":"                    self.reschedule_router(context, id, candidates)"},{"line_number":622,"context_line":"                    router_db \u003d self._get_router(context, id)"},{"line_number":623,"context_line":"                    router_db.update({\u0027status\u0027: \u0027ACTIVE\u0027})"},{"line_number":624,"context_line":"        return router_dict"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_d7450b18","line":621,"in_reply_to":"7a8c0949_50ee89b5","updated":"2014-11-04 16:32:21.000000000","message":"Yes, good catch.  I can pull the reschedule_router out of the session.begin.  It will remove the deadlock, but Assaf has a separate comment on splitting up this logic across methods as it is.  But I believe the safest path is to avoid the deadlocks for now.","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c2cf7b12d50da216fc9b555176b7116591bd3ef6","unresolved":false,"context_lines":[{"line_number":618,"context_line":"                router_dict, active_agents)"},{"line_number":619,"context_line":"            if candidates:"},{"line_number":620,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":621,"context_line":"                    self.reschedule_router(context, id, candidates)"},{"line_number":622,"context_line":"                    router_db \u003d self._get_router(context, id)"},{"line_number":623,"context_line":"                    router_db.update({\u0027status\u0027: \u0027ACTIVE\u0027})"},{"line_number":624,"context_line":"        return router_dict"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_50ee89b5","line":621,"in_reply_to":"7a8c0949_d0451918","updated":"2014-11-04 10:43:19.000000000","message":"Armando, thanks for spotting this.  I haven\u0027t been fully trained at spotting these buried RPC method calls but you\u0027re totally right.  Now that I open up this method in l3_agentschedulers_db.py, it is obvious.\n\nDo we need to push to get rid of this mysql plugin that is leaving us vulnerable to these deadlocks?  How is the work on that going?  Am I falsely putting my hopes in a better mysql connector plugin?","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5136f5211906722e80e36f10d4c4153b52d59716","unresolved":false,"context_lines":[{"line_number":620,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":621,"context_line":"                    self.reschedule_router(context, id, candidates)"},{"line_number":622,"context_line":"                    router_db \u003d self._get_router(context, id)"},{"line_number":623,"context_line":"                    router_db.update({\u0027status\u0027: \u0027ACTIVE\u0027})"},{"line_number":624,"context_line":"        return router_dict"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_30badd23","line":623,"updated":"2014-11-04 10:17:36.000000000","message":"a) please use a constant  here.\n\nb) I am confused: we set ROUTER_STATUS_LEGACY_TO_DVR in _update_router_db, that\u0027s called by this very method. In case of candidates then we\u0027ll be setting the status to ACTIVE, by effectively overwriting the state change made a moment ago. Is this expected? Does the L3 agent need to be aware of the migration status? Why do we spread this migration logic across multiple methods like this? This causes multiple trips to the DB for no good reason as far as I can tell.","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"201a3a43246142e1ded101a9dd201f3471a5a440","unresolved":false,"context_lines":[{"line_number":620,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":621,"context_line":"                    self.reschedule_router(context, id, candidates)"},{"line_number":622,"context_line":"                    router_db \u003d self._get_router(context, id)"},{"line_number":623,"context_line":"                    router_db.update({\u0027status\u0027: \u0027ACTIVE\u0027})"},{"line_number":624,"context_line":"        return router_dict"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_9709c3df","line":623,"in_reply_to":"7a8c0949_30badd23","updated":"2014-11-04 16:32:21.000000000","message":"a) I\u0027ll use the constant.\n\nb) As far as splitting the logic, the state is set previously so it can be examined here.  We then set it to active only if we end up migrating via reschedule here.  Otherwise it stays in the ROUTER_STATUS_LEGACY_TO_DVR.  We could set it to error instead if we fail to reschedule - probably better since it will be stuck in this state.","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"65dd6e02f64ed0476b93b5983e3061bb94e87e6a","unresolved":false,"context_lines":[{"line_number":620,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":621,"context_line":"                    self.reschedule_router(context, id, candidates)"},{"line_number":622,"context_line":"                    router_db \u003d self._get_router(context, id)"},{"line_number":623,"context_line":"                    router_db.update({\u0027status\u0027: \u0027ACTIVE\u0027})"},{"line_number":624,"context_line":"        return router_dict"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_b7e95f82","line":623,"in_reply_to":"7a8c0949_9709c3df","updated":"2014-11-04 22:45:58.000000000","message":"Is it just me to see something wrong with this logic?\n\nPassing state across multiple methods calls and spreading the logic across methods that are called via the specialization hierarchy sounds extremely convoluted, but more importantly very fragile.","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"7573ab9fed4fcb7b07149e34ff5ea43d32d69fd3","unresolved":false,"context_lines":[{"line_number":620,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":621,"context_line":"                    self.reschedule_router(context, id, candidates)"},{"line_number":622,"context_line":"                    router_db \u003d self._get_router(context, id)"},{"line_number":623,"context_line":"                    router_db.update({\u0027status\u0027: \u0027ACTIVE\u0027})"},{"line_number":624,"context_line":"        return router_dict"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a8c0949_05a90b7b","line":623,"in_reply_to":"7a8c0949_b7e95f82","updated":"2014-11-05 17:29:54.000000000","message":"This patch has had many cooks/authors.  Sounds like we need to have a discussion about the flow.","commit_id":"974c816cb99d31b3dca15fee906d445fc77f5493"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"adbd634b0c9259a31404cbb16bc241dee75d3ac1","unresolved":false,"context_lines":[{"line_number":616,"context_line":"    def update_router(self, context, id, router):"},{"line_number":617,"context_line":"        \"\"\"Update router if migration is occurring.\"\"\""},{"line_number":618,"context_line":"        router_dict \u003d super(L3_NAT_with_dvr_db_mixin,"},{"line_number":619,"context_line":"                            self).update_router(context, id, router)"},{"line_number":620,"context_line":"        if router_dict[\u0027status\u0027] \u003d\u003d l3_const.ROUTER_STATUS_LEGACY_TO_DVR:"},{"line_number":621,"context_line":"            active_agents \u003d self.get_l3_agents(context, active\u003dTrue)"},{"line_number":622,"context_line":"            candidates \u003d self.get_l3_agent_candidates(context,"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a8c0949_0573cb15","line":619,"updated":"2014-11-05 17:47:19.000000000","message":"At this point we call reschedule_router, but then we call reschedule_router at line 626. I think we should try and find a more linear way in which we implement the update router so that it no longer relies on the way the hierarchy chain is implemented. I\u0027ll try to come up with a working example. Carl and I discussed about this and he also understand the problem. He should be able to chime in.\n\nAlso I think that getting the status, changing the status, updating the status, getting the status and re-saving the status of the router, seems quite excessive.","commit_id":"0faabf4f56fcc141e2633c15f752cf2aab3f5acf"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"cee9406353b789750a757c284b05f5345b18af8a","unresolved":false,"context_lines":[{"line_number":616,"context_line":"    def update_router(self, context, id, router):"},{"line_number":617,"context_line":"        \"\"\"Update router if migration is occurring.\"\"\""},{"line_number":618,"context_line":"        router_dict \u003d super(L3_NAT_with_dvr_db_mixin,"},{"line_number":619,"context_line":"                            self).update_router(context, id, router)"},{"line_number":620,"context_line":"        if router_dict[\u0027status\u0027] \u003d\u003d l3_const.ROUTER_STATUS_LEGACY_TO_DVR:"},{"line_number":621,"context_line":"            active_agents \u003d self.get_l3_agents(context, active\u003dTrue)"},{"line_number":622,"context_line":"            candidates \u003d self.get_l3_agent_candidates(context,"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a8c0949_a0c4a592","line":619,"in_reply_to":"7a8c0949_0573cb15","updated":"2014-11-05 18:18:48.000000000","message":"I agree this is a rather blunt approach but part of the challenge is when multiple params are passed to the \u0027router-update\u0027 API. For example, we may need to decide migration takes precedence over any other update.  In the end modifying update_router() via inheritance may not be the best approach.  I am open to suggestions.  Meanwhile I will continue to look for better ways to implement this.","commit_id":"0faabf4f56fcc141e2633c15f752cf2aab3f5acf"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1b4820a3786f40c664f8ede116f274ca0929712b","unresolved":false,"context_lines":[{"line_number":616,"context_line":"    def update_router(self, context, id, router):"},{"line_number":617,"context_line":"        \"\"\"Update router if migration is occurring.\"\"\""},{"line_number":618,"context_line":"        router_dict \u003d super(L3_NAT_with_dvr_db_mixin,"},{"line_number":619,"context_line":"                            self).update_router(context, id, router)"},{"line_number":620,"context_line":"        if router_dict[\u0027status\u0027] \u003d\u003d l3_const.ROUTER_STATUS_LEGACY_TO_DVR:"},{"line_number":621,"context_line":"            active_agents \u003d self.get_l3_agents(context, active\u003dTrue)"},{"line_number":622,"context_line":"            candidates \u003d self.get_l3_agent_candidates(context,"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a8c0949_4086a166","line":619,"in_reply_to":"7a8c0949_0573cb15","updated":"2014-11-05 18:11:21.000000000","message":"bear in mind that here the state change to MIGRATION helps, as far as I understand, to avoid any actual rescheduling. That said we\u0027ll still have to call the DB more than necessary.","commit_id":"0faabf4f56fcc141e2633c15f752cf2aab3f5acf"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02ae6d227a6345960fbbead051eeecf109730210","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def _validate_router_migration(self, router_db, router_res):"},{"line_number":74,"context_line":"        \"\"\"Allow centralized -\u003e distributed state transition only.\"\"\""},{"line_number":75,"context_line":"        migrating_from_distributed \u003d ("},{"line_number":76,"context_line":"            router_db.extra_attributes.distributed and"},{"line_number":77,"context_line":"            router_res.get(\u0027distributed\u0027) is False)"},{"line_number":78,"context_line":"        if migrating_from_distributed:"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_b3618ed5","line":75,"updated":"2014-11-19 22:07:19.000000000","message":"I do like this code better.  The changes to this method are *kind of* related to this patch but they are just cosmetic.  I\u0027m considering looking the other way.  ;)  If another patch is necessary, you might consider reverting these changes (except for the TODO on L82) just to eliminate unnecessary change.","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"eab7d45cf1b98bf94819421f23d51d95c792940d","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def _validate_router_migration(self, router_db, router_res):"},{"line_number":74,"context_line":"        \"\"\"Allow centralized -\u003e distributed state transition only.\"\"\""},{"line_number":75,"context_line":"        migrating_from_distributed \u003d ("},{"line_number":76,"context_line":"            router_db.extra_attributes.distributed and"},{"line_number":77,"context_line":"            router_res.get(\u0027distributed\u0027) is False)"},{"line_number":78,"context_line":"        if migrating_from_distributed:"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_bc405a36","line":75,"in_reply_to":"5a890539_17124562","updated":"2014-11-21 02:43:08.000000000","message":"Will do.","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"},{"author":{"_account_id":12683,"name":"KaiLin","email":"linkai3@huawei.com","username":"LinKai"},"change_message_id":"44f70f5f428d41b3ab1579794e7f1ffe8a864c44","unresolved":false,"context_lines":[{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def _validate_router_migration(self, router_db, router_res):"},{"line_number":74,"context_line":"        \"\"\"Allow centralized -\u003e distributed state transition only.\"\"\""},{"line_number":75,"context_line":"        migrating_from_distributed \u003d ("},{"line_number":76,"context_line":"            router_db.extra_attributes.distributed and"},{"line_number":77,"context_line":"            router_res.get(\u0027distributed\u0027) is False)"},{"line_number":78,"context_line":"        if migrating_from_distributed:"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_17124562","line":75,"in_reply_to":"5a890539_b3618ed5","updated":"2014-11-20 03:26:09.000000000","message":"Agree","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02ae6d227a6345960fbbead051eeecf109730210","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            self._validate_router_migration(router_db, data)"},{"line_number":100,"context_line":"            self._update_distributed_attr("},{"line_number":101,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":102,"context_line":"            if not router_db.extra_attributes.distributed and ("},{"line_number":103,"context_line":"                data.get(\u0027distributed\u0027)):"},{"line_number":104,"context_line":"                if router_db[\u0027gw_port_id\u0027]:"},{"line_number":105,"context_line":"                    # If the Legacy router is getting migrated to a DVR"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_8e3b8537","line":102,"updated":"2014-11-19 22:07:19.000000000","message":"nit:  This is where a nice self-documenting temporary variable (like L75 would go nicely.)","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"eab7d45cf1b98bf94819421f23d51d95c792940d","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            self._validate_router_migration(router_db, data)"},{"line_number":100,"context_line":"            self._update_distributed_attr("},{"line_number":101,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":102,"context_line":"            if not router_db.extra_attributes.distributed and ("},{"line_number":103,"context_line":"                data.get(\u0027distributed\u0027)):"},{"line_number":104,"context_line":"                if router_db[\u0027gw_port_id\u0027]:"},{"line_number":105,"context_line":"                    # If the Legacy router is getting migrated to a DVR"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_fc6102d4","line":102,"in_reply_to":"5a890539_8e3b8537","updated":"2014-11-21 02:43:08.000000000","message":"sounds good","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02ae6d227a6345960fbbead051eeecf109730210","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                    for agent in cur_agents:"},{"line_number":116,"context_line":"                        self._unbind_router(context, router_db[\u0027id\u0027],"},{"line_number":117,"context_line":"                                            agent[\u0027id\u0027])"},{"line_number":118,"context_line":"            router_db.extra_attributes.update(data)"},{"line_number":119,"context_line":"            return router_db"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_4ed6fdc6","line":118,"updated":"2014-11-19 22:07:19.000000000","message":"Should this be indented 4 more spaces to fall under the if statement (L102)?","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"eab7d45cf1b98bf94819421f23d51d95c792940d","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                    for agent in cur_agents:"},{"line_number":116,"context_line":"                        self._unbind_router(context, router_db[\u0027id\u0027],"},{"line_number":117,"context_line":"                                            agent[\u0027id\u0027])"},{"line_number":118,"context_line":"            router_db.extra_attributes.update(data)"},{"line_number":119,"context_line":"            return router_db"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_dc052b15","line":118,"in_reply_to":"5a890539_173b25ec","updated":"2014-11-21 02:43:08.000000000","message":"Correct KaiLin - the extra attributes need to be updated regardless of migration.  They are moved to after the if statement since we need to determine if migration has occurred.  But if a temporary variable is used, it can go back to its previous spot....","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d29ae16e7be6f2abceaf02e4208899210d9038b8","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                    for agent in cur_agents:"},{"line_number":116,"context_line":"                        self._unbind_router(context, router_db[\u0027id\u0027],"},{"line_number":117,"context_line":"                                            agent[\u0027id\u0027])"},{"line_number":118,"context_line":"            router_db.extra_attributes.update(data)"},{"line_number":119,"context_line":"            return router_db"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_3ecb71a6","line":118,"in_reply_to":"5a890539_173b25ec","updated":"2014-11-21 00:21:58.000000000","message":"Maybe it doesn\u0027t.  I\u0027d like confirmation from Mike.\n\nI thought that this line was being added in this patch for the migration case.  However, I see now that it was in the previous code but it came before the call to _update_distributed_attr.  I missed that before because it blended in with the comment being removed.  Sorry about that.","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"},{"author":{"_account_id":12683,"name":"KaiLin","email":"linkai3@huawei.com","username":"LinKai"},"change_message_id":"44f70f5f428d41b3ab1579794e7f1ffe8a864c44","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                    for agent in cur_agents:"},{"line_number":116,"context_line":"                        self._unbind_router(context, router_db[\u0027id\u0027],"},{"line_number":117,"context_line":"                                            agent[\u0027id\u0027])"},{"line_number":118,"context_line":"            router_db.extra_attributes.update(data)"},{"line_number":119,"context_line":"            return router_db"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_173b25ec","line":118,"in_reply_to":"5a890539_4ed6fdc6","updated":"2014-11-20 03:26:09.000000000","message":"I don\u0027t think it needs.","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"}],"neutron/db/l3_dvrscheduler_db.py":[{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"57a8e83b0343eeac74ad84b7a4f90c54b2762897","unresolved":false,"context_lines":[{"line_number":307,"context_line":"            self.unbind_snat_servicenode(context, router_id)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    def reschedule_router(self, context, router_id, candidates\u003dNone):"},{"line_number":310,"context_line":"        \"\"\"Reschedule router to a new l3 agent"},{"line_number":311,"context_line":"        Remove the router from the agent(s) currently hosting it and"},{"line_number":312,"context_line":"        schedule it again"},{"line_number":313,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_ddf12102","line":310,"updated":"2014-09-15 00:22:37.000000000","message":"Need a blank line after the first line of multi line comment.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a00b499256c7e52f0d1f9c169f8abd406ead34fe","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        schedule it again"},{"line_number":313,"context_line":"        \"\"\""},{"line_number":314,"context_line":"        router \u003d self.get_router(context, router_id)"},{"line_number":315,"context_line":"        if router.get(\u0027external_gateway_info\u0027, False) and ("},{"line_number":316,"context_line":"            router.get(\u0027distributed\u0027), False):"},{"line_number":317,"context_line":"            self.unbind_snat_servicenode(context, router_id)"},{"line_number":318,"context_line":"        super(L3_DVRsch_db_mixin, self).reschedule_router(context,"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_b2bd67b3","line":315,"updated":"2014-09-15 04:15:04.000000000","message":"Remove \", False\"  from these get methods. They will return None by default which is Falsey. It will be shorter and easier to read that way.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"b3e4df51c6a11e66b7eddd2ee659608eac4dbc38","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        schedule it again"},{"line_number":313,"context_line":"        \"\"\""},{"line_number":314,"context_line":"        router \u003d self.get_router(context, router_id)"},{"line_number":315,"context_line":"        if router.get(\u0027external_gateway_info\u0027, False) and ("},{"line_number":316,"context_line":"            router.get(\u0027distributed\u0027), False):"},{"line_number":317,"context_line":"            self.unbind_snat_servicenode(context, router_id)"},{"line_number":318,"context_line":"        super(L3_DVRsch_db_mixin, self).reschedule_router(context,"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_6d94e736","line":315,"in_reply_to":"fa98f980_b2bd67b3","updated":"2014-09-16 15:48:16.000000000","message":"I\u0027ll try that out.  It should resolve stephen\u0027s comment below as well.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"9512e878256a749e59418064f9ad74397c74ab2b","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        \"\"\""},{"line_number":314,"context_line":"        router \u003d self.get_router(context, router_id)"},{"line_number":315,"context_line":"        if router.get(\u0027external_gateway_info\u0027, False) and ("},{"line_number":316,"context_line":"            router.get(\u0027distributed\u0027), False):"},{"line_number":317,"context_line":"            self.unbind_snat_servicenode(context, router_id)"},{"line_number":318,"context_line":"        super(L3_DVRsch_db_mixin, self).reschedule_router(context,"},{"line_number":319,"context_line":"            router_id, candidates\u003dNone)"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_4b705d72","line":316,"updated":"2014-09-12 20:28:11.000000000","message":"The line should be:\n\n   router.get(\u0027distributed\u0027, False)):","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0d4c991ceb2b9a6ef668b567c91e20551c0ec6f8","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        \"\"\""},{"line_number":314,"context_line":"        router \u003d self.get_router(context, router_id)"},{"line_number":315,"context_line":"        if router.get(\u0027external_gateway_info\u0027, False) and ("},{"line_number":316,"context_line":"            router.get(\u0027distributed\u0027), False):"},{"line_number":317,"context_line":"            self.unbind_snat_servicenode(context, router_id)"},{"line_number":318,"context_line":"        super(L3_DVRsch_db_mixin, self).reschedule_router(context,"},{"line_number":319,"context_line":"            router_id, candidates\u003dNone)"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_216ef101","line":316,"updated":"2014-09-10 14:36:07.000000000","message":"could you indent this line, so it is distinguishable from the if block? It will improve readability.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"b3e4df51c6a11e66b7eddd2ee659608eac4dbc38","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        \"\"\""},{"line_number":314,"context_line":"        router \u003d self.get_router(context, router_id)"},{"line_number":315,"context_line":"        if router.get(\u0027external_gateway_info\u0027, False) and ("},{"line_number":316,"context_line":"            router.get(\u0027distributed\u0027), False):"},{"line_number":317,"context_line":"            self.unbind_snat_servicenode(context, router_id)"},{"line_number":318,"context_line":"        super(L3_DVRsch_db_mixin, self).reschedule_router(context,"},{"line_number":319,"context_line":"            router_id, candidates\u003dNone)"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_8d974b39","line":316,"in_reply_to":"fa98f980_216ef101","updated":"2014-09-16 15:48:16.000000000","message":"ok","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"6ccb6a98a3140c3c388ae8cef8b153496193db13","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        \"\"\""},{"line_number":314,"context_line":"        router \u003d self.get_router(context, router_id)"},{"line_number":315,"context_line":"        if router.get(\u0027external_gateway_info\u0027, False) and ("},{"line_number":316,"context_line":"            router.get(\u0027distributed\u0027), False):"},{"line_number":317,"context_line":"            self.unbind_snat_servicenode(context, router_id)"},{"line_number":318,"context_line":"        super(L3_DVRsch_db_mixin, self).reschedule_router(context,"},{"line_number":319,"context_line":"            router_id, candidates\u003dNone)"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_cfc85278","line":316,"in_reply_to":"fa98f980_4b705d72","updated":"2014-09-16 15:25:42.000000000","message":"Then I think Kevin\u0027s previous comment also applies, None instead of False.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"e4f35bb24a184a40d3a2c673beeeac8a15bd49b2","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        \"\"\""},{"line_number":314,"context_line":"        router \u003d self.get_router(context, router_id)"},{"line_number":315,"context_line":"        if router.get(\u0027external_gateway_info\u0027, False) and ("},{"line_number":316,"context_line":"            router.get(\u0027distributed\u0027), False):"},{"line_number":317,"context_line":"            self.unbind_snat_servicenode(context, router_id)"},{"line_number":318,"context_line":"        super(L3_DVRsch_db_mixin, self).reschedule_router(context,"},{"line_number":319,"context_line":"            router_id, candidates\u003dNone)"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_aa504e0b","line":316,"in_reply_to":"fa98f980_8d974b39","updated":"2014-09-17 00:47:48.000000000","message":"Sorry folks, I forgot to mention this change has been moved to a seperate pacth ( https://review.openstack.org/#/c/119253/4 )\nI\u0027ll apply changes for your comments there.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"}],"neutron/scheduler/l3_agent_scheduler.py":[{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"6568edad5f5138d1d181d07e589598b0e54958fe","unresolved":false,"context_lines":[{"line_number":351,"context_line":"                 candidates\u003dNone):"},{"line_number":352,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":353,"context_line":"            return self._schedule_router("},{"line_number":354,"context_line":"                plugin, context, router_id, candidates\u003dcandidates)"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    def _choose_router_agent(self, plugin, context, candidates):"},{"line_number":357,"context_line":"        return random.choice(candidates)"}],"source_content_type":"text/x-python","patch_set":24,"id":"fa98f980_22ec45bb","line":354,"updated":"2014-09-19 00:49:16.000000000","message":"I don\u0027t think this is needed","commit_id":"951853778246b95e57f54ea46de54d1ccd91f96e"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"6568edad5f5138d1d181d07e589598b0e54958fe","unresolved":false,"context_lines":[{"line_number":368,"context_line":"                 candidates\u003dNone):"},{"line_number":369,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":370,"context_line":"            return self._schedule_router("},{"line_number":371,"context_line":"                plugin, context, router_id, candidates\u003dcandidates)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    def _choose_router_agent(self, plugin, context, candidates):"},{"line_number":374,"context_line":"        candidate_ids \u003d [candidate[\u0027id\u0027] for candidate in candidates]"}],"source_content_type":"text/x-python","patch_set":24,"id":"fa98f980_422a29e8","line":371,"updated":"2014-09-19 00:49:16.000000000","message":"ditto","commit_id":"951853778246b95e57f54ea46de54d1ccd91f96e"}],"neutron/tests/unit/db/test_l3_dvr_db.py":[{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"bd8133352c5d9759b57d4ae4229fb308952f36ae","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        router_dict \u003d {\u0027name\u0027: \u0027foo_router\u0027, \u0027admin_state_up\u0027: True,"},{"line_number":176,"context_line":"                       \u0027distributed\u0027: \u0027True\u0027, \u0027id\u0027: _uuid(),"},{"line_number":177,"context_line":"                       \u0027status\u0027: l3_const.ROUTER_STATUS_LEGACY_TO_DVR}"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        get_plugin_mock \u003d mock.patch(\u0027neutron.manager.\u0027"},{"line_number":180,"context_line":"                                     \u0027NeutronManager.\u0027"},{"line_number":181,"context_line":"                                     \u0027get_service_plugins\u0027).start()"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_a3ba0509","line":178,"updated":"2014-08-07 17:12:01.000000000","message":"You can use contexlib.nested() in here since you have multiple mocks.","commit_id":"20da3c4f8a7203dcd86eaca08aeb4b176cee2365"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d8f61e5b2c80366c790247154b7d17fbe3f89184","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            self.assertEqual("},{"line_number":205,"context_line":"                router_db[\u0027status\u0027], l3_const.ROUTER_STATUS_LEGACY_TO_DVR)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def test_migrate_router_legacy_to_dvr(self):"},{"line_number":208,"context_line":"        router_dict \u003d {\u0027name\u0027: \u0027foo_router\u0027, \u0027admin_state_up\u0027: True,"},{"line_number":209,"context_line":"                       \u0027distributed\u0027: \u0027True\u0027, \u0027id\u0027: _uuid(),"},{"line_number":210,"context_line":"                       \u0027status\u0027: l3_const.ROUTER_STATUS_LEGACY_TO_DVR}"}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_ba10b3a9","line":207,"updated":"2014-08-25 14:33:35.000000000","message":"Negative test case for migration to DVR, when VPN in use?","commit_id":"fc6e912542ef339c359d6ca2e641021e74e0c01b"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0d4c991ceb2b9a6ef668b567c91e20551c0ec6f8","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":24,"context_line":"from neutron.tests.unit import testlib_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"_uuid \u003d uuidutils.generate_uuid"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_41485587","line":26,"updated":"2014-09-10 14:36:07.000000000","message":"why does it appear twice?","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a00b499256c7e52f0d1f9c169f8abd406ead34fe","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":24,"context_line":"from neutron.tests.unit import testlib_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"_uuid \u003d uuidutils.generate_uuid"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_52d35b03","line":26,"in_reply_to":"fa98f980_41485587","updated":"2014-09-15 04:15:04.000000000","message":"It makes it twice as unique :-)","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"6ccb6a98a3140c3c388ae8cef8b153496193db13","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":24,"context_line":"from neutron.tests.unit import testlib_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"_uuid \u003d uuidutils.generate_uuid"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_4f92a24c","line":26,"in_reply_to":"fa98f980_52d35b03","updated":"2014-09-16 15:25:42.000000000","message":":))","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"b3e4df51c6a11e66b7eddd2ee659608eac4dbc38","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":24,"context_line":"from neutron.tests.unit import testlib_api"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"_uuid \u003d uuidutils.generate_uuid"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_0dc27b33","line":26,"in_reply_to":"fa98f980_52d35b03","updated":"2014-09-16 15:48:16.000000000","message":"I\u0027ll clean it up","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a00b499256c7e52f0d1f9c169f8abd406ead34fe","unresolved":false,"context_lines":[{"line_number":264,"context_line":"                              \u0027update_router\u0027),"},{"line_number":265,"context_line":"            mock.patch.object(l3_dvr_db.l3_db.L3_NAT_db_mixin,"},{"line_number":266,"context_line":"                              \u0027_make_router_dict\u0027)"},{"line_number":267,"context_line":"                              ) as (pm, rm, uprtr, sm, mrd):"},{"line_number":268,"context_line":"            plugin \u003d mock.Mock()"},{"line_number":269,"context_line":"            pm.return_value \u003d plugin"},{"line_number":270,"context_line":"            rm.return_value \u003d router_dict"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_d2066b85","line":267,"updated":"2014-09-15 04:15:04.000000000","message":"One slight readability improvement. Make the \u0027)\u0027 for the nested call line up with the \u0027with\u0027. It makes it easier to see where the context manager construction ends.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0d4c991ceb2b9a6ef668b567c91e20551c0ec6f8","unresolved":false,"context_lines":[{"line_number":266,"context_line":"                              \u0027_make_router_dict\u0027)"},{"line_number":267,"context_line":"                              ) as (pm, rm, uprtr, sm, mrd):"},{"line_number":268,"context_line":"            plugin \u003d mock.Mock()"},{"line_number":269,"context_line":"            pm.return_value \u003d plugin"},{"line_number":270,"context_line":"            rm.return_value \u003d router_dict"},{"line_number":271,"context_line":"            uprtr.return_value \u003d router_dict"},{"line_number":272,"context_line":"            sm.return_value \u003d router_dict"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_7caa62d3","line":269,"updated":"2014-09-10 14:36:07.000000000","message":"seems unnecessary.","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a00b499256c7e52f0d1f9c169f8abd406ead34fe","unresolved":false,"context_lines":[{"line_number":266,"context_line":"                              \u0027_make_router_dict\u0027)"},{"line_number":267,"context_line":"                              ) as (pm, rm, uprtr, sm, mrd):"},{"line_number":268,"context_line":"            plugin \u003d mock.Mock()"},{"line_number":269,"context_line":"            pm.return_value \u003d plugin"},{"line_number":270,"context_line":"            rm.return_value \u003d router_dict"},{"line_number":271,"context_line":"            uprtr.return_value \u003d router_dict"},{"line_number":272,"context_line":"            sm.return_value \u003d router_dict"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_72f5bf81","line":269,"updated":"2014-09-15 04:15:04.000000000","message":"these return values can all be setup as part of the patch calls.\n\nmock.patch.object(l3_dvr_db.l3_db.L3_NAT_db_mixin,\n                  \u0027get_router\u0027, return_value\u003drouter_dict)","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0d4c991ceb2b9a6ef668b567c91e20551c0ec6f8","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            rm.return_value \u003d router_dict"},{"line_number":271,"context_line":"            uprtr.return_value \u003d router_dict"},{"line_number":272,"context_line":"            sm.return_value \u003d router_dict"},{"line_number":273,"context_line":"            mrd.return_value \u003d router_dict"},{"line_number":274,"context_line":"            res_dict \u003d self.mixin.update_router(context, id,"},{"line_number":275,"context_line":"                {\u0027name\u0027: \u0027foo_router\u0027,"},{"line_number":276,"context_line":"                 \u0027router\u0027: {},"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_3cce1ab5","line":273,"updated":"2014-09-10 14:36:07.000000000","message":"hmm, I think it would be worthwhile to set the return_value of these variables in the mock.patch.object. This way, you get rid of those 2-3 letter variables, and the \"as\" statement from \"with\".\n\nwith contextlib.nested(\n    mock.patch.object(manager.NeutronManager,\n                      \u0027get_service_plugins\u0027),\n    mock.patch.object(l3_dvr_db.l3_db.L3_NAT_db_mixin,\n        \u0027get_router\u0027, return_value\u003drouter_dict),\n    mock.patch.object(l3_dvr_db.L3_NAT_with_dvr_db_mixin,\n        \u0027_update_router_db\u0027, return_value\u003drouter_dict),\n    mock.patch.object(l3_dvr_db.l3_db.L3_NAT_db_mixin,\n        \u0027update_router\u0027, return_value\u003drouter_dict),\n    mock.patch.object(l3_dvr_db.l3_db.L3_NAT_db_mixin,\n        \u0027_make_router_dict\u0027, return_value\u003drouter_dict)):","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0d4c991ceb2b9a6ef668b567c91e20551c0ec6f8","unresolved":false,"context_lines":[{"line_number":274,"context_line":"            res_dict \u003d self.mixin.update_router(context, id,"},{"line_number":275,"context_line":"                {\u0027name\u0027: \u0027foo_router\u0027,"},{"line_number":276,"context_line":"                 \u0027router\u0027: {},"},{"line_number":277,"context_line":"                 \u0027admin_state_up\u0027: True})"},{"line_number":278,"context_line":"            self.assertEqual(res_dict[\u0027status\u0027], \u0027ACTIVE\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_3c2a9a2c","line":277,"updated":"2014-09-10 14:36:07.000000000","message":"I\u0027m wondering... why not router_dict?","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"b3e4df51c6a11e66b7eddd2ee659608eac4dbc38","unresolved":false,"context_lines":[{"line_number":274,"context_line":"            res_dict \u003d self.mixin.update_router(context, id,"},{"line_number":275,"context_line":"                {\u0027name\u0027: \u0027foo_router\u0027,"},{"line_number":276,"context_line":"                 \u0027router\u0027: {},"},{"line_number":277,"context_line":"                 \u0027admin_state_up\u0027: True})"},{"line_number":278,"context_line":"            self.assertEqual(res_dict[\u0027status\u0027], \u0027ACTIVE\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa98f980_322945f3","line":277,"in_reply_to":"fa98f980_3c2a9a2c","updated":"2014-09-16 15:48:16.000000000","message":"I\u0027ll clean this up a bit as well (all of the above)","commit_id":"c8d5386ef1ddc2be25eca4a1cc3a0fec650c2299"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"cb4fa5a57afaab3b73483fe064c23ac80c3c14e8","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        self.mixin._validate_router_migration("},{"line_number":245,"context_line":"            router_db, distributed)"},{"line_number":246,"context_line":"        self.assertEqual("},{"line_number":247,"context_line":"            router_db[\u0027status\u0027], l3_const.ROUTER_STATUS_LEGACY_TO_DVR)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def test_migrate_router_legacy_to_dvr(self):"},{"line_number":250,"context_line":"        router_dict \u003d {\u0027name\u0027: \u0027foo_router\u0027, \u0027admin_state_up\u0027: True,"}],"source_content_type":"text/x-python","patch_set":24,"id":"fa98f980_1a632142","line":247,"updated":"2014-09-19 11:08:26.000000000","message":"nit: order for assert args (expected, actual) here and L269.","commit_id":"951853778246b95e57f54ea46de54d1ccd91f96e"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"b2c9ebb77bdc076203229e7fde0a39d02c6860c2","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        router_db \u003d self._create_router(router)"},{"line_number":270,"context_line":"        self.mixin._validate_router_migration("},{"line_number":271,"context_line":"            router_db, distributed)"},{"line_number":272,"context_line":"        self.assertEqual("},{"line_number":273,"context_line":"            router_db[\u0027status\u0027], l3_const.ROUTER_STATUS_LEGACY_TO_DVR)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def test_migrate_router_legacy_to_dvr(self):"}],"source_content_type":"text/x-python","patch_set":26,"id":"da9df570_6c2f3bf7","line":272,"updated":"2014-09-23 12:29:25.000000000","message":"Nit: assert arg ordering (expected, actual). Here and L 295","commit_id":"aa419f46d955f09f9dd273c0efdda03d82baedf8"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"93ae04c23a31a2acdfeb55bf6933f03a3ae4eab7","unresolved":false,"context_lines":[{"line_number":318,"context_line":"        router_db \u003d self._create_router(router)"},{"line_number":319,"context_line":"        self.mixin._validate_router_migration("},{"line_number":320,"context_line":"            router_db, distributed)"},{"line_number":321,"context_line":"        self.assertEqual("},{"line_number":322,"context_line":"            router_db[\u0027status\u0027], l3_const.ROUTER_STATUS_LEGACY_TO_DVR)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"    def test_migrate_router_legacy_to_dvr(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"da9df570_bb6037a6","line":321,"updated":"2014-09-25 12:47:28.000000000","message":"Nit: args for asserts should be ordered (expected, actual). Here and L344.","commit_id":"2f4c50a8957ae98f519a4eba94c5a8488b4e7fda"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02ae6d227a6345960fbbead051eeecf109730210","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        router_id \u003d router_db[\u0027id\u0027]"},{"line_number":82,"context_line":"        self.assertFalse(router_db.extra_attributes.distributed)"},{"line_number":83,"context_line":"        with contextlib.nested("},{"line_number":84,"context_line":"            mock.patch.object(self.mixin, \u0027_validate_router_migration\u0027),"},{"line_number":85,"context_line":"            mock.patch.object(self.mixin, \u0027_update_distributed_attr\u0027),"},{"line_number":86,"context_line":"            mock.patch.object(self.mixin, \u0027_get_router\u0027)) as (v, f, g):"},{"line_number":87,"context_line":"                g.return_value \u003d router_db"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_0e095595","line":84,"updated":"2014-11-19 22:07:19.000000000","message":"nit:  None of these actually need a mock.patch context manager.  f and g and already there, fine.  maybe v could be added without it (and with a better name?","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"},{"author":{"_account_id":10971,"name":"Michael Smith","email":"michael.smith6@hp.com","username":"mrsmith"},"change_message_id":"eab7d45cf1b98bf94819421f23d51d95c792940d","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        router_id \u003d router_db[\u0027id\u0027]"},{"line_number":82,"context_line":"        self.assertFalse(router_db.extra_attributes.distributed)"},{"line_number":83,"context_line":"        with contextlib.nested("},{"line_number":84,"context_line":"            mock.patch.object(self.mixin, \u0027_validate_router_migration\u0027),"},{"line_number":85,"context_line":"            mock.patch.object(self.mixin, \u0027_update_distributed_attr\u0027),"},{"line_number":86,"context_line":"            mock.patch.object(self.mixin, \u0027_get_router\u0027)) as (v, f, g):"},{"line_number":87,"context_line":"                g.return_value \u003d router_db"}],"source_content_type":"text/x-python","patch_set":33,"id":"5a890539_9cf63ef8","line":84,"in_reply_to":"5a890539_0e095595","updated":"2014-11-21 02:43:08.000000000","message":"I\u0027ll clean it up","commit_id":"7823a0b46099c9093bef95c89212fe830c98af14"}]}
