)]}'
{"nova/api/openstack/compute/flavor_manage.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b4325bc4aab0f7374eca46a83446d679df9f657","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        except (exception.FlavorExists,"},{"line_number":84,"context_line":"                exception.FlavorIdExists) as err:"},{"line_number":85,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003derr.format_message())"},{"line_number":86,"context_line":"        except exception.ObjectActionError:"},{"line_number":87,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003d_("},{"line_number":88,"context_line":"                \u0027Not all flavors have been migrated to the API database\u0027))"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_ae02c83b","side":"PARENT","line":86,"updated":"2017-04-27 15:51:31.000000000","message":"This was only here for the _ensure_migrated check when creating a flavor, which is removed now.","commit_id":"49d82a5b22258eede079dc22f6bf73849831562d"}],"nova/objects/flavor.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"aebdd829562c66fe87f2ec095b7348ed6932b827","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":540,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":541,"context_line":"        if (\u0027projects\u0027 not in self and"},{"line_number":542,"context_line":"                action !\u003d fields.NotificationAction.DELETE):"},{"line_number":543,"context_line":"            self._load_projects()"},{"line_number":544,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":545,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"}],"source_content_type":"text/x-python","patch_set":1,"id":"5ff73747_8ac4aa92","line":542,"updated":"2017-04-27 07:39:50.000000000","message":"I see now. This is why we have no flavor.projects available during the notification schema population and this is the cause that the produced notification is different in the sample test. I think this is OK, you can change the sample file of the flavor.destroy.","commit_id":"f640234cd472b357ec55b90ca6a08a2c72551274"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b4325bc4aab0f7374eca46a83446d679df9f657","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":540,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":541,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":542,"context_line":"            if action \u003d\u003d fields.NotificationAction.DELETE:"},{"line_number":543,"context_line":"                # The flavor is deleted so we can\u0027t lazy-load projects."},{"line_number":544,"context_line":"                self.projects \u003d []"},{"line_number":545,"context_line":"            else:"},{"line_number":546,"context_line":"                self._load_projects()"},{"line_number":547,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":548,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":549,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_ceb3d497","line":546,"range":{"start_line":542,"start_character":12,"end_line":546,"end_character":37},"updated":"2017-04-27 15:51:31.000000000","message":"This is really a bug fix, exposed when removing the fallback code for the main DB, and should maybe be split out. Honestly I don\u0027t know how the hell the tests worked even with the fallback though since looking up a deleted instance that wasn\u0027t in the main DB should raise FlavorNotFound too.","commit_id":"e26f7216467cbf3a06e57caddf88491212197aca"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c4a35d0265c5b255d595360723eed63904066de2","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":540,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":541,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":542,"context_line":"            if action \u003d\u003d fields.NotificationAction.DELETE:"},{"line_number":543,"context_line":"                # The flavor is deleted so we can\u0027t lazy-load projects."},{"line_number":544,"context_line":"                self.projects \u003d []"},{"line_number":545,"context_line":"            else:"},{"line_number":546,"context_line":"                self._load_projects()"},{"line_number":547,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":548,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":549,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_8810ff4f","line":546,"range":{"start_line":542,"start_character":12,"end_line":546,"end_character":37},"in_reply_to":"5ff73747_4549c2b4","updated":"2017-04-28 12:50:10.000000000","message":"Good point. I\u0027m not sure if I should change it to None or leave it as [] which is what it was doing before, but None maybe makes more sense.","commit_id":"e26f7216467cbf3a06e57caddf88491212197aca"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bda0a5f50a40abeb79383840f2151e8ac89454d","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":540,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":541,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":542,"context_line":"            if action \u003d\u003d fields.NotificationAction.DELETE:"},{"line_number":543,"context_line":"                # The flavor is deleted so we can\u0027t lazy-load projects."},{"line_number":544,"context_line":"                self.projects \u003d []"},{"line_number":545,"context_line":"            else:"},{"line_number":546,"context_line":"                self._load_projects()"},{"line_number":547,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":548,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":549,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_2b4fa593","line":546,"range":{"start_line":542,"start_character":12,"end_line":546,"end_character":37},"in_reply_to":"5ff73747_68bed3ff","updated":"2017-04-28 13:44:50.000000000","message":"https://review.openstack.org/#/c/461032/","commit_id":"e26f7216467cbf3a06e57caddf88491212197aca"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c8e2797aa0fecebb1175a965b209c9a31fca4950","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":540,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":541,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":542,"context_line":"            if action \u003d\u003d fields.NotificationAction.DELETE:"},{"line_number":543,"context_line":"                # The flavor is deleted so we can\u0027t lazy-load projects."},{"line_number":544,"context_line":"                self.projects \u003d []"},{"line_number":545,"context_line":"            else:"},{"line_number":546,"context_line":"                self._load_projects()"},{"line_number":547,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":548,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":549,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_68bed3ff","line":546,"range":{"start_line":542,"start_character":12,"end_line":546,"end_character":37},"in_reply_to":"5ff73747_8810ff4f","updated":"2017-04-28 12:57:04.000000000","message":"I\u0027ll fix this separately for bug 1687012.","commit_id":"e26f7216467cbf3a06e57caddf88491212197aca"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d9c825fae4e55410e90c2fed2d6033d0e7b62d56","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        # lazy-load projects (which is a problem for instance-bound"},{"line_number":540,"context_line":"        # flavors and compute-cell operations), just load them here."},{"line_number":541,"context_line":"        if \u0027projects\u0027 not in self:"},{"line_number":542,"context_line":"            if action \u003d\u003d fields.NotificationAction.DELETE:"},{"line_number":543,"context_line":"                # The flavor is deleted so we can\u0027t lazy-load projects."},{"line_number":544,"context_line":"                self.projects \u003d []"},{"line_number":545,"context_line":"            else:"},{"line_number":546,"context_line":"                self._load_projects()"},{"line_number":547,"context_line":"        notification_type \u003d flavor_notification.FlavorNotification"},{"line_number":548,"context_line":"        payload_type \u003d flavor_notification.FlavorPayload"},{"line_number":549,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_4549c2b4","line":546,"range":{"start_line":542,"start_character":12,"end_line":546,"end_character":37},"in_reply_to":"5ff73747_ceb3d497","updated":"2017-04-28 12:44:59.000000000","message":"I think the _load_projects()\u0027s db.flavor_access_get_by_flavor_id() fallback actually executed an all() query here [1]. This did not result inFlavorNotFound but results in []. Now you removed that fallback and therefore you see FlavorNotFound. \n\nI suggest to set self.projects to None in the L544 as that would really signal that the flavor.projects data was not available instead of lying that there was no projects associated.\n[1]https://github.com/openstack/nova/blob/5a363a0d72e7dd8d79d7e950effc1d8a5fdc801b/nova/db/sqlalchemy/api.py#L5198","commit_id":"e26f7216467cbf3a06e57caddf88491212197aca"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b4325bc4aab0f7374eca46a83446d679df9f657","unresolved":false,"context_lines":[{"line_number":655,"context_line":""},{"line_number":656,"context_line":"    for flavor_id in main_db_ids:"},{"line_number":657,"context_line":"        try:"},{"line_number":658,"context_line":"            db_flavor \u003d db.flavor_get(ctxt, flavor_id)"},{"line_number":659,"context_line":"            # get the projects and extra_specs separately via flavorid"},{"line_number":660,"context_line":"            db_flavor[\u0027projects\u0027] \u003d db.flavor_access_get_by_flavor_id("},{"line_number":661,"context_line":"                ctxt, db_flavor[\u0027flavorid\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_2e535841","line":658,"updated":"2017-04-27 15:51:31.000000000","message":"This was all redone to call the main DB APIs directly since that fallback code was removed from the object.","commit_id":"e26f7216467cbf3a06e57caddf88491212197aca"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"7a49c753e24f2ce6078ad489c2776ad448b5a5aa","unresolved":false,"context_lines":[{"line_number":645,"context_line":"    context.session.query(models.InstanceTypes).filter_by(name\u003dname).delete()"},{"line_number":646,"context_line":""},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"# TODO(mriedem): remove all of this? would it break anyone skipping ocata?"},{"line_number":649,"context_line":"def migrate_flavors(ctxt, count, hard_delete\u003dFalse):"},{"line_number":650,"context_line":"    main_db_ids \u003d _get_main_db_flavor_ids(ctxt, count)"},{"line_number":651,"context_line":"    if not main_db_ids:"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_6c79d1fa","line":648,"range":{"start_line":648,"start_character":0,"end_line":648,"end_character":74},"updated":"2017-05-30 15:26:53.000000000","message":"I guess we should get dansmith to voice his opinion here","commit_id":"c9e560d022659f112e83608f41ebf55b29a6033a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b25ad19c5cab316cfe373c5256bf0f7b6c96e9b1","unresolved":false,"context_lines":[{"line_number":645,"context_line":"    context.session.query(models.InstanceTypes).filter_by(name\u003dname).delete()"},{"line_number":646,"context_line":""},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"# TODO(mriedem): remove all of this? would it break anyone skipping ocata?"},{"line_number":649,"context_line":"def migrate_flavors(ctxt, count, hard_delete\u003dFalse):"},{"line_number":650,"context_line":"    main_db_ids \u003d _get_main_db_flavor_ids(ctxt, count)"},{"line_number":651,"context_line":"    if not main_db_ids:"}],"source_content_type":"text/x-python","patch_set":6,"id":"df140735_996197ac","line":648,"range":{"start_line":648,"start_character":0,"end_line":648,"end_character":74},"in_reply_to":"df140735_6c79d1fa","updated":"2017-06-02 15:41:38.000000000","message":"I just found that Dan has nearly the exact same change from February:\n\nhttps://review.openstack.org/#/c/431722/\n\nAnd he is removing them.","commit_id":"c9e560d022659f112e83608f41ebf55b29a6033a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"8722cb7c8b64651d3a0c7b74ffa0667636c01c56","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        self._in_api \u003d False"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @property"},{"line_number":239,"context_line":"    def in_api(self):"},{"line_number":240,"context_line":"        if self._in_api:"},{"line_number":241,"context_line":"            return True"},{"line_number":242,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f2577a7_4dc09951","side":"PARENT","line":239,"updated":"2017-09-08 14:12:48.000000000","message":"Trying to work out if that is allowed, because its only accessed by new code as such, I think that is a yes. Old code runs locally and keeps working, I think.","commit_id":"5bcfaf3e8aeafd0de4bc7579fea65e11d23e880b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"820de02d36d1149e5caaad00b74f3f11d0f3437b","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        self._in_api \u003d False"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @property"},{"line_number":239,"context_line":"    def in_api(self):"},{"line_number":240,"context_line":"        if self._in_api:"},{"line_number":241,"context_line":"            return True"},{"line_number":242,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f2577a7_74295099","side":"PARENT","line":239,"in_reply_to":"5f2577a7_4dc09951","updated":"2017-09-14 23:00:45.000000000","message":"This was only here for the fallback from API to cell lookup which we aren\u0027t doing anymore now, hence this change, so this is safe to remove.","commit_id":"5bcfaf3e8aeafd0de4bc7579fea65e11d23e880b"}],"nova/tests/functional/wsgi/test_flavor_manage.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0b4325bc4aab0f7374eca46a83446d679df9f657","unresolved":false,"context_lines":[{"line_number":196,"context_line":"        resp \u003d self.api.api_get(\u0027flavors\u0027)"},{"line_number":197,"context_line":"        self.assertFlavorNotInList(new_flav[\u0027flavor\u0027], resp.body)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def test_flavor_create_frozen(self):"},{"line_number":200,"context_line":"        ctx \u003d context.get_admin_context()"},{"line_number":201,"context_line":"        db.flavor_create(ctx, {"},{"line_number":202,"context_line":"            \u0027name\u0027: \u0027foo\u0027, \u0027memory_mb\u0027: 512, \u0027vcpus\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_c9750e66","side":"PARENT","line":199,"updated":"2017-04-27 15:51:31.000000000","message":"This is removed because it\u0027s testing the _ensure_migrated path.","commit_id":"49d82a5b22258eede079dc22f6bf73849831562d"}]}
