)]}'
{"neutron/db/flavors_db.py":[{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"807b2a92b6757fc2f6f782f288ee00e0e6f7aec5","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            context.session.add(fl_db)"},{"line_number":113,"context_line":"        # if object is not t in session, add it in it, so that it will be able"},{"line_number":114,"context_line":"        # to load relationships"},{"line_number":115,"context_line":"        context.session.add(fl_db)"},{"line_number":116,"context_line":"        return self._make_flavor_dict(fl_db)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_flavor(self, context, flavor_id, flavor):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5da102_b75ca926","line":115,"range":{"start_line":115,"start_character":24,"end_line":115,"end_character":27},"updated":"2016-10-28 11:31:35.000000000","message":"session.merge didn\u0027t work","commit_id":"0c39ac9849eda5f04289eda7ff1398611f86e094"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"72ab75095601d43bda370ec3deb3ac995af94429","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            context.session.add(fl_db)"},{"line_number":113,"context_line":"        # if object is not t in session, add it in it, so that it will be able"},{"line_number":114,"context_line":"        # to load relationships"},{"line_number":115,"context_line":"        context.session.add(fl_db)"},{"line_number":116,"context_line":"        return self._make_flavor_dict(fl_db)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_flavor(self, context, flavor_id, flavor):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5da102_c3c40061","line":115,"range":{"start_line":115,"start_character":24,"end_line":115,"end_character":27},"in_reply_to":"ba5da102_b75ca926","updated":"2016-10-28 13:14:09.000000000","message":"I wonder if we can turn this pattern into a context manager so we don\u0027t have to explain everywhere why we re-add it to the session.","commit_id":"0c39ac9849eda5f04289eda7ff1398611f86e094"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"b85986995be2575b306c67944bb90db6d7439869","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            context.session.add(fl_db)"},{"line_number":113,"context_line":"        # if object is not t in session, add it in it, so that it will be able"},{"line_number":114,"context_line":"        # to load relationships"},{"line_number":115,"context_line":"        context.session.add(fl_db)"},{"line_number":116,"context_line":"        return self._make_flavor_dict(fl_db)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_flavor(self, context, flavor_id, flavor):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5da102_4e99be1e","line":115,"range":{"start_line":115,"start_character":24,"end_line":115,"end_character":27},"in_reply_to":"ba5da102_c345e0b3","updated":"2016-11-01 09:46:38.000000000","message":"Neutron always has context.session as property https://github.com/openstack/neutron/commit/aa630f2ac88bfb4a9828b432bddfed1f04e077d3#diff-f4464bd554a1ded59d6fd6b7e22ee289L118. So, I guess, people don\u0027t care much about how this should be. I mean, this was working and I\u0027m not sure that there was clear understanding that after line 112 we should not load any relationships for this object.","commit_id":"0c39ac9849eda5f04289eda7ff1398611f86e094"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"6d2ec5de4ced4a35ac5a5340d9abe9d61c769947","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            context.session.add(fl_db)"},{"line_number":113,"context_line":"        # if object is not t in session, add it in it, so that it will be able"},{"line_number":114,"context_line":"        # to load relationships"},{"line_number":115,"context_line":"        context.session.add(fl_db)"},{"line_number":116,"context_line":"        return self._make_flavor_dict(fl_db)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_flavor(self, context, flavor_id, flavor):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5da102_832128b7","line":115,"range":{"start_line":115,"start_character":24,"end_line":115,"end_character":27},"in_reply_to":"ba5da102_c345e0b3","updated":"2016-10-28 13:34:07.000000000","message":"also id want to know if you\u0027re looking to transfer fl_db with all of its attributes intact, so they don\u0027t reload again, also what \"didn\u0027t work\" about merge, though using add() is fine here.","commit_id":"0c39ac9849eda5f04289eda7ff1398611f86e094"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"fe6339033d6bd118976b19e9bf0e8f79ea4a9eec","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            context.session.add(fl_db)"},{"line_number":113,"context_line":"        # if object is not t in session, add it in it, so that it will be able"},{"line_number":114,"context_line":"        # to load relationships"},{"line_number":115,"context_line":"        context.session.add(fl_db)"},{"line_number":116,"context_line":"        return self._make_flavor_dict(fl_db)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_flavor(self, context, flavor_id, flavor):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5da102_c345e0b3","line":115,"range":{"start_line":115,"start_character":24,"end_line":115,"end_character":27},"in_reply_to":"ba5da102_c3c40061","updated":"2016-10-28 13:28:28.000000000","message":"how is \"context.session\" even here?  the \"enginefacade\" way is to not assume some caller happened to have this here.    explicit vs. implicit and all that.   it looks like there is some magic creating it at https://github.com/openstack/neutron/blob/master/neutron/context.py#L128-L135 but enginefacade is supposed to take over all of that.\n\nSince there\u0027s already a session going on it\u0027s not clear what this block is supposed to accomplish.   At line 112 do you want there to be a. a SQL flush or b. a SQL flush plus a commit of the transaction?   is the rationale for .writer. that we are being called from a .reader. and this method wishes to use two separate transactions?","commit_id":"0c39ac9849eda5f04289eda7ff1398611f86e094"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d109dacff6e2b9cfe82de1e5aa10be4e00d9db3c","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        # if object is not t in session, add it in it, so that it will be able"},{"line_number":114,"context_line":"        # to load relationships"},{"line_number":115,"context_line":"        context.session.add(fl_db)"},{"line_number":116,"context_line":"        return self._make_flavor_dict(fl_db)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_flavor(self, context, flavor_id, flavor):"},{"line_number":119,"context_line":"        fl \u003d flavor[\u0027flavor\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5da102_6d05b678","line":116,"updated":"2016-10-31 19:33:38.000000000","message":"let\u0027s just move this into the transaction as well as L239 to avoid this context.session.add thing.\n\nAs a general rule let\u0027s see how many places we can avoid using the DB object outside of the transaction. For the more tricky places like ports we will probably have to use the context.session.add approach you came up with here.","commit_id":"0c39ac9849eda5f04289eda7ff1398611f86e094"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"b85986995be2575b306c67944bb90db6d7439869","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        # if object is not t in session, add it in it, so that it will be able"},{"line_number":114,"context_line":"        # to load relationships"},{"line_number":115,"context_line":"        context.session.add(fl_db)"},{"line_number":116,"context_line":"        return self._make_flavor_dict(fl_db)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_flavor(self, context, flavor_id, flavor):"},{"line_number":119,"context_line":"        fl \u003d flavor[\u0027flavor\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba5da102_6eb76286","line":116,"in_reply_to":"ba5da102_6d05b678","updated":"2016-11-01 09:46:38.000000000","message":"OK","commit_id":"0c39ac9849eda5f04289eda7ff1398611f86e094"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"3b8d8f9276e5af68aa52176f753350d8029d7985","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self._ensure_flavor_not_in_use(context, flavor_id)"},{"line_number":122,"context_line":"            fl_db \u003d self._get_flavor(context, flavor_id)"},{"line_number":123,"context_line":"            fl_db.update(fl)"},{"line_number":124,"context_line":"            return self._make_flavor_dict(fl_db)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def get_flavor(self, context, flavor_id, fields\u003dNone):"},{"line_number":127,"context_line":"        fl \u003d self._get_flavor(context, flavor_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_98a5b148","line":124,"updated":"2016-11-02 09:36:35.000000000","message":"why does this need to be under the db transaction?","commit_id":"48d9583c66ddc369aa7e2bcf091d2e837074ab92"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0331de40fe29d6b363cd9b3b5e62e71a79666330","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self._ensure_flavor_not_in_use(context, flavor_id)"},{"line_number":122,"context_line":"            fl_db \u003d self._get_flavor(context, flavor_id)"},{"line_number":123,"context_line":"            fl_db.update(fl)"},{"line_number":124,"context_line":"            return self._make_flavor_dict(fl_db)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def get_flavor(self, context, flavor_id, fields\u003dNone):"},{"line_number":127,"context_line":"        fl \u003d self._get_flavor(context, flavor_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_dced4fb8","line":124,"in_reply_to":"ba5da102_55faf743","updated":"2016-11-02 14:48:12.000000000","message":"None of this code is using anything from the DB:\n\n    @staticmethod\n    def _make_flavor_dict(flavor_db, fields\u003dNone):\n        res \u003d {\u0027id\u0027: flavor_db[\u0027id\u0027],\n               \u0027name\u0027: flavor_db[\u0027name\u0027],\n               \u0027description\u0027: flavor_db[\u0027description\u0027],\n               \u0027service_type\u0027: flavor_db[\u0027service_type\u0027],\n               \u0027enabled\u0027: flavor_db[\u0027enabled\u0027],\n               \u0027service_profiles\u0027: []}\n        if flavor_db.service_profiles:\n            res[\u0027service_profiles\u0027] \u003d [sp[\u0027service_profile_id\u0027]\n                                       for sp in flavor_db.service_profiles]\n        return db_utils.resource_fields(res, fields)\n\n\nso it should not be in the transaction","commit_id":"48d9583c66ddc369aa7e2bcf091d2e837074ab92"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"6c63c4bed6b19952b17b5a08805280f826fe4475","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self._ensure_flavor_not_in_use(context, flavor_id)"},{"line_number":122,"context_line":"            fl_db \u003d self._get_flavor(context, flavor_id)"},{"line_number":123,"context_line":"            fl_db.update(fl)"},{"line_number":124,"context_line":"            return self._make_flavor_dict(fl_db)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def get_flavor(self, context, flavor_id, fields\u003dNone):"},{"line_number":127,"context_line":"        fl \u003d self._get_flavor(context, flavor_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_da239656","line":124,"in_reply_to":"ba5da102_98a5b148","updated":"2016-11-02 12:57:47.000000000","message":"At the end of the block the transaction will be over. As we also close the connection at that point, _make_flavor_dict() will fail. Previously it worked because it created a new connection / transaction implicitly.","commit_id":"48d9583c66ddc369aa7e2bcf091d2e837074ab92"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"304f1bd52326032db557b93c5562de4a72d1c9ff","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self._ensure_flavor_not_in_use(context, flavor_id)"},{"line_number":122,"context_line":"            fl_db \u003d self._get_flavor(context, flavor_id)"},{"line_number":123,"context_line":"            fl_db.update(fl)"},{"line_number":124,"context_line":"            return self._make_flavor_dict(fl_db)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def get_flavor(self, context, flavor_id, fields\u003dNone):"},{"line_number":127,"context_line":"        fl \u003d self._get_flavor(context, flavor_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_183e01da","line":124,"in_reply_to":"ba5da102_98a5b148","updated":"2016-11-02 09:38:23.000000000","message":"Can you read a commit message, please?","commit_id":"48d9583c66ddc369aa7e2bcf091d2e837074ab92"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"83c2766d70f78da31adc9857a06913c21f824b16","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self._ensure_flavor_not_in_use(context, flavor_id)"},{"line_number":122,"context_line":"            fl_db \u003d self._get_flavor(context, flavor_id)"},{"line_number":123,"context_line":"            fl_db.update(fl)"},{"line_number":124,"context_line":"            return self._make_flavor_dict(fl_db)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def get_flavor(self, context, flavor_id, fields\u003dNone):"},{"line_number":127,"context_line":"        fl \u003d self._get_flavor(context, flavor_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_55faf743","line":124,"in_reply_to":"ba5da102_da239656","updated":"2016-11-02 13:24:45.000000000","message":"+1","commit_id":"48d9583c66ddc369aa7e2bcf091d2e837074ab92"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"b474256a253b0b9244443294d588b0e13361858e","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self._ensure_flavor_not_in_use(context, flavor_id)"},{"line_number":122,"context_line":"            fl_db \u003d self._get_flavor(context, flavor_id)"},{"line_number":123,"context_line":"            fl_db.update(fl)"},{"line_number":124,"context_line":"            return self._make_flavor_dict(fl_db)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def get_flavor(self, context, flavor_id, fields\u003dNone):"},{"line_number":127,"context_line":"        fl \u003d self._get_flavor(context, flavor_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_fc64d322","line":124,"in_reply_to":"ba5da102_dced4fb8","updated":"2016-11-02 14:52:03.000000000","message":"Flavor.service_profiles is a database relationship to \"FlavorServiceProfileBinding\"","commit_id":"48d9583c66ddc369aa7e2bcf091d2e837074ab92"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"3b8d8f9276e5af68aa52176f753350d8029d7985","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                                                 enabled\u003dsp[\u0027enabled\u0027],"},{"line_number":215,"context_line":"                                                 metainfo\u003dsp[\u0027metainfo\u0027])"},{"line_number":216,"context_line":"            context.session.add(sp_db)"},{"line_number":217,"context_line":"            return self._make_service_profile_dict(sp_db)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def update_service_profile(self, context,"},{"line_number":220,"context_line":"                               service_profile_id, service_profile):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_f86a2dec","line":217,"updated":"2016-11-02 09:36:35.000000000","message":"ditto","commit_id":"48d9583c66ddc369aa7e2bcf091d2e837074ab92"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"3b8d8f9276e5af68aa52176f753350d8029d7985","unresolved":false,"context_lines":[{"line_number":228,"context_line":"                                                    service_profile_id)"},{"line_number":229,"context_line":"            sp_db \u003d self._get_service_profile(context, service_profile_id)"},{"line_number":230,"context_line":"            sp_db.update(sp)"},{"line_number":231,"context_line":"            return self._make_service_profile_dict(sp_db)"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def get_service_profile(self, context, sp_id, fields\u003dNone):"},{"line_number":234,"context_line":"        sp_db \u003d self._get_service_profile(context, sp_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_1870c1db","line":231,"updated":"2016-11-02 09:36:35.000000000","message":"ditto","commit_id":"48d9583c66ddc369aa7e2bcf091d2e837074ab92"}]}
