)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"bebfafec9c0b202a1316face95f50700430cd2e3","unresolved":false,"context_lines":[{"line_number":3384,"context_line":"    # updated_at is needed for judgement of max_age"},{"line_number":3385,"context_line":"    quota_usage_ref.updated_at \u003d timeutils.utcnow()"},{"line_number":3386,"context_line":""},{"line_number":3387,"context_line":"    quota_usage_ref.save(session\u003dsession)"},{"line_number":3388,"context_line":""},{"line_number":3389,"context_line":"    return quota_usage_ref"},{"line_number":3390,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba63e191_c121fd4e","line":3387,"updated":"2016-01-19 20:13:55.000000000","message":"This is a nitpick, but _quota_usage_create now falls within a context manager but isn\u0027t using save(context.session) like every other place.  I traced back and it\u0027s because the session being passed in is now context.session, but it would be cleaner to pass context in here and stay consistent with the convention being used elsewhere.","commit_id":"9d78ef2cb58cc069e6ba517cdbc3c826d11ca3bb"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"9e61cdde6884bb9120d185cac7f7934f1b694fa4","unresolved":false,"context_lines":[{"line_number":3384,"context_line":"    # updated_at is needed for judgement of max_age"},{"line_number":3385,"context_line":"    quota_usage_ref.updated_at \u003d timeutils.utcnow()"},{"line_number":3386,"context_line":""},{"line_number":3387,"context_line":"    quota_usage_ref.save(session\u003dsession)"},{"line_number":3388,"context_line":""},{"line_number":3389,"context_line":"    return quota_usage_ref"},{"line_number":3390,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_a2544654","line":3387,"in_reply_to":"9a68dd71_1c0341ba","updated":"2016-01-20 16:50:20.000000000","message":"Okay, it\u0027s a bit more invasive than it looks like at first.  A followup to clean it up would be nice.","commit_id":"9d78ef2cb58cc069e6ba517cdbc3c826d11ca3bb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"79a4248b761c5656bf20ba04208b9e7aff1dc8b1","unresolved":false,"context_lines":[{"line_number":3384,"context_line":"    # updated_at is needed for judgement of max_age"},{"line_number":3385,"context_line":"    quota_usage_ref.updated_at \u003d timeutils.utcnow()"},{"line_number":3386,"context_line":""},{"line_number":3387,"context_line":"    quota_usage_ref.save(session\u003dsession)"},{"line_number":3388,"context_line":""},{"line_number":3389,"context_line":"    return quota_usage_ref"},{"line_number":3390,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_bdf98a82","line":3387,"in_reply_to":"9a68dd71_a2544654","updated":"2016-01-21 15:40:27.000000000","message":"+1 for a follow up patch, good compromise.","commit_id":"9d78ef2cb58cc069e6ba517cdbc3c826d11ca3bb"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"9077ff0abef444fdafb8d5a9d9ce9c1c94fe9b9d","unresolved":false,"context_lines":[{"line_number":3384,"context_line":"    # updated_at is needed for judgement of max_age"},{"line_number":3385,"context_line":"    quota_usage_ref.updated_at \u003d timeutils.utcnow()"},{"line_number":3386,"context_line":""},{"line_number":3387,"context_line":"    quota_usage_ref.save(session\u003dsession)"},{"line_number":3388,"context_line":""},{"line_number":3389,"context_line":"    return quota_usage_ref"},{"line_number":3390,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_1c0341ba","line":3387,"in_reply_to":"ba63e191_c121fd4e","updated":"2016-01-20 13:58:14.000000000","message":"Andrew, we agree that we try to write \u0027context.session\u0027 everywhere. But in this particular case it will cause several problems:\n\n1) here https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L3465-L3467 we have to pass \u0027context\u0027 to another private function\n\n2) here https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L4271-L4276 we can also see the code like \u0027context.project_id\u0027 and \u0027context.user_id\u0027, also the part of code conflicts with \u0027security_group\u0027 patch, where \u0027session\u003dsession\u0027 will be changed to \u0027session\u003dcontext.session\u0027 (https://review.openstack.org/#/c/246302/7/nova/db/sqlalchemy/api.py).\n\n3) it looks like unrelated change according to switching to enginefacade and make the code not beautiful  \n\nSo, we think it will be better now to leave as it is.\n\nThese changes can be made in separate patch in the future.","commit_id":"9d78ef2cb58cc069e6ba517cdbc3c826d11ca3bb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"79a4248b761c5656bf20ba04208b9e7aff1dc8b1","unresolved":false,"context_lines":[{"line_number":3421,"context_line":"    reservation_ref.resource \u003d resource"},{"line_number":3422,"context_line":"    reservation_ref.delta \u003d delta"},{"line_number":3423,"context_line":"    reservation_ref.expire \u003d expire"},{"line_number":3424,"context_line":"    reservation_ref.save(session\u003dsession)"},{"line_number":3425,"context_line":"    return reservation_ref"},{"line_number":3426,"context_line":""},{"line_number":3427,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_fd35c245","line":3424,"updated":"2016-01-21 15:40:27.000000000","message":"as above.","commit_id":"9d78ef2cb58cc069e6ba517cdbc3c826d11ca3bb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"79a4248b761c5656bf20ba04208b9e7aff1dc8b1","unresolved":false,"context_lines":[{"line_number":3455,"context_line":""},{"line_number":3456,"context_line":""},{"line_number":3457,"context_line":"def _create_quota_usage_if_missing(user_usages, resource, until_refresh,"},{"line_number":3458,"context_line":"                                   project_id, user_id, session):"},{"line_number":3459,"context_line":"    \"\"\"Creates a QuotaUsage record and adds to user_usages if not present."},{"line_number":3460,"context_line":""},{"line_number":3461,"context_line":"    :param user_usages:   dict of resource keys to QuotaUsage records. This is"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_1d10d6a7","line":3458,"updated":"2016-01-21 15:40:27.000000000","message":"as above.","commit_id":"9d78ef2cb58cc069e6ba517cdbc3c826d11ca3bb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"79a4248b761c5656bf20ba04208b9e7aff1dc8b1","unresolved":false,"context_lines":[{"line_number":4257,"context_line":"                                    \u0027security_groups\u0027,"},{"line_number":4258,"context_line":"                                    1, 0,"},{"line_number":4259,"context_line":"                                    CONF.until_refresh,"},{"line_number":4260,"context_line":"                                    session)"},{"line_number":4261,"context_line":"            else:"},{"line_number":4262,"context_line":"                usage.update({\u0027in_use\u0027: int(usage.first().in_use) + 1})"},{"line_number":4263,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_1dd536b8","line":4260,"updated":"2016-01-21 15:40:27.000000000","message":"as above.","commit_id":"9d78ef2cb58cc069e6ba517cdbc3c826d11ca3bb"}]}
