)]}'
{"nova/api/openstack/placement/handlers/allocation.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0db04067a50f23c750e0476878ab4b44b0238705","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            # project and user are consistent across the list"},{"line_number":67,"context_line":"            project_id \u003d None"},{"line_number":68,"context_line":"            user_id \u003d None"},{"line_number":69,"context_line":"            if allocations[0].consumer is not None:"},{"line_number":70,"context_line":"                project_id \u003d allocations[0].consumer.project.external_id"},{"line_number":71,"context_line":"                user_id \u003d allocations[0].consumer.user.external_id"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_604c3676","line":69,"range":{"start_line":69,"start_character":12,"end_line":69,"end_character":51},"updated":"2018-05-01 15:46:32.000000000","message":"Even though we\u0027re \u003e\u003d1.12 here, it\u0027s possible the consumer is None because we could be fetching a record that was created \u003c1.8?","commit_id":"581edba37f3c844cfa4d91b46c0e352df5a1eedd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9a019105cc72ab54b946eb8150043f0e371b0d10","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            # project and user are consistent across the list"},{"line_number":67,"context_line":"            project_id \u003d None"},{"line_number":68,"context_line":"            user_id \u003d None"},{"line_number":69,"context_line":"            if allocations[0].consumer is not None:"},{"line_number":70,"context_line":"                project_id \u003d allocations[0].consumer.project.external_id"},{"line_number":71,"context_line":"                user_id \u003d allocations[0].consumer.user.external_id"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_60b756da","line":69,"range":{"start_line":69,"start_character":12,"end_line":69,"end_character":51},"in_reply_to":"9f6a8fd7_604c3676","updated":"2018-05-01 15:49:22.000000000","message":"Correct.","commit_id":"581edba37f3c844cfa4d91b46c0e352df5a1eedd"}],"nova/api/openstack/placement/objects/resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0db04067a50f23c750e0476878ab4b44b0238705","unresolved":false,"context_lines":[{"line_number":1746,"context_line":"        \u0027user_id\u0027: fields.StringField(nullable\u003dTrue),"},{"line_number":1747,"context_line":"    }"},{"line_number":1748,"context_line":""},{"line_number":1749,"context_line":"    def ensure_consumer_project_user(self, ctx):"},{"line_number":1750,"context_line":"        \"\"\"Examines the project_id, user_id of the object along with the"},{"line_number":1751,"context_line":"        supplied consumer_id and ensures that if project_id and user_id"},{"line_number":1752,"context_line":"        are set that there are records in the consumers, projects, and"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_a049ee60","side":"PARENT","line":1749,"range":{"start_line":1749,"start_character":8,"end_line":1749,"end_character":36},"updated":"2018-05-01 15:46:32.000000000","message":"Whack this in the previous patch.","commit_id":"4f2b060b5c23ad2daa138b405730516299bd96c5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f12c8330e1fb784fc6495d10d7fd6268995576bf","unresolved":false,"context_lines":[{"line_number":1746,"context_line":"        \u0027user_id\u0027: fields.StringField(nullable\u003dTrue),"},{"line_number":1747,"context_line":"    }"},{"line_number":1748,"context_line":""},{"line_number":1749,"context_line":"    def ensure_consumer_project_user(self, ctx):"},{"line_number":1750,"context_line":"        \"\"\"Examines the project_id, user_id of the object along with the"},{"line_number":1751,"context_line":"        supplied consumer_id and ensures that if project_id and user_id"},{"line_number":1752,"context_line":"        are set that there are records in the consumers, projects, and"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_2b213fa0","side":"PARENT","line":1749,"range":{"start_line":1749,"start_character":8,"end_line":1749,"end_character":36},"in_reply_to":"9f6a8fd7_a049ee60","updated":"2018-05-01 16:02:17.000000000","message":"Done","commit_id":"4f2b060b5c23ad2daa138b405730516299bd96c5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0db04067a50f23c750e0476878ab4b44b0238705","unresolved":false,"context_lines":[{"line_number":1956,"context_line":"    return res_providers"},{"line_number":1957,"context_line":""},{"line_number":1958,"context_line":""},{"line_number":1959,"context_line":"def _ensure_lookup_table_entry(ctx, tbl, external_id):"},{"line_number":1960,"context_line":"    \"\"\"Ensures the supplied external ID exists in the specified lookup table"},{"line_number":1961,"context_line":"    and if not, adds it. Returns the internal ID."},{"line_number":1962,"context_line":""},{"line_number":1963,"context_line":"    :param ctx: `nova.context.RequestContext` object that has the oslo.db"},{"line_number":1964,"context_line":"                Session object in it"},{"line_number":1965,"context_line":"    :param tbl: The lookup table"},{"line_number":1966,"context_line":"    :param external_id: The external project or user identifier"},{"line_number":1967,"context_line":"    :type external_id: string"},{"line_number":1968,"context_line":"    \"\"\""},{"line_number":1969,"context_line":"    # Grab the project internal ID if it exists in the projects table"},{"line_number":1970,"context_line":"    sel \u003d sa.select([tbl.c.id]).where("},{"line_number":1971,"context_line":"        tbl.c.external_id \u003d\u003d external_id"},{"line_number":1972,"context_line":"    )"},{"line_number":1973,"context_line":"    res \u003d ctx.session.execute(sel).fetchall()"},{"line_number":1974,"context_line":"    if not res:"},{"line_number":1975,"context_line":"        try:"},{"line_number":1976,"context_line":"            ins_stmt \u003d tbl.insert().values(external_id\u003dexternal_id)"},{"line_number":1977,"context_line":"            res \u003d ctx.session.execute(ins_stmt)"},{"line_number":1978,"context_line":"            return res.inserted_primary_key[0]"},{"line_number":1979,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":1980,"context_line":"            # Another thread added it just before us, so just read the"},{"line_number":1981,"context_line":"            # internal ID that that thread created..."},{"line_number":1982,"context_line":"            res \u003d ctx.session.execute(sel).fetchall()"},{"line_number":1983,"context_line":""},{"line_number":1984,"context_line":"    return res[0][0]"},{"line_number":1985,"context_line":""},{"line_number":1986,"context_line":""},{"line_number":1987,"context_line":"def _ensure_project(ctx, external_id):"},{"line_number":1988,"context_line":"    \"\"\"Ensures the supplied external project ID exists in the projects lookup"},{"line_number":1989,"context_line":"    table and if not, adds it. Returns the internal project ID."},{"line_number":1990,"context_line":""},{"line_number":1991,"context_line":"    :param ctx: `nova.context.RequestContext` object that has the oslo.db"},{"line_number":1992,"context_line":"                Session object in it"},{"line_number":1993,"context_line":"    :param external_id: The external project identifier"},{"line_number":1994,"context_line":"    :type external_id: string"},{"line_number":1995,"context_line":"    \"\"\""},{"line_number":1996,"context_line":"    return _ensure_lookup_table_entry(ctx, _PROJECT_TBL, external_id)"},{"line_number":1997,"context_line":""},{"line_number":1998,"context_line":""},{"line_number":1999,"context_line":"def _ensure_user(ctx, external_id):"},{"line_number":2000,"context_line":"    \"\"\"Ensures the supplied external user ID exists in the users lookup table"},{"line_number":2001,"context_line":"    and if not, adds it. Returns the internal user ID."},{"line_number":2002,"context_line":""},{"line_number":2003,"context_line":"    :param ctx: `nova.context.RequestContext` object that has the oslo.db"},{"line_number":2004,"context_line":"                Session object in it"},{"line_number":2005,"context_line":"    :param external_id: The external user identifier"},{"line_number":2006,"context_line":"    :type external_id: string"},{"line_number":2007,"context_line":"    \"\"\""},{"line_number":2008,"context_line":"    return _ensure_lookup_table_entry(ctx, _USER_TBL, external_id)"},{"line_number":2009,"context_line":""},{"line_number":2010,"context_line":""},{"line_number":2011,"context_line":"@db_api.api_context_manager.reader"},{"line_number":2012,"context_line":"def _get_allocations_by_provider_id(ctx, rp_id):"},{"line_number":2013,"context_line":"    allocs \u003d sa.alias(_ALLOC_TBL, name\u003d\"a\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f6a8fd7_c044224a","side":"PARENT","line":2010,"range":{"start_line":1959,"start_character":0,"end_line":2010,"end_character":0},"updated":"2018-05-01 15:46:32.000000000","message":"ditto","commit_id":"4f2b060b5c23ad2daa138b405730516299bd96c5"}]}
