)]}'
{"oslo_limit/limit.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2acde79fc141f5e3c33fc3d96aec76dc07679c53","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        r \u003d self.connection.limits.model()"},{"line_number":78,"context_line":"        return r.model.name"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def set_enforcement_model(self):"},{"line_number":81,"context_line":"        \"\"\"Set the enforcement model based on configured model in keystone."},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        Callers can invoke the Enforcer to call keystone and ask for the"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_ec86fa65","line":80,"updated":"2019-06-20 11:29:20.000000000","message":"Not sure when we would call this to be honest, probably refresh on service restart is enough? (shrugs).\n\nMaybe go for _set_enforcement_model to start with?","commit_id":"dad756f92bf4cc6074121afe6f7e0e0b728e7d8a"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"ea39239fb21d76c9a20c820e1f6b4cd3fdeecf68","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        r \u003d self.connection.limits.model()"},{"line_number":78,"context_line":"        return r.model.name"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def set_enforcement_model(self):"},{"line_number":81,"context_line":"        \"\"\"Set the enforcement model based on configured model in keystone."},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        Callers can invoke the Enforcer to call keystone and ask for the"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_bd610a3c","line":80,"in_reply_to":"9fb8cfa7_ec86fa65","updated":"2019-06-20 14:25:24.000000000","message":"Done","commit_id":"dad756f92bf4cc6074121afe6f7e0e0b728e7d8a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2acde79fc141f5e3c33fc3d96aec76dc07679c53","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            elif not isinstance(v, int):"},{"line_number":111,"context_line":"                raise ValueError(\u0027resource limit is not an integer.\u0027)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        self.model.enforce(project_id, deltas, self.usage_callback)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_8c7dfe6f","line":113,"updated":"2019-06-20 11:29:20.000000000","message":"Yeah, ++","commit_id":"dad756f92bf4cc6074121afe6f7e0e0b728e7d8a"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"8e28433b5d3b7f7e18ab93edb8bf07893e154c1a","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        self.model.enforce("},{"line_number":122,"context_line":"            project_id, deltas, self.usage_callback,"},{"line_number":123,"context_line":"            resource_filters\u003dresource_filters"},{"line_number":124,"context_line":"        )"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fb8cfa7_de0b4fd2","line":123,"updated":"2019-06-25 18:57:54.000000000","message":"I\u0027m not a huge fan of passing in more than a couple of arguments on methods. Unfortunately, the enforcer needs a model, but we want the models to contain only information they need for their enforcement properties. We also want them to be pluggable.\n\nWhat we could do would be to have the Enforcer grab an instance of the model, set properties on it within Enforcer.enforcer(), and pass less when calling the model\u0027s enforce() method.","commit_id":"f743475200b2b52ff2b932abe689b3340581fdc1"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"e8cf9ea672d5489711b96705605804d4baaaf68f","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def _get_enforcement_model(self):"},{"line_number":76,"context_line":"        \"\"\"Query keystone for the configured enforcement model.\"\"\""},{"line_number":77,"context_line":"        r \u003d self.connection.limits.model()"},{"line_number":78,"context_line":"        return r.model.name"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def _set_enforcement_model(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_0ba9788e","line":77,"range":{"start_line":77,"start_character":35,"end_line":77,"end_character":40},"updated":"2019-06-27 22:51:57.000000000","message":"Is this defined in the sdk? I don\u0027t see it","commit_id":"559ddf17ae70a908602abb16a18a65da19bb394f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"9791dadd2e9b03c4ce7d138adf6269ee6be6685e","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def _get_enforcement_model(self):"},{"line_number":76,"context_line":"        \"\"\"Query keystone for the configured enforcement model.\"\"\""},{"line_number":77,"context_line":"        r \u003d self.connection.limits.model()"},{"line_number":78,"context_line":"        return r.model.name"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def _set_enforcement_model(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_ede893df","line":77,"range":{"start_line":77,"start_character":35,"end_line":77,"end_character":40},"in_reply_to":"9fb8cfa7_0ba9788e","updated":"2019-07-01 16:38:11.000000000","message":"Done","commit_id":"559ddf17ae70a908602abb16a18a65da19bb394f"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"e8cf9ea672d5489711b96705605804d4baaaf68f","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        \"\"\"Set the enforcement model based on configured model in keystone.\"\"\""},{"line_number":82,"context_line":"        current_model \u003d self._get_enforcement_model()"},{"line_number":83,"context_line":"        for m in _MODELS:"},{"line_number":84,"context_line":"            if current_model \u003d\u003d m.name and self.model !\u003d current_model:"},{"line_number":85,"context_line":"                self.model \u003d m()"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def enforce(self, project_id, deltas, resource_filters\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_4ba3f0b2","line":84,"range":{"start_line":84,"start_character":43,"end_line":84,"end_character":70},"updated":"2019-06-27 22:51:57.000000000","message":"Won\u0027t this always be True? _get_enforcement_model() returns .name which I assume is a string, while self.model looks like an instance of a _BaseEnforcer class.","commit_id":"559ddf17ae70a908602abb16a18a65da19bb394f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"9791dadd2e9b03c4ce7d138adf6269ee6be6685e","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        \"\"\"Set the enforcement model based on configured model in keystone.\"\"\""},{"line_number":82,"context_line":"        current_model \u003d self._get_enforcement_model()"},{"line_number":83,"context_line":"        for m in _MODELS:"},{"line_number":84,"context_line":"            if current_model \u003d\u003d m.name and self.model !\u003d current_model:"},{"line_number":85,"context_line":"                self.model \u003d m()"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def enforce(self, project_id, deltas, resource_filters\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_8da237ad","line":84,"range":{"start_line":84,"start_character":43,"end_line":84,"end_character":70},"in_reply_to":"9fb8cfa7_4ba3f0b2","updated":"2019-07-01 16:38:11.000000000","message":"Done, I\u0027ll add some tests for this.","commit_id":"559ddf17ae70a908602abb16a18a65da19bb394f"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"e8cf9ea672d5489711b96705605804d4baaaf68f","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        current_model \u003d self._get_enforcement_model()"},{"line_number":83,"context_line":"        for m in _MODELS:"},{"line_number":84,"context_line":"            if current_model \u003d\u003d m.name and self.model !\u003d current_model:"},{"line_number":85,"context_line":"                self.model \u003d m()"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def enforce(self, project_id, deltas, resource_filters\u003dNone):"},{"line_number":88,"context_line":"        \"\"\"Check resource usage against limits and request deltas."}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_2b10fcff","line":85,"updated":"2019-06-27 22:51:57.000000000","message":"break?","commit_id":"559ddf17ae70a908602abb16a18a65da19bb394f"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"9791dadd2e9b03c4ce7d138adf6269ee6be6685e","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        current_model \u003d self._get_enforcement_model()"},{"line_number":83,"context_line":"        for m in _MODELS:"},{"line_number":84,"context_line":"            if current_model \u003d\u003d m.name and self.model !\u003d current_model:"},{"line_number":85,"context_line":"                self.model \u003d m()"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def enforce(self, project_id, deltas, resource_filters\u003dNone):"},{"line_number":88,"context_line":"        \"\"\"Check resource usage against limits and request deltas."}],"source_content_type":"text/x-python","patch_set":5,"id":"9fb8cfa7_4da8bf8a","line":85,"in_reply_to":"9fb8cfa7_2b10fcff","updated":"2019-07-01 16:38:11.000000000","message":"Done","commit_id":"559ddf17ae70a908602abb16a18a65da19bb394f"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"9155ef2d5a088750ba30652f5a9613abff06ef2e","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        \"\"\"Set the enforcement model based on configured model in keystone.\"\"\""},{"line_number":80,"context_line":"        cm \u003d self._get_enforcement_model()"},{"line_number":81,"context_line":"        for m in _MODELS:"},{"line_number":82,"context_line":"            if cm \u003d\u003d m.name and self.model.name !\u003d cm:"},{"line_number":83,"context_line":"                self.model \u003d m()"},{"line_number":84,"context_line":"                break"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_efadd131","line":82,"range":{"start_line":82,"start_character":32,"end_line":82,"end_character":53},"updated":"2019-07-03 20:07:51.000000000","message":"This is blowing up for me because the first time through self.model is None. Changing it to \"(not self.model or self.model.name !\u003d cm)\" seems to work.","commit_id":"0613e8154193e5e29c7170dc519af61f44156e7e"}]}
