)]}'
{"heat/engine/resources/openstack/cinder/quota.py":[{"author":{"_account_id":13009,"name":"Peter Razumovsky","email":"prazumovsky@mirantis.com","username":"prazumovsky"},"change_message_id":"8dca63e9e3fce08de35a0224c807dd377ffe7e11","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                                                self.context))"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    @classmethod"},{"line_number":107,"context_line":"    def _validate_quota(cls, quota_property, quota_size, total_size):"},{"line_number":108,"context_line":"        err_message \u003d _(\"Invalid quota %(property)s value(s): %(value)s. \""},{"line_number":109,"context_line":"                        \"Can not be less than the current usage value(s): \""},{"line_number":110,"context_line":"                        \"%(total)s.\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a89bdaa_4d77573a","line":107,"updated":"2016-09-05 11:15:31.000000000","message":"Also, why we should really set such limit? What will happens if quota will be less than current count of something? If it just prohibit to create new volumes/snapshots, why not allows to set quota \u003c current count of vols/snapshots?","commit_id":"1aa93c2eea3efe108b53ca438f5f63fd28b61f44"},{"author":{"_account_id":12404,"name":"Rico Lin","email":"ricolin@ricolky.com","username":"rico.lin"},"change_message_id":"326733d4bb807864a7e9b93d5a737176c54d51f2","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                                                self.context))"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    @classmethod"},{"line_number":107,"context_line":"    def _validate_quota(cls, quota_property, quota_size, total_size):"},{"line_number":108,"context_line":"        err_message \u003d _(\"Invalid quota %(property)s value(s): %(value)s. \""},{"line_number":109,"context_line":"                        \"Can not be less than the current usage value(s): \""},{"line_number":110,"context_line":"                        \"%(total)s.\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a89bdaa_c7998070","line":107,"in_reply_to":"9a89bdaa_4d77573a","updated":"2016-09-05 13:58:32.000000000","message":"The point of quota is to manage resources of project, if we have a quota with volumes \u003d\u003d1 and in reality we have 100+ volumes, then what will be the point we allow it exists?","commit_id":"1aa93c2eea3efe108b53ca438f5f63fd28b61f44"},{"author":{"_account_id":13009,"name":"Peter Razumovsky","email":"prazumovsky@mirantis.com","username":"prazumovsky"},"change_message_id":"8dca63e9e3fce08de35a0224c807dd377ffe7e11","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                              quota_size, \u0027total\u0027: total_size}"},{"line_number":114,"context_line":"            raise ValueError(err_message % message_format)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def validate_quotas(self, project, **kwargs):"},{"line_number":117,"context_line":"        search_opts \u003d {\u0027all_tenants\u0027: True, \u0027project_id\u0027: project}"},{"line_number":118,"context_line":"        if self.GIGABYTES in kwargs or self.VOLUMES in kwargs:"},{"line_number":119,"context_line":"            volume_list \u003d self.client().volumes.list(search_opts\u003dsearch_opts)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a89bdaa_6defbbe8","line":116,"updated":"2016-09-05 11:15:31.000000000","message":"it couldn\u0027t be in validate phase in case of calling lists with incorrect search opts:\n\nif project property ref to another stack resource, it\u0027s resource_id \u003d\u003d None, so search_opts will be equals to {project_id: None, all_tenants: True}. This search_opts will set search of ALL volumes/snapshots per all tenants, which is incorrect.\n\nThis behaviour is reasoned by well-known issue about weak heat validation. Currently you could move calling of validate_quotas in handle_create. Stack won\u0027t failed during validation, it will failed during creation, but allows you to handle this case.","commit_id":"1aa93c2eea3efe108b53ca438f5f63fd28b61f44"},{"author":{"_account_id":12404,"name":"Rico Lin","email":"ricolin@ricolky.com","username":"rico.lin"},"change_message_id":"326733d4bb807864a7e9b93d5a737176c54d51f2","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                              quota_size, \u0027total\u0027: total_size}"},{"line_number":114,"context_line":"            raise ValueError(err_message % message_format)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def validate_quotas(self, project, **kwargs):"},{"line_number":117,"context_line":"        search_opts \u003d {\u0027all_tenants\u0027: True, \u0027project_id\u0027: project}"},{"line_number":118,"context_line":"        if self.GIGABYTES in kwargs or self.VOLUMES in kwargs:"},{"line_number":119,"context_line":"            volume_list \u003d self.client().volumes.list(search_opts\u003dsearch_opts)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a89bdaa_5c49c35e","line":116,"in_reply_to":"9a89bdaa_6defbbe8","updated":"2016-09-05 13:58:32.000000000","message":"Done","commit_id":"1aa93c2eea3efe108b53ca438f5f63fd28b61f44"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"a36f98ecf6667c3f2ee42c6656cbe8b6f7cdb7b4","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def validate_quotas(self, project, **kwargs):"},{"line_number":117,"context_line":"        search_opts \u003d {\u0027all_tenants\u0027: True, \u0027project_id\u0027: project}"},{"line_number":118,"context_line":"        if self.GIGABYTES in kwargs or self.VOLUMES in kwargs:"},{"line_number":119,"context_line":"            volume_list \u003d self.client().volumes.list(search_opts\u003dsearch_opts)"},{"line_number":120,"context_line":"        if self.GIGABYTES in kwargs or self.SNAPSHOTS in kwargs:"},{"line_number":121,"context_line":"            snapshot_list \u003d self.client().volume_snapshots.list("},{"line_number":122,"context_line":"                search_opts\u003dsearch_opts)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        if self.GIGABYTES in kwargs:"},{"line_number":125,"context_line":"            quota_size \u003d kwargs[self.GIGABYTES]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a89bdaa_c96fdc90","line":122,"range":{"start_line":118,"start_character":0,"end_line":122,"end_character":40},"updated":"2016-09-05 11:01:21.000000000","message":"There is no reason to call this in case if all quota_size \u003d\u003d -1. We can return immediately.","commit_id":"1aa93c2eea3efe108b53ca438f5f63fd28b61f44"},{"author":{"_account_id":12404,"name":"Rico Lin","email":"ricolin@ricolky.com","username":"rico.lin"},"change_message_id":"326733d4bb807864a7e9b93d5a737176c54d51f2","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def validate_quotas(self, project, **kwargs):"},{"line_number":117,"context_line":"        search_opts \u003d {\u0027all_tenants\u0027: True, \u0027project_id\u0027: project}"},{"line_number":118,"context_line":"        if self.GIGABYTES in kwargs or self.VOLUMES in kwargs:"},{"line_number":119,"context_line":"            volume_list \u003d self.client().volumes.list(search_opts\u003dsearch_opts)"},{"line_number":120,"context_line":"        if self.GIGABYTES in kwargs or self.SNAPSHOTS in kwargs:"},{"line_number":121,"context_line":"            snapshot_list \u003d self.client().volume_snapshots.list("},{"line_number":122,"context_line":"                search_opts\u003dsearch_opts)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        if self.GIGABYTES in kwargs:"},{"line_number":125,"context_line":"            quota_size \u003d kwargs[self.GIGABYTES]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a89bdaa_a731dca4","line":122,"range":{"start_line":118,"start_character":0,"end_line":122,"end_character":40},"in_reply_to":"9a89bdaa_8d4ddf74","updated":"2016-09-05 13:58:32.000000000","message":"Done","commit_id":"1aa93c2eea3efe108b53ca438f5f63fd28b61f44"},{"author":{"_account_id":12363,"name":"Oleksii Chuprykov","email":"a.chuprikoff@gmail.com","username":"ochuprykov"},"change_message_id":"5d86be0c177573e761c98087e105c1a9ada19d37","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def validate_quotas(self, project, **kwargs):"},{"line_number":117,"context_line":"        search_opts \u003d {\u0027all_tenants\u0027: True, \u0027project_id\u0027: project}"},{"line_number":118,"context_line":"        if self.GIGABYTES in kwargs or self.VOLUMES in kwargs:"},{"line_number":119,"context_line":"            volume_list \u003d self.client().volumes.list(search_opts\u003dsearch_opts)"},{"line_number":120,"context_line":"        if self.GIGABYTES in kwargs or self.SNAPSHOTS in kwargs:"},{"line_number":121,"context_line":"            snapshot_list \u003d self.client().volume_snapshots.list("},{"line_number":122,"context_line":"                search_opts\u003dsearch_opts)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        if self.GIGABYTES in kwargs:"},{"line_number":125,"context_line":"            quota_size \u003d kwargs[self.GIGABYTES]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a89bdaa_8d4ddf74","line":122,"range":{"start_line":118,"start_character":0,"end_line":122,"end_character":40},"in_reply_to":"9a89bdaa_c96fdc90","updated":"2016-09-05 11:07:16.000000000","message":"And we can add more optimization in cases where only volumes or snapshots \u003e 0 and all other kwargs \u003d\u003d -1.","commit_id":"1aa93c2eea3efe108b53ca438f5f63fd28b61f44"}]}
