)]}'
{"nova/objects/flavor.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c85a4f01b58d757f37cdadda3045778b14bb754","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    return dict(flavor_model, extra_specs\u003dextra_specs)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"# NOTE(danms): There are some issues with the oslo_db context manager"},{"line_number":43,"context_line":"# decorators with static methods. We pull these out for now and can"},{"line_number":44,"context_line":"# move them back into the actual staticmethods on the object when those"},{"line_number":45,"context_line":"# issues are resolved."}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_2ae532db","line":42,"updated":"2016-03-23 23:31:41.000000000","message":"So why do we have these up here but _flavor_get_query_from_db is in the Flavor class?","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ce6f0400d2c0601444f576a6d18256a4a809a463","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    return dict(flavor_model, extra_specs\u003dextra_specs)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"# NOTE(danms): There are some issues with the oslo_db context manager"},{"line_number":43,"context_line":"# decorators with static methods. We pull these out for now and can"},{"line_number":44,"context_line":"# move them back into the actual staticmethods on the object when those"},{"line_number":45,"context_line":"# issues are resolved."}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_5b501e0b","line":42,"in_reply_to":"fa0719c6_2ae532db","updated":"2016-03-24 13:39:54.000000000","message":"Because there is an issue with putting the decorator on methods that don\u0027t take the context as the first argument, and there are issues with stub_out on python3. Neither of these are going to get sorted and released so we can see them for weeks. The get methods are classmethods which don\u0027t suffer from the problem, by luck.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c85a4f01b58d757f37cdadda3045778b14bb754","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"@db_api.api_context_manager.writer"},{"line_number":58,"context_line":"def _flavor_add_project(context, flavor_id, project_id):"},{"line_number":59,"context_line":"    project \u003d api_models.FlavorProjects()"},{"line_number":60,"context_line":"    project.update({\u0027flavor_id\u0027: flavor_id,"},{"line_number":61,"context_line":"                    \u0027project_id\u0027: project_id})"},{"line_number":62,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_8aed5eb9","line":59,"updated":"2016-03-23 23:31:41.000000000","message":"I\u0027m assuming you intended to return this.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ce6f0400d2c0601444f576a6d18256a4a809a463","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"@db_api.api_context_manager.writer"},{"line_number":58,"context_line":"def _flavor_add_project(context, flavor_id, project_id):"},{"line_number":59,"context_line":"    project \u003d api_models.FlavorProjects()"},{"line_number":60,"context_line":"    project.update({\u0027flavor_id\u0027: flavor_id,"},{"line_number":61,"context_line":"                    \u0027project_id\u0027: project_id})"},{"line_number":62,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_bbe5fa09","line":59,"in_reply_to":"fa0719c6_8aed5eb9","updated":"2016-03-24 13:39:54.000000000","message":"no.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c85a4f01b58d757f37cdadda3045778b14bb754","unresolved":false,"context_lines":[{"line_number":74,"context_line":"             delete()"},{"line_number":75,"context_line":"    if result \u003d\u003d 0:"},{"line_number":76,"context_line":"        raise exception.FlavorAccessNotFound(flavor_id\u003dflavor_id,"},{"line_number":77,"context_line":"                                                 project_id\u003dproject_id)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"# TODO(berrange): Remove NovaObjectDictCompat"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_6a28cae2","line":77,"updated":"2016-03-23 23:31:41.000000000","message":"alignment","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c85a4f01b58d757f37cdadda3045778b14bb754","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        else:"},{"line_number":117,"context_line":"            try:"},{"line_number":118,"context_line":"                if \u0027id\u0027 in self:"},{"line_number":119,"context_line":"                    self._flavor_get_from_db(self._context, self.id)"},{"line_number":120,"context_line":"                else:"},{"line_number":121,"context_line":"                    flavor \u003d self._flavor_get_by_flavor_id_from_db("},{"line_number":122,"context_line":"                        self._context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_6ab1ea46","line":119,"range":{"start_line":119,"start_character":20,"end_line":119,"end_character":68},"updated":"2016-03-23 23:31:41.000000000","message":"So if it\u0027s not in the API DB this will raise FlavorNotFound and we just return False.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a5916ca41b905b602ffeeb69f3a86365c0bb6dd6","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        else:"},{"line_number":117,"context_line":"            try:"},{"line_number":118,"context_line":"                if \u0027id\u0027 in self:"},{"line_number":119,"context_line":"                    self._flavor_get_from_db(self._context, self.id)"},{"line_number":120,"context_line":"                else:"},{"line_number":121,"context_line":"                    flavor \u003d self._flavor_get_by_flavor_id_from_db("},{"line_number":122,"context_line":"                        self._context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_ef7a1e23","line":119,"range":{"start_line":119,"start_character":20,"end_line":119,"end_character":68},"in_reply_to":"fa0719c6_6ab1ea46","updated":"2016-03-24 08:33:59.000000000","message":"If this flavor is in the nova DB, use the \u0027id\u0027 which get from nova DB to query api DB. But if user already creates some flavors in the API DB, there may have new created flavors get same \u0027id\u0027 with nova DB one in the API DB. In this case, the thing goes wrong.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ce6f0400d2c0601444f576a6d18256a4a809a463","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        else:"},{"line_number":117,"context_line":"            try:"},{"line_number":118,"context_line":"                if \u0027id\u0027 in self:"},{"line_number":119,"context_line":"                    self._flavor_get_from_db(self._context, self.id)"},{"line_number":120,"context_line":"                else:"},{"line_number":121,"context_line":"                    flavor \u003d self._flavor_get_by_flavor_id_from_db("},{"line_number":122,"context_line":"                        self._context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_5b613ea8","line":119,"range":{"start_line":119,"start_character":20,"end_line":119,"end_character":68},"in_reply_to":"fa0719c6_ef7a1e23","updated":"2016-03-24 13:39:54.000000000","message":"They can\u0027t do that. See the last patch in this set. It blocks flavor creation until all the flavors are migrated.\n\nWe can\u0027t really block creation until we have a way to create flavors in the new DB, or until we have the migration code in place. Since both of these are big and complicated, the blocker patch is the last in this series. I have a -2 on the create patch for that reason, so that we will land the last patches all together once people are happy.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c85a4f01b58d757f37cdadda3045778b14bb754","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                else:"},{"line_number":121,"context_line":"                    flavor \u003d self._flavor_get_by_flavor_id_from_db("},{"line_number":122,"context_line":"                        self._context,"},{"line_number":123,"context_line":"                        self.flavorid)"},{"line_number":124,"context_line":"                    # Fix us up so we can use our real id"},{"line_number":125,"context_line":"                    self.id \u003d flavor[\u0027id\u0027]"},{"line_number":126,"context_line":"                self._in_api \u003d True"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_2a7a5277","line":123,"range":{"start_line":123,"start_character":24,"end_line":123,"end_character":37},"updated":"2016-03-23 23:31:41.000000000","message":"Are we sure to have this set? Just wondering since we\u0027re checking above to see if id is set. I guess in the way this is used we would have already failed if flavorid wasn\u0027t set.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ce6f0400d2c0601444f576a6d18256a4a809a463","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                else:"},{"line_number":121,"context_line":"                    flavor \u003d self._flavor_get_by_flavor_id_from_db("},{"line_number":122,"context_line":"                        self._context,"},{"line_number":123,"context_line":"                        self.flavorid)"},{"line_number":124,"context_line":"                    # Fix us up so we can use our real id"},{"line_number":125,"context_line":"                    self.id \u003d flavor[\u0027id\u0027]"},{"line_number":126,"context_line":"                self._in_api \u003d True"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_3bd9ea57","line":123,"range":{"start_line":123,"start_character":24,"end_line":123,"end_character":37},"in_reply_to":"fa0719c6_2a7a5277","updated":"2016-03-24 13:39:54.000000000","message":"Yes, we always have to have this set. The reason it may not be set is because in a few places the api doesn\u0027t look up the flavor, it just constructs an object with flavorid from the client and then asks the object to do something like adjust projects.\n\nThis is relic api stuff leaking into the old database mechanism. I just wanted this to be able to be as efficient as possible if we have the whole object (and thus the id).","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c85a4f01b58d757f37cdadda3045778b14bb754","unresolved":false,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    @staticmethod"},{"line_number":301,"context_line":"    def _flavor_add_project(context, flavor_id, project_id):"},{"line_number":302,"context_line":"        return _flavor_add_project(context, flavor_id, project_id)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    @staticmethod"},{"line_number":305,"context_line":"    def _flavor_del_project(context, flavor_id, project_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_2a337263","line":302,"range":{"start_line":302,"start_character":15,"end_line":302,"end_character":34},"updated":"2016-03-23 23:31:41.000000000","message":"This is returning None right now.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fce1cee96338ed512c786907847a8623d9e49cc9","unresolved":false,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    @staticmethod"},{"line_number":301,"context_line":"    def _flavor_add_project(context, flavor_id, project_id):"},{"line_number":302,"context_line":"        return _flavor_add_project(context, flavor_id, project_id)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    @staticmethod"},{"line_number":305,"context_line":"    def _flavor_del_project(context, flavor_id, project_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"da0c15f0_68c1ab2e","line":302,"range":{"start_line":302,"start_character":15,"end_line":302,"end_character":34},"in_reply_to":"fa0719c6_1be7c640","updated":"2016-03-24 18:46:40.000000000","message":"Geh, yeah, me included. More so because the old sqla DB API method to add a project returns it, but this one doesn\u0027t.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a31aecd99b50e3cd1c40c6ea5dde73421a55b48e","unresolved":false,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    @staticmethod"},{"line_number":301,"context_line":"    def _flavor_add_project(context, flavor_id, project_id):"},{"line_number":302,"context_line":"        return _flavor_add_project(context, flavor_id, project_id)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    @staticmethod"},{"line_number":305,"context_line":"    def _flavor_del_project(context, flavor_id, project_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"da0c15f0_f35e5075","line":302,"range":{"start_line":302,"start_character":15,"end_line":302,"end_character":34},"in_reply_to":"fa0719c6_1be7c640","updated":"2016-03-24 19:53:39.000000000","message":"I think it makes sense to return for a proxy call because the called function may be changed in the future to return something and the proxy should continue to work","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ce6f0400d2c0601444f576a6d18256a4a809a463","unresolved":false,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    @staticmethod"},{"line_number":301,"context_line":"    def _flavor_add_project(context, flavor_id, project_id):"},{"line_number":302,"context_line":"        return _flavor_add_project(context, flavor_id, project_id)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    @staticmethod"},{"line_number":305,"context_line":"    def _flavor_del_project(context, flavor_id, project_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_1be7c640","line":302,"range":{"start_line":302,"start_character":15,"end_line":302,"end_character":34},"in_reply_to":"fa0719c6_2a337263","updated":"2016-03-24 13:39:54.000000000","message":"Yep, since these are just proxy methods I just (from habit) make them return so that if later the real thing started returning something this would continue to pass through. I know some people don\u0027t like that behavior, but those people are crazy :P","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c85a4f01b58d757f37cdadda3045778b14bb754","unresolved":false,"context_lines":[{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def _add_access(self, project_id):"},{"line_number":309,"context_line":"        if self.in_api:"},{"line_number":310,"context_line":"            self._flavor_add_project(self._context, self.id, project_id)"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            db.flavor_access_add(self._context, self.flavorid, project_id)"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_cacd9632","line":310,"range":{"start_line":310,"start_character":52,"end_line":310,"end_character":59},"updated":"2016-03-23 23:31:41.000000000","message":"Shouldn\u0027t this be self.flavorid?","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"39641ef337935637049066858e5efef04d620040","unresolved":false,"context_lines":[{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def _add_access(self, project_id):"},{"line_number":309,"context_line":"        if self.in_api:"},{"line_number":310,"context_line":"            self._flavor_add_project(self._context, self.id, project_id)"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            db.flavor_access_add(self._context, self.flavorid, project_id)"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da0c15f0_88935ffa","line":310,"range":{"start_line":310,"start_character":52,"end_line":310,"end_character":59},"in_reply_to":"da0c15f0_283cd32e","updated":"2016-03-24 18:51:15.000000000","message":"ooooook, this is what I was missing:\n\nhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api_models.py#L154\n\nSo flavor_projects.flavor_id \u003d\u003d flavor.id, now it makes sense.\n\nI\u0027m totally confused by the fact that flavor_id is a naming convention for flavor.id, which is not to be confused (but is) with flavor.flavorid.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fce1cee96338ed512c786907847a8623d9e49cc9","unresolved":false,"context_lines":[{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def _add_access(self, project_id):"},{"line_number":309,"context_line":"        if self.in_api:"},{"line_number":310,"context_line":"            self._flavor_add_project(self._context, self.id, project_id)"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            db.flavor_access_add(self._context, self.flavorid, project_id)"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da0c15f0_283cd32e","line":310,"range":{"start_line":310,"start_character":52,"end_line":310,"end_character":59},"in_reply_to":"fa0719c6_bb669aea","updated":"2016-03-24 18:46:40.000000000","message":"I\u0027d suggest renaming the arg in _flavor_add_project to be \u0027id\u0027 then rather than flavor_id because this is pretty confusing.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ce6f0400d2c0601444f576a6d18256a4a809a463","unresolved":false,"context_lines":[{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def _add_access(self, project_id):"},{"line_number":309,"context_line":"        if self.in_api:"},{"line_number":310,"context_line":"            self._flavor_add_project(self._context, self.id, project_id)"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            db.flavor_access_add(self._context, self.flavorid, project_id)"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_bb669aea","line":310,"range":{"start_line":310,"start_character":52,"end_line":310,"end_character":59},"in_reply_to":"fa0719c6_cacd9632","updated":"2016-03-24 13:39:54.000000000","message":"No. The current code has to look up the flavor to get the id, then use the id on the project row. Since we have the object now, we can skip that extra step and just provide it the thing we need.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c85a4f01b58d757f37cdadda3045778b14bb754","unresolved":false,"context_lines":[{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    def _remove_access(self, project_id):"},{"line_number":323,"context_line":"        if self.in_api:"},{"line_number":324,"context_line":"            self._flavor_del_project(self._context, self.id, project_id)"},{"line_number":325,"context_line":"        else:"},{"line_number":326,"context_line":"            db.flavor_access_remove(self._context, self.flavorid, project_id)"},{"line_number":327,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa0719c6_2acff229","line":324,"range":{"start_line":324,"start_character":52,"end_line":324,"end_character":59},"updated":"2016-03-23 23:31:41.000000000","message":"Shouldn\u0027t this be self.flavorid?","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fce1cee96338ed512c786907847a8623d9e49cc9","unresolved":false,"context_lines":[{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    def _remove_access(self, project_id):"},{"line_number":323,"context_line":"        if self.in_api:"},{"line_number":324,"context_line":"            self._flavor_del_project(self._context, self.id, project_id)"},{"line_number":325,"context_line":"        else:"},{"line_number":326,"context_line":"            db.flavor_access_remove(self._context, self.flavorid, project_id)"},{"line_number":327,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"da0c15f0_080c6f93","line":324,"range":{"start_line":324,"start_character":52,"end_line":324,"end_character":59},"in_reply_to":"fa0719c6_2acff229","updated":"2016-03-24 18:46:40.000000000","message":"Ditto, it would be more clear if we renamed the \u0027flavor_id\u0027 arg to _flavor_del_project to be \u0027id\u0027.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"00daf3841fa3cc2bf14be33d3b2376a9fe325df4","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                first()"},{"line_number":52,"context_line":"    if not db_flavor:"},{"line_number":53,"context_line":"        raise exception.FlavorNotFound(flavor_id\u003dflavorid)"},{"line_number":54,"context_line":"    return [x[\u0027project_id\u0027] for x in db_flavor[\u0027projects\u0027]]"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"@db_api.api_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":11,"id":"da0c15f0_855fc50d","line":54,"updated":"2016-03-24 19:59:53.000000000","message":"This is subtly different than the current process for getting project_ids. The current method queries projects directly and uses the sqlalchemy all() result which guarantees a list. This query could result in db_flavor[\u0027projects\u0027] being None and raising a TypeError here.","commit_id":"f092207b9cc2c97ebdc8b4712d35bde712a075aa"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"e5c1e6c5fdef171076508212f6ca41e11fdad631","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                first()"},{"line_number":52,"context_line":"    if not db_flavor:"},{"line_number":53,"context_line":"        raise exception.FlavorNotFound(flavor_id\u003dflavorid)"},{"line_number":54,"context_line":"    return [x[\u0027project_id\u0027] for x in db_flavor[\u0027projects\u0027]]"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"@db_api.api_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":11,"id":"da0c15f0_1b7cb671","line":54,"in_reply_to":"da0c15f0_855fc50d","updated":"2016-03-24 20:38:17.000000000","message":"Turns out I was wrong. db_flavor[\u0027projects\u0027] is a list.","commit_id":"f092207b9cc2c97ebdc8b4712d35bde712a075aa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a55c0dcc347b8f30967188ab700bbd4d590c6aac","unresolved":false,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    @staticmethod"},{"line_number":301,"context_line":"    def _flavor_add_project(context, flavor_id, project_id):"},{"line_number":302,"context_line":"        return _flavor_add_project(context, flavor_id, project_id)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    @staticmethod"},{"line_number":305,"context_line":"    def _flavor_del_project(context, flavor_id, project_id):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da0c15f0_7348805c","line":302,"range":{"start_line":302,"start_character":8,"end_line":302,"end_character":14},"updated":"2016-03-24 18:56:28.000000000","message":"This bothers me, wish we could remove this.","commit_id":"f092207b9cc2c97ebdc8b4712d35bde712a075aa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a55c0dcc347b8f30967188ab700bbd4d590c6aac","unresolved":false,"context_lines":[{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    @staticmethod"},{"line_number":305,"context_line":"    def _flavor_del_project(context, flavor_id, project_id):"},{"line_number":306,"context_line":"        return _flavor_del_project(context, flavor_id, project_id)"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def _add_access(self, project_id):"},{"line_number":309,"context_line":"        if self.in_api:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da0c15f0_b3785891","line":306,"range":{"start_line":306,"start_character":8,"end_line":306,"end_character":14},"updated":"2016-03-24 18:56:28.000000000","message":"ditto","commit_id":"f092207b9cc2c97ebdc8b4712d35bde712a075aa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a55c0dcc347b8f30967188ab700bbd4d590c6aac","unresolved":false,"context_lines":[{"line_number":307,"context_line":""},{"line_number":308,"context_line":"    def _add_access(self, project_id):"},{"line_number":309,"context_line":"        if self.in_api:"},{"line_number":310,"context_line":"            self._flavor_add_project(self._context, self.id, project_id)"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            db.flavor_access_add(self._context, self.flavorid, project_id)"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"da0c15f0_936274d7","line":310,"range":{"start_line":310,"start_character":52,"end_line":310,"end_character":59},"updated":"2016-03-24 18:56:28.000000000","message":"nit: it might be worth making a note that this is intentional since flavor_projects.flavor_id \u003d\u003d flavor.id. The flavor_id naming convention is not immediately obvious.","commit_id":"f092207b9cc2c97ebdc8b4712d35bde712a075aa"}],"nova/tests/unit/api/openstack/compute/test_flavor_access.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"00daf3841fa3cc2bf14be33d3b2376a9fe325df4","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        self.stub_out(\u0027nova.objects.flavor._flavor_get_all_from_db\u0027,"},{"line_number":153,"context_line":"                      lambda *a, **k: [])"},{"line_number":154,"context_line":"        self.stub_out(\u0027nova.objects.Flavor.in_api\u0027, False)"},{"line_number":155,"context_line":"        self.stub_out(\u0027nova.objects.flavor._get_projects_from_db\u0027,"},{"line_number":156,"context_line":"                      fake_get_flavor_projects_from_db)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        self.flavor_access_controller \u003d self.FlavorAccessController()"}],"source_content_type":"text/x-python","patch_set":11,"id":"da0c15f0_05461523","line":155,"updated":"2016-03-24 19:59:53.000000000","message":"This is what causes the staticmethod issues that are commented in the previous file. There\u0027s a fixtures bug open for it.","commit_id":"f092207b9cc2c97ebdc8b4712d35bde712a075aa"}],"nova/tests/unit/objects/test_flavor.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a31aecd99b50e3cd1c40c6ea5dde73421a55b48e","unresolved":false,"context_lines":[{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    @mock.patch(\u0027nova.db.flavor_access_add\u0027)"},{"line_number":166,"context_line":"    @mock.patch(\u0027nova.objects.Flavor._flavor_add_project\u0027)"},{"line_number":167,"context_line":"    @mock.patch(\u0027nova.objects.Flavor.in_api\u0027, new\u003dTrue)"},{"line_number":168,"context_line":"    def test_add_access_api(self, mock_api_add, mock_main_add):"},{"line_number":169,"context_line":"        elevated \u003d self.context.elevated()"},{"line_number":170,"context_line":"        flavor \u003d flavor_obj.Flavor(context\u003delevated, id\u003d12345, flavorid\u003d\u0027123\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"da0c15f0_a2f2bf98","line":167,"range":{"start_line":167,"start_character":46,"end_line":167,"end_character":54},"updated":"2016-03-24 19:53:39.000000000","message":"So this makes the object not get passed as an argument? Didn\u0027t know that","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"67c54eccfbd066f5afc9c6433218d36f6f383ac8","unresolved":false,"context_lines":[{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    @mock.patch(\u0027nova.db.flavor_access_add\u0027)"},{"line_number":166,"context_line":"    @mock.patch(\u0027nova.objects.Flavor._flavor_add_project\u0027)"},{"line_number":167,"context_line":"    @mock.patch(\u0027nova.objects.Flavor.in_api\u0027, new\u003dTrue)"},{"line_number":168,"context_line":"    def test_add_access_api(self, mock_api_add, mock_main_add):"},{"line_number":169,"context_line":"        elevated \u003d self.context.elevated()"},{"line_number":170,"context_line":"        flavor \u003d flavor_obj.Flavor(context\u003delevated, id\u003d12345, flavorid\u003d\u0027123\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"da0c15f0_052575aa","line":167,"range":{"start_line":167,"start_character":46,"end_line":167,"end_character":54},"in_reply_to":"da0c15f0_a2f2bf98","updated":"2016-03-24 19:55:36.000000000","message":"Yeah, I was surprised. Doesn\u0027t work for return_value or side_effect, but new\u003d does. I think it\u0027s because it doesn\u0027t replace it with a mock, it just replaces it.","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a31aecd99b50e3cd1c40c6ea5dde73421a55b48e","unresolved":false,"context_lines":[{"line_number":374,"context_line":"    # NOTE(danms): Run this test local-only because we would otherwise"},{"line_number":375,"context_line":"    # have to do a bunch of change-resetting to handle the way we do"},{"line_number":376,"context_line":"    # our change tracking for special attributes like projects. There is"},{"line_number":377,"context_line":"    # nothing remotely-concerning (see what I did there?) so this is fine."},{"line_number":378,"context_line":"    def test_projects_in_db(self):"},{"line_number":379,"context_line":"        db_flavor \u003d self._create_api_flavor(self.context)"},{"line_number":380,"context_line":"        flavor \u003d objects.Flavor.get_by_id(self.context, db_flavor[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":10,"id":"da0c15f0_02bbab73","line":377,"updated":"2016-03-24 19:53:39.000000000","message":":P","commit_id":"18d5aad5ebcbbd41a0c06e5085b30f9ad14b765f"}]}
