)]}'
{"karbor/api/v1/plans.py":[{"author":{"_account_id":22056,"name":"yushangbin","email":"shangbin.yu@easystack.cn","username":"yushangbin"},"change_message_id":"66c0b449f0055d44b87a46f36f7d17a709e9affe","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        except Exception:"},{"line_number":166,"context_line":"            reservations \u003d None"},{"line_number":167,"context_line":"            LOG.exception(\"Failed to update usages deleting plan.\")"},{"line_number":168,"context_line":"        plan.destroy()"},{"line_number":169,"context_line":"        if reservations:"},{"line_number":170,"context_line":"            QUOTAS.commit(context, reservations,"},{"line_number":171,"context_line":"                          project_id\u003dproject_id)"},{"line_number":172,"context_line":"        LOG.info(\"Delete plan request issued successfully.\","},{"line_number":173,"context_line":"                 resource\u003d{\u0027id\u0027: plan.id})"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_cdddfddd","line":171,"range":{"start_line":168,"start_character":8,"end_line":171,"end_character":48},"updated":"2017-11-03 07:35:15.000000000","message":"Maybe it\u0027s better to add a try catch and use QUOTAS.rollback to deal with exception.","commit_id":"94847956089059dc6da3e61da8c1d0d41bdeded0"},{"author":{"_account_id":22056,"name":"yushangbin","email":"shangbin.yu@easystack.cn","username":"yushangbin"},"change_message_id":"e2dc08c82a5e7148e3870b93ad04cc0e6a46463a","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        except Exception:"},{"line_number":166,"context_line":"            reservations \u003d None"},{"line_number":167,"context_line":"            LOG.exception(\"Failed to update usages deleting plan.\")"},{"line_number":168,"context_line":"        plan.destroy()"},{"line_number":169,"context_line":"        if reservations:"},{"line_number":170,"context_line":"            QUOTAS.commit(context, reservations,"},{"line_number":171,"context_line":"                          project_id\u003dproject_id)"},{"line_number":172,"context_line":"        LOG.info(\"Delete plan request issued successfully.\","},{"line_number":173,"context_line":"                 resource\u003d{\u0027id\u0027: plan.id})"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_f2406da7","line":171,"range":{"start_line":168,"start_character":8,"end_line":171,"end_character":48},"in_reply_to":"3f4b6375_32b4c5f1","updated":"2017-11-06 06:43:46.000000000","message":"OK, it looks good, thanks.","commit_id":"94847956089059dc6da3e61da8c1d0d41bdeded0"},{"author":{"_account_id":22056,"name":"yushangbin","email":"shangbin.yu@easystack.cn","username":"yushangbin"},"change_message_id":"d93932c68139deab701fb0140ee5db2c3af9cab0","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        except Exception:"},{"line_number":166,"context_line":"            reservations \u003d None"},{"line_number":167,"context_line":"            LOG.exception(\"Failed to update usages deleting plan.\")"},{"line_number":168,"context_line":"        plan.destroy()"},{"line_number":169,"context_line":"        if reservations:"},{"line_number":170,"context_line":"            QUOTAS.commit(context, reservations,"},{"line_number":171,"context_line":"                          project_id\u003dproject_id)"},{"line_number":172,"context_line":"        LOG.info(\"Delete plan request issued successfully.\","},{"line_number":173,"context_line":"                 resource\u003d{\u0027id\u0027: plan.id})"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_3c2dbe94","line":171,"range":{"start_line":168,"start_character":8,"end_line":171,"end_character":48},"in_reply_to":"3f4b6375_397ef0e3","updated":"2017-11-06 03:39:14.000000000","message":"Hmm, I just think if a plan destroys unsuccessfully, the quota should not be reduced.","commit_id":"94847956089059dc6da3e61da8c1d0d41bdeded0"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"fea35e15984fcfde3bd5edb6a3722262efc24a45","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        except Exception:"},{"line_number":166,"context_line":"            reservations \u003d None"},{"line_number":167,"context_line":"            LOG.exception(\"Failed to update usages deleting plan.\")"},{"line_number":168,"context_line":"        plan.destroy()"},{"line_number":169,"context_line":"        if reservations:"},{"line_number":170,"context_line":"            QUOTAS.commit(context, reservations,"},{"line_number":171,"context_line":"                          project_id\u003dproject_id)"},{"line_number":172,"context_line":"        LOG.info(\"Delete plan request issued successfully.\","},{"line_number":173,"context_line":"                 resource\u003d{\u0027id\u0027: plan.id})"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_32b4c5f1","line":171,"range":{"start_line":168,"start_character":8,"end_line":171,"end_character":48},"in_reply_to":"3f4b6375_3c2dbe94","updated":"2017-11-06 06:33:54.000000000","message":"I know that destroy a plan may fail. But I see the destroy about resouce in cinder and manila projects. They don,t consider the exception about the resouce destroy. So I am thinking about move the plan.destroy() before the QUOTAS.reserve[1].\n[1] https://github.com/openstack/manila/blob/master/manila/api/v2/share_networks.py#L94","commit_id":"94847956089059dc6da3e61da8c1d0d41bdeded0"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"74802e71a6856ceca89c1792d7968bcd11ccf2e2","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        except Exception:"},{"line_number":166,"context_line":"            reservations \u003d None"},{"line_number":167,"context_line":"            LOG.exception(\"Failed to update usages deleting plan.\")"},{"line_number":168,"context_line":"        plan.destroy()"},{"line_number":169,"context_line":"        if reservations:"},{"line_number":170,"context_line":"            QUOTAS.commit(context, reservations,"},{"line_number":171,"context_line":"                          project_id\u003dproject_id)"},{"line_number":172,"context_line":"        LOG.info(\"Delete plan request issued successfully.\","},{"line_number":173,"context_line":"                 resource\u003d{\u0027id\u0027: plan.id})"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_e2ae832c","line":171,"range":{"start_line":168,"start_character":8,"end_line":171,"end_character":48},"in_reply_to":"3f4b6375_cdddfddd","updated":"2017-11-03 08:35:09.000000000","message":"Thanks, I will fix it in another patch.","commit_id":"94847956089059dc6da3e61da8c1d0d41bdeded0"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"810c404123e66a4e1dda9eedc879250e1b92348c","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        except Exception:"},{"line_number":166,"context_line":"            reservations \u003d None"},{"line_number":167,"context_line":"            LOG.exception(\"Failed to update usages deleting plan.\")"},{"line_number":168,"context_line":"        plan.destroy()"},{"line_number":169,"context_line":"        if reservations:"},{"line_number":170,"context_line":"            QUOTAS.commit(context, reservations,"},{"line_number":171,"context_line":"                          project_id\u003dproject_id)"},{"line_number":172,"context_line":"        LOG.info(\"Delete plan request issued successfully.\","},{"line_number":173,"context_line":"                 resource\u003d{\u0027id\u0027: plan.id})"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_397ef0e3","line":171,"range":{"start_line":168,"start_character":8,"end_line":171,"end_character":48},"in_reply_to":"3f4b6375_e2ae832c","updated":"2017-11-06 03:21:46.000000000","message":"hi Spencer Yu, I think carefully about the use of QUOTAS.rollback. It is only used for the resource allocation. So QUOTAS.rollback will not be introduced here.","commit_id":"94847956089059dc6da3e61da8c1d0d41bdeded0"}],"karbor/api/v1/quota_classes.py":[{"author":{"_account_id":21224,"name":"jiaopengju","email":"jiaopengju_yewu@cmss.chinamobile.com","username":"jiaopengju"},"change_message_id":"fd42dafe9abe601b997151c3dc43fe31eff27324","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                            \"integer.\") % {\u0027value\u0027: value, \u0027key\u0027: key}"},{"line_number":94,"context_line":"                    LOG.warning(msg)"},{"line_number":95,"context_line":"                    raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":96,"context_line":"        context.can(quota_class_policy.UPDATE_POLICY)"},{"line_number":97,"context_line":"        for key in body[\u0027quota_class\u0027].keys():"},{"line_number":98,"context_line":"            if key in QUOTAS:"},{"line_number":99,"context_line":"                value \u003d int(body[\u0027quota_class\u0027][key])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_c74ddc3b","line":96,"range":{"start_line":96,"start_character":8,"end_line":96,"end_character":53},"updated":"2017-11-03 03:27:16.000000000","message":"move this to the position before key-value validation may be better","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"f1a9167f9afd4a2facdf99be49fd573825dc367c","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                            \"integer.\") % {\u0027value\u0027: value, \u0027key\u0027: key}"},{"line_number":94,"context_line":"                    LOG.warning(msg)"},{"line_number":95,"context_line":"                    raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":96,"context_line":"        context.can(quota_class_policy.UPDATE_POLICY)"},{"line_number":97,"context_line":"        for key in body[\u0027quota_class\u0027].keys():"},{"line_number":98,"context_line":"            if key in QUOTAS:"},{"line_number":99,"context_line":"                value \u003d int(body[\u0027quota_class\u0027][key])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_e71d78be","line":96,"range":{"start_line":96,"start_character":8,"end_line":96,"end_character":53},"in_reply_to":"3f4b6375_c74ddc3b","updated":"2017-11-03 03:51:16.000000000","message":"Done","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"}],"karbor/api/v1/quotas.py":[{"author":{"_account_id":21224,"name":"jiaopengju","email":"jiaopengju_yewu@cmss.chinamobile.com","username":"jiaopengju"},"change_message_id":"fd42dafe9abe601b997151c3dc43fe31eff27324","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return self._view_builder.detail_list(req, quota, id)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def detail(self, req, id):"},{"line_number":82,"context_line":"        \"\"\"Return data about the given restore.\"\"\""},{"line_number":83,"context_line":"        context \u003d req.environ[\u0027karbor.context\u0027]"},{"line_number":84,"context_line":"        LOG.info(\"Show quotas detail with id: %s\", id, context\u003dcontext)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_07953487","line":82,"range":{"start_line":82,"start_character":39,"end_line":82,"end_character":46},"updated":"2017-11-03 03:27:16.000000000","message":"quota?","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"f1a9167f9afd4a2facdf99be49fd573825dc367c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        return self._view_builder.detail_list(req, quota, id)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def detail(self, req, id):"},{"line_number":82,"context_line":"        \"\"\"Return data about the given restore.\"\"\""},{"line_number":83,"context_line":"        context \u003d req.environ[\u0027karbor.context\u0027]"},{"line_number":84,"context_line":"        LOG.info(\"Show quotas detail with id: %s\", id, context\u003dcontext)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_076ad418","line":82,"range":{"start_line":82,"start_character":39,"end_line":82,"end_character":46},"in_reply_to":"3f4b6375_07953487","updated":"2017-11-03 03:51:16.000000000","message":"Done","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"},{"author":{"_account_id":21224,"name":"jiaopengju","email":"jiaopengju_yewu@cmss.chinamobile.com","username":"jiaopengju"},"change_message_id":"fd42dafe9abe601b997151c3dc43fe31eff27324","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                    LOG.warning(msg)"},{"line_number":140,"context_line":"                    raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        context.can(quota_policy.UPDATE_POLICY)"},{"line_number":143,"context_line":"        for key in body[\u0027quota\u0027].keys():"},{"line_number":144,"context_line":"            if key in QUOTAS:"},{"line_number":145,"context_line":"                value \u003d int(body[\u0027quota\u0027][key])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_27f950c7","line":142,"range":{"start_line":142,"start_character":8,"end_line":142,"end_character":47},"updated":"2017-11-03 03:27:16.000000000","message":"move this to the position before key-value validation may be better","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"f1a9167f9afd4a2facdf99be49fd573825dc367c","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                    LOG.warning(msg)"},{"line_number":140,"context_line":"                    raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        context.can(quota_policy.UPDATE_POLICY)"},{"line_number":143,"context_line":"        for key in body[\u0027quota\u0027].keys():"},{"line_number":144,"context_line":"            if key in QUOTAS:"},{"line_number":145,"context_line":"                value \u003d int(body[\u0027quota\u0027][key])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_2756f05d","line":142,"range":{"start_line":142,"start_character":8,"end_line":142,"end_character":47},"in_reply_to":"3f4b6375_27f950c7","updated":"2017-11-03 03:51:16.000000000","message":"Done","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"},{"author":{"_account_id":21224,"name":"jiaopengju","email":"jiaopengju_yewu@cmss.chinamobile.com","username":"jiaopengju"},"change_message_id":"fd42dafe9abe601b997151c3dc43fe31eff27324","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        if not uuidutils.is_uuid_like(id):"},{"line_number":179,"context_line":"            msg \u003d _(\"Invalid project id provided.\")"},{"line_number":180,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":181,"context_line":"        context.can(quota_policy.UPDATE_POLICY)"},{"line_number":182,"context_line":"        try:"},{"line_number":183,"context_line":"            db.authorize_project_context(context, id)"},{"line_number":184,"context_line":"            QUOTAS.destroy_all_by_project(context, id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_4729ec34","line":181,"range":{"start_line":181,"start_character":33,"end_line":181,"end_character":46},"updated":"2017-11-03 03:27:16.000000000","message":"DELETE_POLICY？","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"f1a9167f9afd4a2facdf99be49fd573825dc367c","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        if not uuidutils.is_uuid_like(id):"},{"line_number":179,"context_line":"            msg \u003d _(\"Invalid project id provided.\")"},{"line_number":180,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":181,"context_line":"        context.can(quota_policy.UPDATE_POLICY)"},{"line_number":182,"context_line":"        try:"},{"line_number":183,"context_line":"            db.authorize_project_context(context, id)"},{"line_number":184,"context_line":"            QUOTAS.destroy_all_by_project(context, id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_07d894ec","line":181,"range":{"start_line":181,"start_character":33,"end_line":181,"end_character":46},"in_reply_to":"3f4b6375_4729ec34","updated":"2017-11-03 03:51:16.000000000","message":"Done","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"}],"karbor/quota.py":[{"author":{"_account_id":21224,"name":"jiaopengju","email":"jiaopengju_yewu@cmss.chinamobile.com","username":"jiaopengju"},"change_message_id":"fd42dafe9abe601b997151c3dc43fe31eff27324","unresolved":false,"context_lines":[{"line_number":789,"context_line":"    :param size: requested size in reservation"},{"line_number":790,"context_line":"    \"\"\""},{"line_number":791,"context_line":"    def _consumed(name):"},{"line_number":792,"context_line":"        return (usages[name][\u0027reserved\u0027] + usages[name][\u0027in_use\u0027])"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"    overs \u003d over_quota_exception.kwargs[\u0027overs\u0027]"},{"line_number":795,"context_line":"    usages \u003d over_quota_exception.kwargs[\u0027usages\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_277ef018","line":792,"range":{"start_line":792,"start_character":15,"end_line":792,"end_character":16},"updated":"2017-11-03 03:27:16.000000000","message":"the () can be removed","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"f1a9167f9afd4a2facdf99be49fd573825dc367c","unresolved":false,"context_lines":[{"line_number":789,"context_line":"    :param size: requested size in reservation"},{"line_number":790,"context_line":"    \"\"\""},{"line_number":791,"context_line":"    def _consumed(name):"},{"line_number":792,"context_line":"        return (usages[name][\u0027reserved\u0027] + usages[name][\u0027in_use\u0027])"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"    overs \u003d over_quota_exception.kwargs[\u0027overs\u0027]"},{"line_number":795,"context_line":"    usages \u003d over_quota_exception.kwargs[\u0027usages\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_c7dddcdd","line":792,"range":{"start_line":792,"start_character":15,"end_line":792,"end_character":16},"in_reply_to":"3f4b6375_277ef018","updated":"2017-11-03 03:51:16.000000000","message":"Done","commit_id":"99b92bf3f33e16b0cc10cbf2417433ad6e160089"},{"author":{"_account_id":22056,"name":"yushangbin","email":"shangbin.yu@easystack.cn","username":"yushangbin"},"change_message_id":"66c0b449f0055d44b87a46f36f7d17a709e9affe","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    database."},{"line_number":61,"context_line":"    \"\"\""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def get_by_project(self, context, project_id, resource):"},{"line_number":64,"context_line":"        \"\"\"Get a specific quota by project.\"\"\""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        return db.quota_get(context, project_id, resource)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_9fecc8bb","line":63,"range":{"start_line":63,"start_character":8,"end_line":63,"end_character":22},"updated":"2017-11-03 07:35:15.000000000","message":"Hi, Here I have a question: in nova, quota usage may extend from a project to a user, here we just consider quota for a project?","commit_id":"94847956089059dc6da3e61da8c1d0d41bdeded0"},{"author":{"_account_id":17151,"name":"chenying","email":"chenyingko@gmail.com","username":"chenying"},"change_message_id":"74802e71a6856ceca89c1792d7968bcd11ccf2e2","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    database."},{"line_number":61,"context_line":"    \"\"\""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def get_by_project(self, context, project_id, resource):"},{"line_number":64,"context_line":"        \"\"\"Get a specific quota by project.\"\"\""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        return db.quota_get(context, project_id, resource)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_62c3b3ee","line":63,"range":{"start_line":63,"start_character":8,"end_line":63,"end_character":22},"in_reply_to":"3f4b6375_9fecc8bb","updated":"2017-11-03 08:35:09.000000000","message":"Keystone will introduce a common quota modules for other projects. There is a idea that the quota based on user_id will be deprecated. [1]\n\nAnd most important of all, we don\u0027t see a really usecase about the user quota in public cloud, \n\nhttps://specs.openstack.org/openstack/keystone-specs/specs/keystone/ongoing/unified-limits.html","commit_id":"94847956089059dc6da3e61da8c1d0d41bdeded0"}]}
