)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"ad6c255e77a47e8c978750334e249a38cf470c98","unresolved":false,"context_lines":[{"line_number":12,"context_line":"migrate existing custom policies to the upgraded version."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This change requires no modification to oslo.policy and so no new"},{"line_number":15,"context_line":"release or requirements bump will be needed."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I3c27c61cee3527b39f6a167b11198ab066614a1d"},{"line_number":18,"context_line":"Closes-bug: #1836568"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3fa7e38b_7e061c89","line":15,"updated":"2019-09-20 16:02:50.000000000","message":"Will this eventually go into oslo.policy? I assume other projects will want the same functionality.","commit_id":"15b416c34c49d038c059179feba38d9b398104ac"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"55063bf7fd28bcb3d818729863eb616990f0a184","unresolved":false,"context_lines":[{"line_number":12,"context_line":"migrate existing custom policies to the upgraded version."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This change requires no modification to oslo.policy and so no new"},{"line_number":15,"context_line":"release or requirements bump will be needed."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I3c27c61cee3527b39f6a167b11198ab066614a1d"},{"line_number":18,"context_line":"Closes-bug: #1836568"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3fa7e38b_be4814cc","line":15,"in_reply_to":"3fa7e38b_7e061c89","updated":"2019-09-20 16:04:31.000000000","message":"Yes, Ben already opened a bug for it https://bugs.launchpad.net/oslo.policy/+bug/1844555","commit_id":"15b416c34c49d038c059179feba38d9b398104ac"}],"keystone/common/rbac_enforcer/enforcer.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"2e4ebecd4310c34ab5124e2fb4410c6130b28ad9","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                        \"oslopolicy-policy-generate and \""},{"line_number":58,"context_line":"                        \"oslopolicy-policy-upgrade to detect and resolve \""},{"line_number":59,"context_line":"                        \"deprecated policies in your configuration.\")"},{"line_number":60,"context_line":"            self._enforcer.warnings_count +\u003d 1"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _check_deprecated_rule(self, action):"},{"line_number":63,"context_line":"        registered_rule \u003d self._enforcer.registered_rules[action]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_d9e8b817","line":60,"range":{"start_line":60,"start_character":12,"end_line":60,"end_character":46},"updated":"2019-09-18 17:22:35.000000000","message":"Nit: This seems a bit odd since it\u0027s being used as a boolean AFAICT.","commit_id":"81532bd125d2b437cc4babd361fcd5d2f477b291"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"b72d308b554363369464a0bfceb5eccc61079cdb","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                        \"oslopolicy-policy-generate and \""},{"line_number":58,"context_line":"                        \"oslopolicy-policy-upgrade to detect and resolve \""},{"line_number":59,"context_line":"                        \"deprecated policies in your configuration.\")"},{"line_number":60,"context_line":"            self._enforcer.warnings_count +\u003d 1"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _check_deprecated_rule(self, action):"},{"line_number":63,"context_line":"        registered_rule \u003d self._enforcer.registered_rules[action]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_7d2e4da6","line":60,"range":{"start_line":60,"start_character":12,"end_line":60,"end_character":46},"in_reply_to":"3fa7e38b_d9e8b817","updated":"2019-09-18 19:12:04.000000000","message":"Yeah couldn\u0027t decide which way i wanted to do it, will switch it to a boolean","commit_id":"81532bd125d2b437cc4babd361fcd5d2f477b291"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"2e4ebecd4310c34ab5124e2fb4410c6130b28ad9","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    def _check_deprecated_rule(self, action):"},{"line_number":63,"context_line":"        registered_rule \u003d self._enforcer.registered_rules[action]"},{"line_number":64,"context_line":"        deprecated_rule \u003d registered_rule.deprecated_rule"},{"line_number":65,"context_line":"        if (deprecated_rule and"},{"line_number":66,"context_line":"                deprecated_rule.check_str !\u003d registered_rule.check_str and"},{"line_number":67,"context_line":"                registered_rule.name not in self._enforcer.file_rules):"},{"line_number":68,"context_line":"            self._emit_warning()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_9abc6f06","line":65,"updated":"2019-09-18 17:22:35.000000000","message":"There\u0027s another case where we log a deprecation warning in o.p: https://github.com/openstack/oslo.policy/blob/e433a3cbec5da0241bb1716b8bfda9fa927069ce/oslo_policy/policy.py#L666 \u003c- confirmation that deprecation warnings are evil? ;-)\n\nLooking at it, I wonder if it\u0027s possible that we\u0027re actually logging deprecation warnings for some rules twice. Those if blocks are not mutually exclusive. That\u0027s probably not helping this situation.\n\nUnless you\u0027re sure that none of your policy deprecations are only renames, that case should be covered here too. It\u0027s also a good reason to eventually move this to the library so we don\u0027t have to keep duplicating the logic.","commit_id":"81532bd125d2b437cc4babd361fcd5d2f477b291"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"b72d308b554363369464a0bfceb5eccc61079cdb","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    def _check_deprecated_rule(self, action):"},{"line_number":63,"context_line":"        registered_rule \u003d self._enforcer.registered_rules[action]"},{"line_number":64,"context_line":"        deprecated_rule \u003d registered_rule.deprecated_rule"},{"line_number":65,"context_line":"        if (deprecated_rule and"},{"line_number":66,"context_line":"                deprecated_rule.check_str !\u003d registered_rule.check_str and"},{"line_number":67,"context_line":"                registered_rule.name not in self._enforcer.file_rules):"},{"line_number":68,"context_line":"            self._emit_warning()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_bd0da53f","line":65,"in_reply_to":"3fa7e38b_9abc6f06","updated":"2019-09-18 19:12:04.000000000","message":"Was planning to add the other case in the next round, thanks for pointing it out though or I would have forgotten","commit_id":"81532bd125d2b437cc4babd361fcd5d2f477b291"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"2e4ebecd4310c34ab5124e2fb4410c6130b28ad9","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        # The raw oslo-policy enforcer object"},{"line_number":111,"context_line":"        if self.__ENFORCER is None:"},{"line_number":112,"context_line":"            self.__ENFORCER \u003d common_policy.Enforcer(CONF)"},{"line_number":113,"context_line":"            if flask.has_request_context():"},{"line_number":114,"context_line":"                self.__ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":115,"context_line":"            self.register_rules(self.__ENFORCER)"},{"line_number":116,"context_line":"            self.__ENFORCER.warnings_count \u003d 0"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_da70a775","line":113,"updated":"2019-09-18 17:22:35.000000000","message":"Not sure I understand this. Don\u0027t you always want to suppress deprecation warnings in the parent class now?\n\nOh, no this is so you only suppress warnings in Keystone, not when running the other tools. Got it.\n\n(leaving the comment in case someone else has the same question)","commit_id":"81532bd125d2b437cc4babd361fcd5d2f477b291"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"094cd7c9608fb72aa1fa2a28da1f7e0edd470cfb","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        # The raw oslo-policy enforcer object"},{"line_number":111,"context_line":"        if self.__ENFORCER is None:"},{"line_number":112,"context_line":"            self.__ENFORCER \u003d common_policy.Enforcer(CONF)"},{"line_number":113,"context_line":"            if flask.has_request_context():"},{"line_number":114,"context_line":"                self.__ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":115,"context_line":"            self.register_rules(self.__ENFORCER)"},{"line_number":116,"context_line":"            self.__ENFORCER.warnings_count \u003d 0"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_8077203b","line":113,"in_reply_to":"3fa7e38b_60046416","updated":"2019-09-18 19:48:10.000000000","message":"Cool. I wonder if you also want an inverse check in the _check_deprecated_rule function so that you don\u0027t log both deprecation messages when running the standalone tools. I guess it doesn\u0027t hurt anything, but that message will be redundant and a little odd when you\u0027re already running the tool.","commit_id":"81532bd125d2b437cc4babd361fcd5d2f477b291"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"929937b0e7f16d594e7bf7cac1740a59e4815388","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        # The raw oslo-policy enforcer object"},{"line_number":111,"context_line":"        if self.__ENFORCER is None:"},{"line_number":112,"context_line":"            self.__ENFORCER \u003d common_policy.Enforcer(CONF)"},{"line_number":113,"context_line":"            if flask.has_request_context():"},{"line_number":114,"context_line":"                self.__ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":115,"context_line":"            self.register_rules(self.__ENFORCER)"},{"line_number":116,"context_line":"            self.__ENFORCER.warnings_count \u003d 0"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_a33266f0","line":113,"in_reply_to":"3fa7e38b_8077203b","updated":"2019-09-18 20:11:02.000000000","message":"I\u0027m not seeing the new log in my manual testing. It looks like oslopolicy calls this _enforcer property but doesn\u0027t actually call the _enforce method which is when the new log is emitted. The _enforce method is a convenient place to emit the warning for the server case because that\u0027s the point on the keystone side when load_rules is called.","commit_id":"81532bd125d2b437cc4babd361fcd5d2f477b291"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"b72d308b554363369464a0bfceb5eccc61079cdb","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        # The raw oslo-policy enforcer object"},{"line_number":111,"context_line":"        if self.__ENFORCER is None:"},{"line_number":112,"context_line":"            self.__ENFORCER \u003d common_policy.Enforcer(CONF)"},{"line_number":113,"context_line":"            if flask.has_request_context():"},{"line_number":114,"context_line":"                self.__ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":115,"context_line":"            self.register_rules(self.__ENFORCER)"},{"line_number":116,"context_line":"            self.__ENFORCER.warnings_count \u003d 0"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_60046416","line":113,"in_reply_to":"3fa7e38b_da70a775","updated":"2019-09-18 19:12:04.000000000","message":"I\u0027ll add a comment for clarity, yes it\u0027s because we don\u0027t want the keystone server to log the warnings but the policy tool still runs the keystone code and we do want those warnings.","commit_id":"81532bd125d2b437cc4babd361fcd5d2f477b291"}],"keystone/tests/unit/ksfixtures/policy.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"2e4ebecd4310c34ab5124e2fb4410c6130b28ad9","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        opts.set_defaults(self._config_fixture.conf)"},{"line_number":30,"context_line":"        self._config_fixture.config(group\u003d\u0027oslo_policy\u0027,"},{"line_number":31,"context_line":"                                    policy_file\u003dself._policy_file)"},{"line_number":32,"context_line":"        policy._ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":33,"context_line":"        self.addCleanup(policy.reset)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_da1e670b","side":"PARENT","line":32,"updated":"2019-09-18 17:22:35.000000000","message":"Will the unit tests have a flask context? You may still need this to suppress warnings in the tests.","commit_id":"18e0080af3dcc0a96ff5d98aeb5f517080a35fb2"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"929937b0e7f16d594e7bf7cac1740a59e4815388","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        opts.set_defaults(self._config_fixture.conf)"},{"line_number":30,"context_line":"        self._config_fixture.config(group\u003d\u0027oslo_policy\u0027,"},{"line_number":31,"context_line":"                                    policy_file\u003dself._policy_file)"},{"line_number":32,"context_line":"        policy._ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":33,"context_line":"        self.addCleanup(policy.reset)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_834aca52","side":"PARENT","line":32,"in_reply_to":"3fa7e38b_20bbcce2","updated":"2019-09-18 20:11:02.000000000","message":"Ah you\u0027re right, will add it back.","commit_id":"18e0080af3dcc0a96ff5d98aeb5f517080a35fb2"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"094cd7c9608fb72aa1fa2a28da1f7e0edd470cfb","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        opts.set_defaults(self._config_fixture.conf)"},{"line_number":30,"context_line":"        self._config_fixture.config(group\u003d\u0027oslo_policy\u0027,"},{"line_number":31,"context_line":"                                    policy_file\u003dself._policy_file)"},{"line_number":32,"context_line":"        policy._ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":33,"context_line":"        self.addCleanup(policy.reset)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_20bbcce2","side":"PARENT","line":32,"in_reply_to":"3fa7e38b_a0325cf0","updated":"2019-09-18 19:48:10.000000000","message":"I\u0027m seeing them for some tests:\nhttps://zuul.opendev.org/t/openstack/build/5b824eec5f95460793e14a16df85705e/log/job-output.txt#5321\n\nAnd one of the failures included them:\nhttps://zuul.opendev.org/t/openstack/build/5b824eec5f95460793e14a16df85705e/log/job-output.txt#16964\n\nNot as many as before though, as evidenced by the fact that I could load the logs in my browser to get those links.","commit_id":"18e0080af3dcc0a96ff5d98aeb5f517080a35fb2"},{"author":{"_account_id":8482,"name":"Colleen Murphy","email":"colleen@gazlene.net","username":"krinkle"},"change_message_id":"b72d308b554363369464a0bfceb5eccc61079cdb","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        opts.set_defaults(self._config_fixture.conf)"},{"line_number":30,"context_line":"        self._config_fixture.config(group\u003d\u0027oslo_policy\u0027,"},{"line_number":31,"context_line":"                                    policy_file\u003dself._policy_file)"},{"line_number":32,"context_line":"        policy._ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":33,"context_line":"        self.addCleanup(policy.reset)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_a0325cf0","side":"PARENT","line":32,"in_reply_to":"3fa7e38b_da1e670b","updated":"2019-09-18 19:12:04.000000000","message":"The API unit tests do use a flask context, and I don\u0027t see the warnings in the logs.","commit_id":"18e0080af3dcc0a96ff5d98aeb5f517080a35fb2"}]}
