)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"fa5143a781976d61023506221963994af7bc34d8","unresolved":false,"context_lines":[{"line_number":24,"context_line":"report_file - defaults to patrole-rbac-report.log,"},{"line_number":25,"context_line":"controls which log file this is written to"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"print_summary_only - defaults to False,"},{"line_number":28,"context_line":"Causes patrole to just print the outcomes of each test"},{"line_number":29,"context_line":"This does not change the permissions enforced on the"},{"line_number":30,"context_line":"cloud Patrole tests against, only controls whether or not"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9f436f4f_7e432b43","line":27,"range":{"start_line":27,"start_character":0,"end_line":27,"end_character":18},"updated":"2017-08-16 03:18:47.000000000","message":"So everything you\u0027ve done is clear to me, with the exception of this. If I understand correctly, the use case for this is:\n\n\"Dry run all the Patrole tests and log the result of each test to the ``report_file``, given the current value of ``[patrole] rbac_test_role``. This produces a summary of all the policies the current test role is or is not allowed to execute. The tests themselves are skipped as the purpose of this is to just generate summary log report.\"\n\n^ Is that right -- or did I misinterpret something?\n\nAs it stands, based on the code in rbac_rule_validation, I can\u0027t see the value in the option ``print_summary_only`` -- because it logs almost the exact same output as normal while still allowing all the tests to be run, which appears to be incorrect, at least given my interpretation of what you\u0027ve written. At the same time, the code for ``print_summary_log`` appears to require test execution, so I\u0027m not certain what this is really for.","commit_id":"a7b893d5d833a6491cec911d5185c6d1f932d9c8"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"ca44548ffbaf675059bf0c4402d7229a5ef9ef65","unresolved":false,"context_lines":[{"line_number":24,"context_line":"report_file - defaults to patrole-rbac-report.log,"},{"line_number":25,"context_line":"controls which log file this is written to"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"print_summary_only - defaults to False,"},{"line_number":28,"context_line":"Causes patrole to just print the outcomes of each test"},{"line_number":29,"context_line":"This does not change the permissions enforced on the"},{"line_number":30,"context_line":"cloud Patrole tests against, only controls whether or not"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9f436f4f_5c8065f5","line":27,"range":{"start_line":27,"start_character":0,"end_line":27,"end_character":18},"in_reply_to":"9f436f4f_7e432b43","updated":"2017-08-16 13:43:59.000000000","message":"Originally it would just run it with _is_allowed returning True for all tests, and print the summary, but now it just changes the format of the summary, just showing what the ``rbac_test_role`` is allowed to do (and suppressing the [Expected] part of the output. Since we need the _is_allowed check, could probably just remove this altogether and say if you want a summary, give an allow all policy to a given user and see what the results are\n\nMy original problem revolved around not having detailed output of the allowed/denied bit, and only really having test pass/fail to go on, which was cryptic to say the least for a policy of any complexity, I guess at this point it\u0027d be better to remove this extra bit since it probably adds some needless complexity to the code","commit_id":"a7b893d5d833a6491cec911d5185c6d1f932d9c8"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"c426b4a199dd4c2f64970222e79fbc46ce85afb2","unresolved":false,"context_lines":[{"line_number":13,"context_line":"test to a separate log file, as well as to the normal"},{"line_number":14,"context_line":"tempest.log file. This message is of the form:"},{"line_number":15,"context_line":"[Service] \u003cnova, neutron, etc\u003e"},{"line_number":16,"context_line":"[Function] \u003cname of the test\u0027s method\u003e"},{"line_number":17,"context_line":"followed by either the result of the test as Allowed/Denied/Error, or"},{"line_number":18,"context_line":"the expected result (from oslopolicy) and then the actual result"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9f436f4f_ba6b7a1d","line":16,"range":{"start_line":16,"start_character":1,"end_line":16,"end_character":9},"updated":"2017-08-20 02:18:44.000000000","message":"Test","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"c426b4a199dd4c2f64970222e79fbc46ce85afb2","unresolved":false,"context_lines":[{"line_number":21,"context_line":"config group called patrole_log:"},{"line_number":22,"context_line":"enable_reporting - defaults to True, which enables this new logging"},{"line_number":23,"context_line":"functionality"},{"line_number":24,"context_line":"report_log_name - defaults to patrole.log, controls which log file this"},{"line_number":25,"context_line":"is written to. Note that this file is overwritten on each invocation of"},{"line_number":26,"context_line":"Patrole"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"9f436f4f_da863edc","line":24,"range":{"start_line":24,"start_character":52,"end_line":24,"end_character":66},"updated":"2017-08-20 02:18:44.000000000","message":"the name of the log","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"354606d746eaab632488e32c70db2c5a78cace2c","unresolved":false,"context_lines":[{"line_number":23,"context_line":"functionality"},{"line_number":24,"context_line":"report_log_name - defaults to patrole.log, controls the name of the log"},{"line_number":25,"context_line":"this is written to."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Change-Id: Iff2176f1a7c7d10f78b96d748f1d70b222fd5072"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"7f287b81_4ad142cd","line":26,"updated":"2017-08-24 21:16:59.000000000","message":"Need to add the report log path config option here too.","commit_id":"22d6b43e2b883a79ae80a420dc662f11c01259f3"}],"patrole_tempest_plugin/config.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"86f1b9fad00179b2c758f1094164bd1e2cfaabcf","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                help\u003d\"\"\"If true, throws RbacParsingException for policies which"},{"line_number":32,"context_line":"don\u0027t exist or are not included in the service\u0027s policy file. If false, throws"},{"line_number":33,"context_line":"skipException.\"\"\"),"},{"line_number":34,"context_line":"    cfg.BoolOpt(\u0027enable_rbac_reporting\u0027,"},{"line_number":35,"context_line":"                default\u003dTrue,"},{"line_number":36,"context_line":"                help\u003d\"Enables reporting on RBAC details for each test\"),"},{"line_number":37,"context_line":"    cfg.StrOpt(\u0027rbac_report_file\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_c0afe727","line":34,"updated":"2017-08-15 16:05:44.000000000","message":"I think it\u0027d be better to isolate these options into their own group like \"rbac_log\" or \"patrole_log\". There\u0027s a proposed change [0] about changing \"rbac\" group to \"patrole\" group as it\u0027s more user-friendly, i.e. obvious that it belongs to patrole -- so I prefer \"patrole_log\".\n\n[0] https://review.openstack.org/#/c/491153/","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"86f1b9fad00179b2c758f1094164bd1e2cfaabcf","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    cfg.BoolOpt(\u0027enable_rbac_reporting\u0027,"},{"line_number":35,"context_line":"                default\u003dTrue,"},{"line_number":36,"context_line":"                help\u003d\"Enables reporting on RBAC details for each test\"),"},{"line_number":37,"context_line":"    cfg.StrOpt(\u0027rbac_report_file\u0027,"},{"line_number":38,"context_line":"               default\u003d\u0027patrole-rbac-report.log\u0027,"},{"line_number":39,"context_line":"               help\u003d\"Separate file to log the RBAC outcome report to\"),"},{"line_number":40,"context_line":"    cfg.BoolOpt(\u0027rbac_print_summary_only\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_a02d03a9","line":37,"range":{"start_line":37,"start_character":16,"end_line":37,"end_character":21},"updated":"2017-08-15 16:05:44.000000000","message":"I think it\u0027s better to drop \"rbac_\" prefixes as they\u0027re superfluous (since \"patrole\" or \"rbac\" is the group name). It should be clear that all of this pertains to patrole/rbac. It wasn\u0027t originally my idea to do that and I\u0027m not a fan of it.","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"86f1b9fad00179b2c758f1094164bd1e2cfaabcf","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    cfg.StrOpt(\u0027rbac_report_file\u0027,"},{"line_number":38,"context_line":"               default\u003d\u0027patrole-rbac-report.log\u0027,"},{"line_number":39,"context_line":"               help\u003d\"Separate file to log the RBAC outcome report to\"),"},{"line_number":40,"context_line":"    cfg.BoolOpt(\u0027rbac_print_summary_only\u0027,"},{"line_number":41,"context_line":"                default\u003dFalse,"},{"line_number":42,"context_line":"                help\u003d\"Causes patrole to only print the outcome summary, \""},{"line_number":43,"context_line":"                \"instead of test against a given policy file\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_601ddb72","line":40,"range":{"start_line":40,"start_character":17,"end_line":40,"end_character":22},"updated":"2017-08-15 16:05:44.000000000","message":"Ditto.","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"e4e127a4a37b49dace3e78bf9742b64a8856de42","unresolved":false,"context_lines":[{"line_number":154,"context_line":"PatroleLogGroup \u003d ["},{"line_number":155,"context_line":"    cfg.BoolOpt(\u0027enable_reporting\u0027,"},{"line_number":156,"context_line":"                default\u003dTrue,"},{"line_number":157,"context_line":"                help\u003d\"Enables reporting on RBAC details for each test\"),"},{"line_number":158,"context_line":"    cfg.StrOpt(\u0027report_file\u0027,"},{"line_number":159,"context_line":"               default\u003d\u0027patrole-rbac-report.log\u0027,"},{"line_number":160,"context_line":"               help\u003d\"Separate file to log the RBAC outcome report to\"),"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f436f4f_2e10b956","line":157,"range":{"start_line":157,"start_character":40,"end_line":157,"end_character":69},"updated":"2017-08-17 02:08:14.000000000","message":"on the expected and actual test results for each Patrole test","commit_id":"eec9762fbe4af4eae59957b82ee17e6e3d947ca0"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"e4e127a4a37b49dace3e78bf9742b64a8856de42","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                help\u003d\"Enables reporting on RBAC details for each test\"),"},{"line_number":158,"context_line":"    cfg.StrOpt(\u0027report_file\u0027,"},{"line_number":159,"context_line":"               default\u003d\u0027patrole-rbac-report.log\u0027,"},{"line_number":160,"context_line":"               help\u003d\"Separate file to log the RBAC outcome report to\"),"},{"line_number":161,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f436f4f_79044915","line":160,"range":{"start_line":160,"start_character":46,"end_line":160,"end_character":68},"updated":"2017-08-17 02:08:14.000000000","message":"printout of \u0027enable_reporting\u0027 to","commit_id":"eec9762fbe4af4eae59957b82ee17e6e3d947ca0"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"dac9562efe2aa001abeda1f7f0d92ac09ec742d3","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                help\u003d\"Enables reporting on RBAC expected and actual test \""},{"line_number":158,"context_line":"                     \"results for each Patrole test\"),"},{"line_number":159,"context_line":"    cfg.StrOpt(\u0027report_file\u0027,"},{"line_number":160,"context_line":"               default\u003d\u0027patrole-rbac-report.log\u0027,"},{"line_number":161,"context_line":"               help\u003d\"File to log the outcome reporting \""},{"line_number":162,"context_line":"                    \"from \u0027enable_reporting\u0027 to\"),"},{"line_number":163,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_8ce0b6ce","line":160,"range":{"start_line":160,"start_character":24,"end_line":160,"end_character":47},"updated":"2017-08-17 21:31:23.000000000","message":"I would prefer patrole.log as the default, as the default tempest log is tempest.log.\n\nSomething also to consider: Without using an absolute path, this  creates a log wherever the test is run from. I think this log should always be created in the root patrole directory.\n\nPerhaps it would be better to call this \"report_log_name\". Then in plugin.py, pass:\n\n    os.path.join(parent_dir, CONF.patrole_log.report_log_name).\n\nparent_dir can be calculated using:\n\n    os.path.abspath(os.path.join(os.path.realpath(__file__), os.pardir))\n\nSince this is run from plugin.py, should produce: \"/opt/stack/patrole/patrole_tempest_plugin\" and when combined with the log name, should produce \"/opt/stack/patrole/patrole_tempest_plugin/patrole.log\" by default.","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d674aa8893b299809bf28aca16e4b2e8878100c3","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                help\u003d\"Enables reporting on RBAC expected and actual test \""},{"line_number":158,"context_line":"                     \"results for each Patrole test\"),"},{"line_number":159,"context_line":"    cfg.StrOpt(\u0027report_file\u0027,"},{"line_number":160,"context_line":"               default\u003d\u0027patrole-rbac-report.log\u0027,"},{"line_number":161,"context_line":"               help\u003d\"File to log the outcome reporting \""},{"line_number":162,"context_line":"                    \"from \u0027enable_reporting\u0027 to\"),"},{"line_number":163,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_870d2cea","line":160,"range":{"start_line":160,"start_character":24,"end_line":160,"end_character":47},"in_reply_to":"9f436f4f_8ce0b6ce","updated":"2017-08-18 01:27:48.000000000","message":"This should work (just tried):\n\npatrole_root_dir \u003d os.path.abspath(os.path.join(os.path.realpath(__file__), os.pardir, os.pardir))\nreport_abs_path \u003d os.path.join(patrole_root_dir , CONF.patrole_log.report_log_name)\nrbac_report_handler \u003d logging.FileHandler(\n            filename\u003dreport_abs_path , delay\u003dTrue, mode\u003d\u0027w\u0027)","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"7abb26baafe5b583f31b08b799e48b5d100b6b5a","unresolved":false,"context_lines":[{"line_number":158,"context_line":"                     \"results for each Patrole test\"),"},{"line_number":159,"context_line":"    cfg.StrOpt(\u0027report_log_name\u0027,"},{"line_number":160,"context_line":"               default\u003d\u0027patrole.log\u0027,"},{"line_number":161,"context_line":"               help\u003d\"File to log the outcome reporting \""},{"line_number":162,"context_line":"                    \"from \u0027enable_reporting\u0027 to. Note that this file is \""},{"line_number":163,"context_line":"                    \"overwritten on each invocation\"),"},{"line_number":164,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":19,"id":"9f436f4f_f6821fa5","line":163,"range":{"start_line":161,"start_character":20,"end_line":163,"end_character":54},"updated":"2017-08-21 20:25:32.000000000","message":"nit: Can be wrapped a bit better.","commit_id":"45c71d6a132be530918d65c53e8ab4946f76d65a"},{"author":{"_account_id":23185,"name":"Samantha Blanco","email":"samantha.blanco@att.com","username":"sblanco"},"change_message_id":"ba2cf6bc542e7000d15b50ad0f0716281de7b4c1","unresolved":false,"context_lines":[{"line_number":158,"context_line":"                     \"results for each Patrole test\"),"},{"line_number":159,"context_line":"    cfg.StrOpt(\u0027report_log_name\u0027,"},{"line_number":160,"context_line":"               default\u003d\u0027patrole.log\u0027,"},{"line_number":161,"context_line":"               help\u003d\"File to log the outcome reporting \""},{"line_number":162,"context_line":"                    \"from \u0027enable_reporting\u0027 to. Note that this file is \""},{"line_number":163,"context_line":"                    \"overwritten on each invocation\"),"},{"line_number":164,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":20,"id":"7f287b81_1eff2eab","line":162,"range":{"start_line":161,"start_character":21,"end_line":162,"end_character":47},"updated":"2017-08-23 15:25:16.000000000","message":"This sentence is a bit unclear; a better phrasing might something like \"Name of file where output from \u0027enable_reporting\u0027 is logged\"","commit_id":"4f8f740ea744dba40a1d86e646985fa54f793114"},{"author":{"_account_id":23185,"name":"Samantha Blanco","email":"samantha.blanco@att.com","username":"sblanco"},"change_message_id":"42ad9f585d88df25d956c5047f37588d44d70b92","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"PatroleLogGroup \u003d ["},{"line_number":155,"context_line":"    cfg.BoolOpt(\u0027enable_reporting\u0027,"},{"line_number":156,"context_line":"                default\u003dTrue,"},{"line_number":157,"context_line":"                help\u003d\"Enables reporting on RBAC expected and actual test \""},{"line_number":158,"context_line":"                     \"results for each Patrole test\"),"},{"line_number":159,"context_line":"    cfg.StrOpt(\u0027report_log_name\u0027,"}],"source_content_type":"text/x-python","patch_set":26,"id":"7f287b81_18ec98f1","line":156,"range":{"start_line":156,"start_character":24,"end_line":156,"end_character":28},"updated":"2017-08-25 19:00:01.000000000","message":"I\u0027m not sure I agree with having this enabled by default.","commit_id":"29b109c356f98c4ed81bcf4d3cd5af0731486b4e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"9366c99c9a538dbfccb0269d5f09c8c1c9dfad5a","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"PatroleLogGroup \u003d ["},{"line_number":155,"context_line":"    cfg.BoolOpt(\u0027enable_reporting\u0027,"},{"line_number":156,"context_line":"                default\u003dTrue,"},{"line_number":157,"context_line":"                help\u003d\"Enables reporting on RBAC expected and actual test \""},{"line_number":158,"context_line":"                     \"results for each Patrole test\"),"},{"line_number":159,"context_line":"    cfg.StrOpt(\u0027report_log_name\u0027,"}],"source_content_type":"text/x-python","patch_set":29,"id":"7f287b81_e468fe1d","line":156,"range":{"start_line":156,"start_character":24,"end_line":156,"end_character":28},"updated":"2017-08-26 01:56:15.000000000","message":"Looks like this accidentally flipped back to True (happens when you make inline changes and forget to pull them down locally.)\n\nPersonally, I think that logging should be enabled by default. However, I understand that we\u0027ve implemented logging in a less OpenStack-y way here, so I understand the desire in wanting to keep it False by default.","commit_id":"4029af6d4ea9c63958d295f6423dd34009922add"}],"patrole_tempest_plugin/plugin.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"fa5143a781976d61023506221963994af7bc34d8","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        rbac_report_handler.setFormatter("},{"line_number":57,"context_line":"            fmt\u003dlogging.Formatter(fmt\u003d\u0027%(message)s\u0027))"},{"line_number":58,"context_line":"        RBACLOG.addHandler(rbac_report_handler)"},{"line_number":59,"context_line":"        # TODO(spryor): It would be great to log a \u003cstarting test\u003e message"},{"line_number":60,"context_line":"        # here, to help separate results per-run, but I couldn\u0027t find a good"},{"line_number":61,"context_line":"        # way to have only the master thread print it"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def get_opt_lists(self):"},{"line_number":64,"context_line":"        return [(project_config.patrole_group.name,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_c3124462","line":61,"range":{"start_line":59,"start_character":8,"end_line":61,"end_character":53},"updated":"2017-08-16 03:18:47.000000000","message":"This TODO should be moved elsewhere or refactored such that \"It would be great to log a \u003cstarting test\u003e message here\" makes sense in this context, because plugin.py isn\u0027t the place for such a change.","commit_id":"a7b893d5d833a6491cec911d5185c6d1f932d9c8"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"dac9562efe2aa001abeda1f7f0d92ac09ec742d3","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        RBACLOG.setLevel(level\u003dlogging.INFO)"},{"line_number":54,"context_line":"        # Delay\u003dTrue so that we don\u0027t end up creating an empty"},{"line_number":55,"context_line":"        # file if we never log to it"},{"line_number":56,"context_line":"        rbac_report_handler \u003d logging.FileHandler("},{"line_number":57,"context_line":"            filename\u003dconf.patrole_log.report_file, delay\u003dTrue)"},{"line_number":58,"context_line":"        rbac_report_handler.setFormatter("},{"line_number":59,"context_line":"            fmt\u003dlogging.Formatter(fmt\u003d\u0027%(message)s\u0027))"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_ec1f42b5","line":56,"updated":"2017-08-17 21:31:23.000000000","message":"Doesn\u0027t look like this is creating a log if it already exists.","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4cbe0423313aea2d6c4c4304847951133852b27c","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        RBACLOG.setLevel(level\u003dlogging.INFO)"},{"line_number":54,"context_line":"        # Delay\u003dTrue so that we don\u0027t end up creating an empty"},{"line_number":55,"context_line":"        # file if we never log to it"},{"line_number":56,"context_line":"        rbac_report_handler \u003d logging.FileHandler("},{"line_number":57,"context_line":"            filename\u003dconf.patrole_log.report_file, delay\u003dTrue)"},{"line_number":58,"context_line":"        rbac_report_handler.setFormatter("},{"line_number":59,"context_line":"            fmt\u003dlogging.Formatter(fmt\u003d\u0027%(message)s\u0027))"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_871d3175","line":56,"in_reply_to":"9f436f4f_ec1f42b5","updated":"2017-08-17 21:32:53.000000000","message":"By that, I mean re-writing to it.","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d674aa8893b299809bf28aca16e4b2e8878100c3","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # Delay\u003dTrue so that we don\u0027t end up creating an empty"},{"line_number":55,"context_line":"        # file if we never log to it"},{"line_number":56,"context_line":"        rbac_report_handler \u003d logging.FileHandler("},{"line_number":57,"context_line":"            filename\u003dconf.patrole_log.report_file, delay\u003dTrue)"},{"line_number":58,"context_line":"        rbac_report_handler.setFormatter("},{"line_number":59,"context_line":"            fmt\u003dlogging.Formatter(fmt\u003d\u0027%(message)s\u0027))"},{"line_number":60,"context_line":"        RBACLOG.addHandler(rbac_report_handler)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_27468023","line":57,"range":{"start_line":57,"start_character":50,"end_line":57,"end_character":62},"updated":"2017-08-18 01:27:48.000000000","message":"Adding mode\u003d\u0027w\u0027 after this makes the above comment work. See: http://www.tutorialspoint.com/python/python_files_io.htm","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"d9db0f8013c828114fa1621ba4b8386e1eff58a6","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # Delay\u003dTrue so that we don\u0027t end up creating an empty"},{"line_number":55,"context_line":"        # file if we never log to it"},{"line_number":56,"context_line":"        rbac_report_handler \u003d logging.FileHandler("},{"line_number":57,"context_line":"            filename\u003dconf.patrole_log.report_file, delay\u003dTrue)"},{"line_number":58,"context_line":"        rbac_report_handler.setFormatter("},{"line_number":59,"context_line":"            fmt\u003dlogging.Formatter(fmt\u003d\u0027%(message)s\u0027))"},{"line_number":60,"context_line":"        RBACLOG.addHandler(rbac_report_handler)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_c0ad3e32","line":57,"range":{"start_line":57,"start_character":50,"end_line":57,"end_character":62},"in_reply_to":"9f436f4f_27468023","updated":"2017-08-18 19:41:49.000000000","message":"That\u0027s a great idea, that helps separate result sets. Though I think we should probably mention that the file is overwritten on subsequent runs","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"da11d747d680bf90af6e0ad17576d2b23d93a77f","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # Delay\u003dTrue so that we don\u0027t end up creating an empty"},{"line_number":55,"context_line":"        # file if we never log to it"},{"line_number":56,"context_line":"        rbac_report_handler \u003d logging.FileHandler("},{"line_number":57,"context_line":"            filename\u003dconf.patrole_log.report_file, delay\u003dTrue)"},{"line_number":58,"context_line":"        rbac_report_handler.setFormatter("},{"line_number":59,"context_line":"            fmt\u003dlogging.Formatter(fmt\u003d\u0027%(message)s\u0027))"},{"line_number":60,"context_line":"        RBACLOG.addHandler(rbac_report_handler)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_c33c28c1","line":57,"range":{"start_line":57,"start_character":50,"end_line":57,"end_character":62},"in_reply_to":"9f436f4f_c0ad3e32","updated":"2017-08-18 19:51:47.000000000","message":"I considered: \"what about rotating the logs\" but it seemed like that would get messy really fast across multiple test runs and dumping it all to 1 log seemed messy to as it would make browsing it across multiple test runs messy too.","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"25c5ab89ae161d46c737ad83d43fd9324857f21e","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # Delay\u003dTrue so that we don\u0027t end up creating an empty"},{"line_number":55,"context_line":"        # file if we never log to it"},{"line_number":56,"context_line":"        rbac_report_handler \u003d logging.FileHandler("},{"line_number":57,"context_line":"            filename\u003dconf.patrole_log.report_file, delay\u003dTrue)"},{"line_number":58,"context_line":"        rbac_report_handler.setFormatter("},{"line_number":59,"context_line":"            fmt\u003dlogging.Formatter(fmt\u003d\u0027%(message)s\u0027))"},{"line_number":60,"context_line":"        RBACLOG.addHandler(rbac_report_handler)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_43d6f851","line":57,"range":{"start_line":57,"start_character":50,"end_line":57,"end_character":62},"in_reply_to":"9f436f4f_c33c28c1","updated":"2017-08-18 19:59:03.000000000","message":"That\u0027s awesome, I was worrying about the exact same problem, but that makes it so much easier :D","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"7abb26baafe5b583f31b08b799e48b5d100b6b5a","unresolved":false,"context_lines":[{"line_number":50,"context_line":"            project_config.PatroleLogGroup)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        # Separate log handler for rbac reporting"},{"line_number":53,"context_line":"        RBACLOG.setLevel(level\u003dlogging.INFO)"},{"line_number":54,"context_line":"        # Set up proper directory handling"},{"line_number":55,"context_line":"        patrole_root_dir \u003d os.path.abspath(os.path.join("},{"line_number":56,"context_line":"            os.path.realpath(__file__), os.pardir, os.pardir))"}],"source_content_type":"text/x-python","patch_set":19,"id":"9f436f4f_56b7ab87","line":53,"updated":"2017-08-21 20:25:32.000000000","message":"Could add this to a private helper function for setting up logging.","commit_id":"45c71d6a132be530918d65c53e8ab4946f76d65a"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"354606d746eaab632488e32c70db2c5a78cace2c","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    def _reset_log_file(self, logfile):"},{"line_number":40,"context_line":"        try:"},{"line_number":41,"context_line":"            os.remove(logfile)"},{"line_number":42,"context_line":"        except Exception:"},{"line_number":43,"context_line":"            pass"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _configure_per_test_logging(self, conf):"}],"source_content_type":"text/x-python","patch_set":24,"id":"7f287b81_2a86f6dc","line":42,"range":{"start_line":42,"start_character":15,"end_line":42,"end_character":24},"updated":"2017-08-24 21:16:59.000000000","message":"nit: This could probably be OSError. I think that would capture all the possible exceptions.","commit_id":"22d6b43e2b883a79ae80a420dc662f11c01259f3"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"354606d746eaab632488e32c70db2c5a78cace2c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        report_path \u003d os.path.join("},{"line_number":51,"context_line":"            report_abs_path, conf.patrole_log.report_log_name)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        self._reset_log_file(report_path)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        # Delay\u003dTrue so that we don\u0027t end up creating an empty file if we never"},{"line_number":56,"context_line":"        # log to it."}],"source_content_type":"text/x-python","patch_set":24,"id":"7f287b81_8a628a3d","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":41},"updated":"2017-08-24 21:16:59.000000000","message":"Short of using oslo_log directly rather than python logging to avoid this sort of thing, this seems to be the best way for now. If the current file by report_path exists, it\u0027ll be deleted.","commit_id":"22d6b43e2b883a79ae80a420dc662f11c01259f3"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"f72e9d4acacb96c33e99550c8affbea60fac505e","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        full_test_dir \u003d os.path.join(base_path, test_dir)"},{"line_number":36,"context_line":"        return full_test_dir, base_path"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    @lockutils.synchronized(\u0027_reset_log_file\u0027)"},{"line_number":39,"context_line":"    def _reset_log_file(self, logfile):"},{"line_number":40,"context_line":"        try:"},{"line_number":41,"context_line":"            os.remove(logfile)"}],"source_content_type":"text/x-python","patch_set":26,"id":"7f287b81_a2b551cf","line":38,"range":{"start_line":38,"start_character":4,"end_line":38,"end_character":46},"updated":"2017-08-25 17:47:15.000000000","message":"After double checking, there isn\u0027t a form of this decorator that implements a barrier, so there is a possible edge case here. However, it\u0027s one that is unlikely to be hit, and writing the code to implement a barrier from threads we don\u0027t directly control is... a challenge. Depending on how Tempest runs this section, it might not be an issue if the plugin loading is followed by a barrier, but just wanted to mention that there is one edge case if no barriers exist between here and the tests running","commit_id":"29b109c356f98c4ed81bcf4d3cd5af0731486b4e"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"003a87cb61c8ee48a3ee6fa08db03ea26abc17b4","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        report_path \u003d os.path.join("},{"line_number":51,"context_line":"            report_abs_path, conf.patrole_log.report_log_name)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        if conf.patrole_log.enable_reporting:"},{"line_number":54,"context_line":"            self._reset_log_file(report_path)"},{"line_number":55,"context_line":"            # Delay\u003dTrue so that we don\u0027t end up creating an empty file if we"},{"line_number":56,"context_line":"            # never log to it."}],"source_content_type":"text/x-python","patch_set":28,"id":"7f287b81_9e0bcd22","line":53,"range":{"start_line":53,"start_character":8,"end_line":53,"end_character":45},"updated":"2017-08-25 22:38:03.000000000","message":"We could probably move this whole check to L78, no?","commit_id":"5fe172dafe86bc3d3b8812d86822085ac15c4152"}],"patrole_tempest_plugin/rbac_rule_validation.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"86f1b9fad00179b2c758f1094164bd1e2cfaabcf","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"_SUPPORTED_ERROR_CODES \u003d [403, 404]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"# Separate logger for just rbac reporting"},{"line_number":37,"context_line":"RBACLOG \u003d logging.getLogger(\u0027rbac_reporting\u0027)"},{"line_number":38,"context_line":"RBACLOG.setLevel(level\u003dlogging.INFO)"},{"line_number":39,"context_line":"rbac_report_handler \u003d logging.FileHandler(filename\u003dCONF.rbac.rbac_report_file)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_a006231f","line":36,"updated":"2017-08-15 16:05:44.000000000","message":"I think it\u0027d be better to move all of this logic into Patrole\u0027s config.py file as this sort of configuration setup belongs there.","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"86f1b9fad00179b2c758f1094164bd1e2cfaabcf","unresolved":false,"context_lines":[{"line_number":39,"context_line":"rbac_report_handler \u003d logging.FileHandler(filename\u003dCONF.rbac.rbac_report_file)"},{"line_number":40,"context_line":"rbac_report_handler.setFormatter(fmt\u003dlogging.Formatter(fmt\u003d\u0027%(message)s\u0027))"},{"line_number":41,"context_line":"RBACLOG.addHandler(rbac_report_handler)"},{"line_number":42,"context_line":"# TODO(spryor): It would be great to log a \u003cstarting test\u003e message here, to"},{"line_number":43,"context_line":"# help separate results per-run, but I couldn\u0027t find a good way to not have all"},{"line_number":44,"context_line":"# threads print it"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"def action(service, rule\u003d\u0027\u0027, admin_only\u003dFalse, expected_error_code\u003d403,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_632ba582","line":44,"range":{"start_line":42,"start_character":0,"end_line":44,"end_character":18},"updated":"2017-08-15 16:05:44.000000000","message":"Perhaps this might come in handy: https://github.com/openstack/tempest/blob/284d3112679d9970240e0bbea26b5d0281ee84a5/tempest/lib/common/utils/test_utils.py#L26\n\nI\u0027ve never used it, but at first glance it seems like it might do the trick.","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"86f1b9fad00179b2c758f1094164bd1e2cfaabcf","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            expected_exception, irregular_msg \u003d _get_exception_type("},{"line_number":99,"context_line":"                expected_error_code)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"            func_success \u003d \u0027Allowed\u0027"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"            try:"},{"line_number":104,"context_line":"                func(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_236fddc5","line":101,"range":{"start_line":101,"start_character":12,"end_line":101,"end_character":24},"updated":"2017-08-15 16:05:44.000000000","message":"How about \u0027Success\u0027 for test success, \u0027Failure\u0027 for test failure and \u0027Error\u0027 for an unknown error?","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"f81338096e7916a78b1b5006b623bb0bcb5c7b95","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            expected_exception, irregular_msg \u003d _get_exception_type("},{"line_number":99,"context_line":"                expected_error_code)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"            func_success \u003d \u0027Allowed\u0027"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"            try:"},{"line_number":104,"context_line":"                func(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_e310b559","line":101,"range":{"start_line":101,"start_character":12,"end_line":101,"end_character":24},"in_reply_to":"9f436f4f_236fddc5","updated":"2017-08-15 16:42:00.000000000","message":"That could work too, though I had thought the Allowed/Denied bit was a bit more descriptive as to what it\u0027s testing","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"29ee8cbed86e0f7f3e6536835f7ad49e75c61044","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            expected_exception, irregular_msg \u003d _get_exception_type("},{"line_number":99,"context_line":"                expected_error_code)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"            func_success \u003d \u0027Allowed\u0027"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"            try:"},{"line_number":104,"context_line":"                func(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_cc5a7981","line":101,"range":{"start_line":101,"start_character":12,"end_line":101,"end_character":24},"in_reply_to":"9f436f4f_e310b559","updated":"2017-08-15 21:45:42.000000000","message":"On second thought, \u0027Denied\u0027 is fine, though \u0027Permission Denied\u0027 or \u0027Forbidden\u0027 would be just as descriptive as well. Whatever you prefer.","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"ca056515f9275e5ec97e2d6b26db77ce8d25297d","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        reference nested BaseTestCase attributes"},{"line_number":170,"context_line":"    :returns: True if the current RBAC role can perform the policy action else"},{"line_number":171,"context_line":"        False"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    :raises RbacResourceSetupFailed: if project_id or user_id are missing from"},{"line_number":174,"context_line":"        the Tempest test object\u0027s `auth_provider`"},{"line_number":175,"context_line":"    :raises RbacParsingException: if ``CONF.rbac.strict_policy_check`` is"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_f6e871b3","line":172,"updated":"2017-08-15 16:40:29.000000000","message":"Forgot to mention that admin_only docstring should be copied from rbac_rule_validation and included here as well.","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"86f1b9fad00179b2c758f1094164bd1e2cfaabcf","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        disabled and the ``rule_name`` does not exist in the system"},{"line_number":179,"context_line":"    \"\"\""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    if CONF.rbac.rbac_print_summary_only:"},{"line_number":182,"context_line":"        # If print_summary_only is set, we don\u0027t want to"},{"line_number":183,"context_line":"        # throw over-permission errors"},{"line_number":184,"context_line":"        return True"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    if admin_only:"},{"line_number":187,"context_line":"        LOG.info(\"As admin_only is True, only admin role should be \""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_63d6052b","line":184,"range":{"start_line":181,"start_character":0,"end_line":184,"end_character":19},"updated":"2017-08-15 16:05:44.000000000","message":"I\u0027m not sure I understand what the purpose of this is. This is something I\u0027m strongly opposed to. We don\u0027t want to prevent over-permission errors from happening due to a configuration setting related to logging.\n\nIf you don\u0027t want to raise OverPermission errors, then the right way to do that would be to modify the logic around L136, but I still don\u0027t see the purpose in not wanting to raise the exception.","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"f81338096e7916a78b1b5006b623bb0bcb5c7b95","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        disabled and the ``rule_name`` does not exist in the system"},{"line_number":179,"context_line":"    \"\"\""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    if CONF.rbac.rbac_print_summary_only:"},{"line_number":182,"context_line":"        # If print_summary_only is set, we don\u0027t want to"},{"line_number":183,"context_line":"        # throw over-permission errors"},{"line_number":184,"context_line":"        return True"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    if admin_only:"},{"line_number":187,"context_line":"        LOG.info(\"As admin_only is True, only admin role should be \""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_d6156d41","line":184,"range":{"start_line":181,"start_character":0,"end_line":184,"end_character":19},"in_reply_to":"9f436f4f_63d6052b","updated":"2017-08-15 16:42:00.000000000","message":"Ah, so my reasoning behind this was just due to the current use case I had. I had been using patrole\u0027s tests to write a custom policy. It was useful for me to have just a readout of the capabilities that the user had, rather than checking them against something. I suppose it could also be done by specifying a custom policy with all allow or all deny, but that felt suboptimal to me\n\nIf you\u0027re still really strongly opposed, I can take this bit out or rework it","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"29ee8cbed86e0f7f3e6536835f7ad49e75c61044","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        disabled and the ``rule_name`` does not exist in the system"},{"line_number":179,"context_line":"    \"\"\""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    if CONF.rbac.rbac_print_summary_only:"},{"line_number":182,"context_line":"        # If print_summary_only is set, we don\u0027t want to"},{"line_number":183,"context_line":"        # throw over-permission errors"},{"line_number":184,"context_line":"        return True"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    if admin_only:"},{"line_number":187,"context_line":"        LOG.info(\"As admin_only is True, only admin role should be \""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_0cc1a1e5","line":184,"range":{"start_line":181,"start_character":0,"end_line":184,"end_character":19},"in_reply_to":"9f436f4f_d6156d41","updated":"2017-08-15 21:45:42.000000000","message":"Well, the issue with this code is that it\u0027ll hide legitimate conflicts/test bugs. For example, if I pass \"identity:delete_user\" to the rbac_rule_validation.action decorator but then call an API like `self.users_client.list_users()` then clearly this should result in an error. Because deleting a user is most likely an admin-only action and yet the test is listing users which is mostly likely an \"anyone can do this\" action. In other words, if `CONF.rbac.rbac_print_summary_only` is True, then buggy or badly written tests will silently pass when they should in fact fail.","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"86f1b9fad00179b2c758f1094164bd1e2cfaabcf","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        # throw over-permission errors"},{"line_number":184,"context_line":"        return True"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    if admin_only:"},{"line_number":187,"context_line":"        LOG.info(\"As admin_only is True, only admin role should be \""},{"line_number":188,"context_line":"                 \"allowed to perform the API. Skipping oslo.policy \""},{"line_number":189,"context_line":"                 \"check for policy action {0}.\".format(rule_name))"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_e3c8b5a6","line":186,"updated":"2017-08-15 16:05:44.000000000","message":"I think it\u0027s a goo idea to move this chunk of code down here.","commit_id":"bf698aa1a8c8d5ea8103c7cd1321b81546641159"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"1e7fa02c4a11e01f17f0eb5a7d1d9d498b919810","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"_SUPPORTED_ERROR_CODES \u003d [403, 404]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"# Separate logger for just rbac reporting"},{"line_number":37,"context_line":"RBACLOG \u003d logging.getLogger(\u0027rbac_reporting\u0027)"},{"line_number":38,"context_line":"RBACLOG.setLevel(level\u003dlogging.INFO)"},{"line_number":39,"context_line":"rbac_report_handler \u003d logging.FileHandler("}],"source_content_type":"text/x-python","patch_set":6,"id":"9f436f4f_cf6a7018","line":36,"updated":"2017-08-15 19:34:33.000000000","message":"So yeah, moving this into config.py caused tox to throw a TON of errors related to being unable to parse options... Uh... any other ideas on where to put it?","commit_id":"8a160fe11b5c8bf840b7b8ba8c178ef5d1b54091"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"7941c51aee841f79dbc77241e58b599bff067f06","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"_SUPPORTED_ERROR_CODES \u003d [403, 404]"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"# Separate logger for just rbac reporting"},{"line_number":37,"context_line":"RBACLOG \u003d logging.getLogger(\u0027rbac_reporting\u0027)"},{"line_number":38,"context_line":"RBACLOG.setLevel(level\u003dlogging.INFO)"},{"line_number":39,"context_line":"rbac_report_handler \u003d logging.FileHandler("}],"source_content_type":"text/x-python","patch_set":6,"id":"9f436f4f_ef652fb6","line":36,"in_reply_to":"9f436f4f_cf6a7018","updated":"2017-08-15 22:07:49.000000000","message":"https://pastebin.com/4PAuAVYY","commit_id":"8a160fe11b5c8bf840b7b8ba8c178ef5d1b54091"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"1e7fa02c4a11e01f17f0eb5a7d1d9d498b919810","unresolved":false,"context_lines":[{"line_number":99,"context_line":"            expected_exception, irregular_msg \u003d _get_exception_type("},{"line_number":100,"context_line":"                expected_error_code)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"            func_success \u003d \u0027Allowed\u0027"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"            try:"},{"line_number":105,"context_line":"                func(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f436f4f_efdd34e0","line":102,"updated":"2017-08-15 19:34:33.000000000","message":"(copying forward)\n\nChanging to Success/Failed as messages to the user could work, though I had thought the Allowed/Denied bit was a bit more descriptive as to what outcome it\u0027s testing. Maybe I just need to change the variable name?","commit_id":"8a160fe11b5c8bf840b7b8ba8c178ef5d1b54091"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"1e7fa02c4a11e01f17f0eb5a7d1d9d498b919810","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        disabled and the ``rule_name`` does not exist in the system"},{"line_number":184,"context_line":"    \"\"\""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    if CONF.patrole_log.print_summary_only:"},{"line_number":187,"context_line":"        # If print_summary_only is set, we don\u0027t want to"},{"line_number":188,"context_line":"        # throw over-permission errors"},{"line_number":189,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":6,"id":"9f436f4f_4fcd602f","line":186,"updated":"2017-08-15 19:34:33.000000000","message":"(copying this forward)\nSo my reasoning behind this was just due to the current use case I had. I had been using patrole\u0027s tests to write a custom policy. It was useful for me to have just a readout of the capabilities that the user had, rather than checking them against something. I suppose it could also be done by specifying a custom policy with all allow or all deny, but that felt suboptimal to me\nIf you\u0027re still really strongly opposed, I can take this bit out or rework it","commit_id":"8a160fe11b5c8bf840b7b8ba8c178ef5d1b54091"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"fa5143a781976d61023506221963994af7bc34d8","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            expected_exception, irregular_msg \u003d _get_exception_type("},{"line_number":91,"context_line":"                expected_error_code)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"            func_success \u003d \u0027Allowed\u0027"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"            try:"},{"line_number":96,"context_line":"                func(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_23011007","line":93,"range":{"start_line":93,"start_character":12,"end_line":93,"end_character":24},"updated":"2017-08-16 03:18:47.000000000","message":"Calling this \"test_status\" would be clearer.","commit_id":"a7b893d5d833a6491cec911d5185c6d1f932d9c8"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"fa5143a781976d61023506221963994af7bc34d8","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            func_success \u003d \u0027Allowed\u0027"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"            try:"},{"line_number":96,"context_line":"                func(*args, **kwargs)"},{"line_number":97,"context_line":"            except rbac_exceptions.RbacInvalidService as e:"},{"line_number":98,"context_line":"                msg \u003d (\"%s is not a valid service.\" % service)"},{"line_number":99,"context_line":"                func_success \u003d (\u0027Error, %s\u0027 % (msg))"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_fe015b06","line":96,"range":{"start_line":96,"start_character":16,"end_line":96,"end_character":20},"updated":"2017-08-16 03:18:47.000000000","message":"This, in turn, could be renamed to test_func.","commit_id":"a7b893d5d833a6491cec911d5185c6d1f932d9c8"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"0ed3bc75fdcce01422abb8453a58e020f324e153","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                            \"[Service]: %-12s, [Function]: %-30s, \""},{"line_number":138,"context_line":"                            \"[Rule]: %-50s, [Result]: %-6s\","},{"line_number":139,"context_line":"                            service, func.__name__, rule,"},{"line_number":140,"context_line":"                            func_success)"},{"line_number":141,"context_line":"                    else:"},{"line_number":142,"context_line":"                        RBACLOG.info("},{"line_number":143,"context_line":"                            \"[Service]: %-12s, [Function]: %-30s, \""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_5edaa777","line":140,"range":{"start_line":140,"start_character":28,"end_line":140,"end_character":40},"updated":"2017-08-16 03:23:16.000000000","message":"If this is set to ``allowed`` rather than ``func_success`` then L96 could be changed to:\n\nif not CONF.patrole_log.print_summary_only:\n    test_func(*args, **kwargs)\nelse:\n    LOG.info(\"Skipping the tests because doing dry run in order to generate summary log report to %s.\", \u003cthe location of the report log\u003e)","commit_id":"a7b893d5d833a6491cec911d5185c6d1f932d9c8"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"dac9562efe2aa001abeda1f7f0d92ac09ec742d3","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                                                toggle_rbac_role\u003dFalse)"},{"line_number":134,"context_line":"                if CONF.patrole_log.enable_reporting:"},{"line_number":135,"context_line":"                    RBACLOG.info("},{"line_number":136,"context_line":"                        \"[Service]: %-12s, [Function]: %-30s, \""},{"line_number":137,"context_line":"                        \"[Rule]: %-50s, [Expected]: %-6s, \""},{"line_number":138,"context_line":"                        \"[Actual]: %-6s\","},{"line_number":139,"context_line":"                        service, test_func.__name__, rule,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_cc8c7e81","line":136,"range":{"start_line":136,"start_character":44,"end_line":136,"end_character":52},"updated":"2017-08-17 21:31:23.000000000","message":"\"Test\" would make more sense here.","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"dac9562efe2aa001abeda1f7f0d92ac09ec742d3","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                        \"[Actual]: %-6s\","},{"line_number":139,"context_line":"                        service, test_func.__name__, rule,"},{"line_number":140,"context_line":"                        \"Allowed\" if allowed else \"Denied\","},{"line_number":141,"context_line":"                        test_status)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        _wrapper \u003d testtools.testcase.attr(role)(wrapper)"},{"line_number":144,"context_line":"        return _wrapper"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_a7e71547","line":141,"updated":"2017-08-17 21:31:23.000000000","message":"Not sure if the best way to present this data is tabular since the columns move around when I ran this across many tests. One issue is that test_func.__name__ isn\u0027t ideal because some tests share the same name across different files and packages.\n\nAnother possible way to present this data is:\n\ntest_update_user (patrole_tempest_plugin.tests.api.identity.v3.test_users_rbac) ... ok\nRule: {rule_name}, Expected: Allowed, Actual: Allowed\ntest_update_group (patrole_tempest_plugin.tests.api.identity.v3.test_groups_rbac) ... FAILED\nRule: {rule_name}, Expected: Allowed, Actual: Denied\n\nThe service name can then be gleaned from the package path. And to derive the package path you can use test_func.__module__. Unfortunately, I don\u0027t think there\u0027s a way to grab the test_func\u0027s class name from here.","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"25c5ab89ae161d46c737ad83d43fd9324857f21e","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                        \"[Actual]: %-6s\","},{"line_number":139,"context_line":"                        service, test_func.__name__, rule,"},{"line_number":140,"context_line":"                        \"Allowed\" if allowed else \"Denied\","},{"line_number":141,"context_line":"                        test_status)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        _wrapper \u003d testtools.testcase.attr(role)(wrapper)"},{"line_number":144,"context_line":"        return _wrapper"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_e3dbac7a","line":141,"in_reply_to":"9f436f4f_437a7888","updated":"2017-08-18 19:59:03.000000000","message":"Yeah, for formatting it, I had been using column -t (and thinking on it, that\u0027s probably a preferable way anyway to let users handle that bit). I totally see the value of giving part of the module path, I just gotta chew on the idea a little bit for the implementation","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"da11d747d680bf90af6e0ad17576d2b23d93a77f","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                        \"[Actual]: %-6s\","},{"line_number":139,"context_line":"                        service, test_func.__name__, rule,"},{"line_number":140,"context_line":"                        \"Allowed\" if allowed else \"Denied\","},{"line_number":141,"context_line":"                        test_status)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        _wrapper \u003d testtools.testcase.attr(role)(wrapper)"},{"line_number":144,"context_line":"        return _wrapper"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_437a7888","line":141,"in_reply_to":"9f436f4f_8055f61f","updated":"2017-08-18 19:51:47.000000000","message":"It was just a suggestion, frankly all that matters is the data, formatting is a smaller detail.","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"d9db0f8013c828114fa1621ba4b8386e1eff58a6","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                        \"[Actual]: %-6s\","},{"line_number":139,"context_line":"                        service, test_func.__name__, rule,"},{"line_number":140,"context_line":"                        \"Allowed\" if allowed else \"Denied\","},{"line_number":141,"context_line":"                        test_status)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        _wrapper \u003d testtools.testcase.attr(role)(wrapper)"},{"line_number":144,"context_line":"        return _wrapper"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_8055f61f","line":141,"in_reply_to":"9f436f4f_a7e71547","updated":"2017-08-18 19:41:49.000000000","message":"Hmmm, I\u0027m not totally sold on that, that seems to add some level of messiness, maybe some partial package path, if we could do like identity.v3.test_update_group, that I feel would be way cleaner","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"}],"patrole_tempest_plugin/tests/unit/test_rbac_rule_validation.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def setUp(self):"},{"line_number":31,"context_line":"        super(RBACRuleValidationTest, self).setUp()"},{"line_number":32,"context_line":"        self.mock_args \u003d mock.Mock(spec\u003dtest.BaseTestCase, __name__\u003d\u0027foo\u0027)"},{"line_number":33,"context_line":"        self.mock_args.os_primary \u003d mock.Mock(__name__\u003d\u0027foo\u0027)"},{"line_number":34,"context_line":"        self.mock_args.rbac_utils \u003d mock.Mock(__name__\u003d\u0027foo\u0027)"},{"line_number":35,"context_line":"        self.mock_args.os_primary.credentials.project_id \u003d \\"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_6e448174","line":32,"range":{"start_line":32,"start_character":59,"end_line":32,"end_character":73},"updated":"2017-08-17 02:01:31.000000000","message":"nit: Not needed here.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    def setUp(self):"},{"line_number":31,"context_line":"        super(RBACRuleValidationTest, self).setUp()"},{"line_number":32,"context_line":"        self.mock_args \u003d mock.Mock(spec\u003dtest.BaseTestCase, __name__\u003d\u0027foo\u0027)"},{"line_number":33,"context_line":"        self.mock_args.os_primary \u003d mock.Mock(__name__\u003d\u0027foo\u0027)"},{"line_number":34,"context_line":"        self.mock_args.rbac_utils \u003d mock.Mock(__name__\u003d\u0027foo\u0027)"},{"line_number":35,"context_line":"        self.mock_args.os_primary.credentials.project_id \u003d \\"},{"line_number":36,"context_line":"            mock.sentinel.project_id"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_4e477d78","line":33,"range":{"start_line":33,"start_character":46,"end_line":33,"end_character":60},"updated":"2017-08-17 02:01:31.000000000","message":"Ditto.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        super(RBACRuleValidationTest, self).setUp()"},{"line_number":32,"context_line":"        self.mock_args \u003d mock.Mock(spec\u003dtest.BaseTestCase, __name__\u003d\u0027foo\u0027)"},{"line_number":33,"context_line":"        self.mock_args.os_primary \u003d mock.Mock(__name__\u003d\u0027foo\u0027)"},{"line_number":34,"context_line":"        self.mock_args.rbac_utils \u003d mock.Mock(__name__\u003d\u0027foo\u0027)"},{"line_number":35,"context_line":"        self.mock_args.os_primary.credentials.project_id \u003d \\"},{"line_number":36,"context_line":"            mock.sentinel.project_id"},{"line_number":37,"context_line":"        self.mock_args.os_primary.credentials.user_id \u003d \\"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_2e62f90a","line":34,"range":{"start_line":34,"start_character":46,"end_line":34,"end_character":60},"updated":"2017-08-17 02:01:31.000000000","message":"Ditto.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        CONF.set_override(\u0027rbac_test_role\u0027, \u0027Member\u0027, group\u003d\u0027patrole\u0027)"},{"line_number":41,"context_line":"        self.addCleanup(CONF.clear_override, \u0027rbac_test_role\u0027, group\u003d\u0027patrole\u0027)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    @mock.patch.object(rbac_rv, \u0027RBACLOG\u0027, autospec\u003dTrue)"},{"line_number":44,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":45,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"},{"line_number":46,"context_line":"    def test_rule_validation_have_permission_no_exc(self, mock_policy,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_ae4ee993","line":43,"range":{"start_line":43,"start_character":4,"end_line":43,"end_character":57},"updated":"2017-08-17 02:01:31.000000000","message":"Is this really necessary? Shouldn\u0027t need this unless not mocking this results in an error.\n\nIf this is needed, I think we should do this instead inside setUp:\n\n    self.mock_rbaclog \u003d mock.patch.object(rbac_rv, \u0027RBACLOG\u0027, autospec\u003dTrue).start()\n\nSo that we only need to mock it in one place. Then you can use it on L420/L443 as self.mock_rbaclog.called for example.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            mock_log.error.reset_mock()"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":"    @mock.patch.object(rbac_rv, \u0027RBACLOG\u0027, autospec\u003dTrue)"},{"line_number":400,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":401,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"},{"line_number":402,"context_line":"    def test_rbac_report_logging_disabled("},{"line_number":403,"context_line":"            self, mock_policy, mock_log, mock_rbaclog):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_4e6e5d00","line":400,"range":{"start_line":400,"start_character":4,"end_line":400,"end_character":53},"updated":"2017-08-17 02:01:31.000000000","message":"Unused, so should remove.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":400,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":401,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"},{"line_number":402,"context_line":"    def test_rbac_report_logging_disabled("},{"line_number":403,"context_line":"            self, mock_policy, mock_log, mock_rbaclog):"},{"line_number":404,"context_line":"        \"\"\"Test case to ensure that we DON\u0027T write logs when"},{"line_number":405,"context_line":"        enable_reporting is False"},{"line_number":406,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_2e79d9c6","line":403,"range":{"start_line":403,"start_character":31,"end_line":403,"end_character":39},"updated":"2017-08-17 02:01:31.000000000","message":"Unused, so should remove.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"        result \u003d wrapper(self.mock_args)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"        self.assertIsNone(result)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        self.assertEqual(False, mock_rbaclog.info.called)"},{"line_number":421,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_2e067953","line":418,"range":{"start_line":418,"start_character":8,"end_line":418,"end_character":33},"updated":"2017-08-17 02:01:31.000000000","message":"nit: This assertion isn\u0027t needed as we\u0027re just testing that the mock function was called.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":417,"context_line":""},{"line_number":418,"context_line":"        self.assertIsNone(result)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        self.assertEqual(False, mock_rbaclog.info.called)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    @mock.patch.object(rbac_rv, \u0027RBACLOG\u0027, autospec\u003dTrue)"},{"line_number":423,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_cef6cd5d","line":420,"range":{"start_line":420,"start_character":8,"end_line":420,"end_character":57},"updated":"2017-08-17 02:01:31.000000000","message":"Either:\n\n    self.assertFalse(mock_rbaclog.info.called)\n\nOr:\n\n    mock_rbaclog.info.assert_not_called() # If this is defined, which I believe it is","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        self.assertEqual(False, mock_rbaclog.info.called)"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"    @mock.patch.object(rbac_rv, \u0027RBACLOG\u0027, autospec\u003dTrue)"},{"line_number":423,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":424,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"},{"line_number":425,"context_line":"    def test_rbac_report_logging_enabled("},{"line_number":426,"context_line":"            self, mock_policy, mock_log, mock_rbaclog):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_ae65c91f","line":423,"range":{"start_line":423,"start_character":3,"end_line":423,"end_character":53},"updated":"2017-08-17 02:01:31.000000000","message":"Unused, so should remove.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":423,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":424,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"},{"line_number":425,"context_line":"    def test_rbac_report_logging_enabled("},{"line_number":426,"context_line":"            self, mock_policy, mock_log, mock_rbaclog):"},{"line_number":427,"context_line":"        \"\"\"Test case to ensure that we DO write logs when"},{"line_number":428,"context_line":"        enable_reporting is True"},{"line_number":429,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_8e68c5f4","line":426,"range":{"start_line":426,"start_character":31,"end_line":426,"end_character":39},"updated":"2017-08-17 02:01:31.000000000","message":"Unused, so should remove.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        result \u003d wrapper(self.mock_args)"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        self.assertIsNone(result)"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        self.assertEqual(True, mock_rbaclog.info.called)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_6e9da108","line":441,"range":{"start_line":441,"start_character":7,"end_line":441,"end_character":33},"updated":"2017-08-17 02:01:31.000000000","message":"Ditto.","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"89aa0ac94db769256b8276062b4eef15a201381e","unresolved":false,"context_lines":[{"line_number":440,"context_line":""},{"line_number":441,"context_line":"        self.assertIsNone(result)"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        self.assertEqual(True, mock_rbaclog.info.called)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9f436f4f_6eb6c18c","line":443,"range":{"start_line":443,"start_character":8,"end_line":443,"end_character":56},"updated":"2017-08-17 02:01:31.000000000","message":"Better to do:\n\n    mock_rbaclog.info.assert_called_once_with(\n                        \"[Service]: %-12s, [Function]: %-30s, \"\n                        \"[Rule]: %-50s, [Expected]: %-6s, \"\n                        \"[Actual]: %-6s\",\n                        mock.sentinel.service, \u0027foo-log\u0027, \n                        mock.sentinel.action,\n                        \"Allowed\",\n                        \"Allowed\")","commit_id":"6991ccb53a3db5c7f4d946f362485ff9bd4d76a4"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"09faba0f8c2b1159d7a729a6024ecf723cb2dc7a","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.addCleanup(CONF.clear_override, \u0027rbac_test_role\u0027, group\u003d\u0027patrole\u0027)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self.mock_rbaclog \u003d mock.patch.object("},{"line_number":44,"context_line":"            rbac_rv.RBACLOG, \u0027info\u0027, autospec\u003dFalse).start()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":47,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_1e5ab129","line":44,"updated":"2017-08-17 15:11:45.000000000","message":"So, autospec\u003dTrue gave me a ton of issues, but autospec\u003dFalse worked well, and let it absorb all the messages anyway","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"da11d747d680bf90af6e0ad17576d2b23d93a77f","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.addCleanup(CONF.clear_override, \u0027rbac_test_role\u0027, group\u003d\u0027patrole\u0027)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self.mock_rbaclog \u003d mock.patch.object("},{"line_number":44,"context_line":"            rbac_rv.RBACLOG, \u0027info\u0027, autospec\u003dFalse).start()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":47,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_23565408","line":44,"in_reply_to":"9f436f4f_004a267f","updated":"2017-08-18 19:51:47.000000000","message":"Yeah, makes sense. Didn\u0027t check that.","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"dac9562efe2aa001abeda1f7f0d92ac09ec742d3","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.addCleanup(CONF.clear_override, \u0027rbac_test_role\u0027, group\u003d\u0027patrole\u0027)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self.mock_rbaclog \u003d mock.patch.object("},{"line_number":44,"context_line":"            rbac_rv.RBACLOG, \u0027info\u0027, autospec\u003dFalse).start()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":47,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_ecb6223f","line":44,"in_reply_to":"9f436f4f_1e5ab129","updated":"2017-08-17 21:31:23.000000000","message":"In that case, L43-44 can be removed outright. Tests will work fine without them.","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"d9db0f8013c828114fa1621ba4b8386e1eff58a6","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.addCleanup(CONF.clear_override, \u0027rbac_test_role\u0027, group\u003d\u0027patrole\u0027)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        self.mock_rbaclog \u003d mock.patch.object("},{"line_number":44,"context_line":"            rbac_rv.RBACLOG, \u0027info\u0027, autospec\u003dFalse).start()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @mock.patch.object(rbac_rv, \u0027LOG\u0027, autospec\u003dTrue)"},{"line_number":47,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_004a267f","line":44,"in_reply_to":"9f436f4f_ecb6223f","updated":"2017-08-18 19:41:49.000000000","message":"So, if there\u0027s no RBACLOG mock variable, it\u0027ll instead log the results out directly, which doesn\u0027t leave the execution clean","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"09faba0f8c2b1159d7a729a6024ecf723cb2dc7a","unresolved":false,"context_lines":[{"line_number":383,"context_line":""},{"line_number":384,"context_line":"            mock_log.error.reset_mock()"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    @mock.patch.object(rbac_rv, \u0027RBACLOG\u0027, autospec\u003dTrue)"},{"line_number":387,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"},{"line_number":388,"context_line":"    def test_rbac_report_logging_disabled(self, mock_policy, mock_rbaclog):"},{"line_number":389,"context_line":"        \"\"\"Test case to ensure that we DON\u0027T write logs when"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_fe3ecdb7","line":386,"updated":"2017-08-17 15:11:45.000000000","message":"Added this back in, since it works here but not above","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"09faba0f8c2b1159d7a729a6024ecf723cb2dc7a","unresolved":false,"context_lines":[{"line_number":400,"context_line":""},{"line_number":401,"context_line":"        wrapper(self.mock_args)"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"        self.assertFalse(mock_rbaclog.info.called)"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"    @mock.patch.object(rbac_rv, \u0027RBACLOG\u0027, autospec\u003dTrue)"},{"line_number":406,"context_line":"    @mock.patch.object(rbac_rv, \u0027rbac_policy_parser\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f436f4f_3e7c5571","line":403,"updated":"2017-08-17 15:11:45.000000000","message":"assert_not_called didn\u0027t seem to work, but this seems to work well","commit_id":"3a726fa18c0560e4619c908e73b5ce7fdb36357f"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        mock_function.side_effect \u003d exceptions.Forbidden(\u0027Random message.\u0027)"},{"line_number":221,"context_line":"        wrapper \u003d decorator(mock_function)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        expected_error \u003d \"An unexpected \"\\"},{"line_number":224,"context_line":"                         \"exception has occurred during test: foo, \"\\"},{"line_number":225,"context_line":"                         \"Exception was: Forbidden\\nDetails: Random message.\""},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        for permission in [True, False]:"},{"line_number":228,"context_line":"            mock_policy.RbacPolicyParser.return_value.allowed.return_value \u003d\\"}],"source_content_type":"text/x-python","patch_set":17,"id":"9f436f4f_1a2f26f7","line":225,"range":{"start_line":223,"start_character":25,"end_line":225,"end_character":77},"updated":"2017-08-20 02:17:58.000000000","message":"nit: This can probably be done across 2 lines if refactored.","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        \"\"\"Test case to ensure that we DON\u0027T write logs when"},{"line_number":390,"context_line":"        enable_reporting is False"},{"line_number":391,"context_line":"        \"\"\""},{"line_number":392,"context_line":"        CONF.set_override(\u0027enable_reporting\u0027, False, group\u003d\u0027patrole_log\u0027)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        decorator \u003d rbac_rv.action(mock.sentinel.service, mock.sentinel.action)"},{"line_number":395,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9f436f4f_ba3dba2d","line":392,"range":{"start_line":392,"start_character":8,"end_line":392,"end_character":73},"updated":"2017-08-20 02:17:58.000000000","message":"nit: self.useFixture(fixtures.ConfPatcher(enable_reporting\u003dTrue, group\u003d\u0027patrole_log\u0027))\n\n(It clears the override during tearDown.)","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"dd4ea4c1628c3abedf5fb41eb00415b5bfe39ebc","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        \"\"\"Test case to ensure that we DON\u0027T write logs when"},{"line_number":390,"context_line":"        enable_reporting is False"},{"line_number":391,"context_line":"        \"\"\""},{"line_number":392,"context_line":"        CONF.set_override(\u0027enable_reporting\u0027, False, group\u003d\u0027patrole_log\u0027)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        decorator \u003d rbac_rv.action(mock.sentinel.service, mock.sentinel.action)"},{"line_number":395,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9f436f4f_8efce1b5","line":392,"range":{"start_line":392,"start_character":8,"end_line":392,"end_character":73},"in_reply_to":"9f436f4f_ae1b2571","updated":"2017-08-21 16:16:34.000000000","message":"It\u0027s in patrole_tempest_plugin.tests.unit.fixtures I think. It just needs to be imported.\n\nBut we can do that in a follow-up commit. I intend on eventually cleaning up these unit tests anyway, i.e. to do things like:\n\n    def test_foo(self):\n        @rbac_rule_validation.action(...)\n        def test_thingy():\n            raise BadError\n    # do assertions","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":25100,"name":"Sean Pryor","email":"spryor@redhat.com","username":"Xaenalt"},"change_message_id":"da1ba14db470cfda65946bad512c58f8f8f202c0","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        \"\"\"Test case to ensure that we DON\u0027T write logs when"},{"line_number":390,"context_line":"        enable_reporting is False"},{"line_number":391,"context_line":"        \"\"\""},{"line_number":392,"context_line":"        CONF.set_override(\u0027enable_reporting\u0027, False, group\u003d\u0027patrole_log\u0027)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        decorator \u003d rbac_rv.action(mock.sentinel.service, mock.sentinel.action)"},{"line_number":395,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9f436f4f_ae1b2571","line":392,"range":{"start_line":392,"start_character":8,"end_line":392,"end_character":73},"in_reply_to":"9f436f4f_ba3dba2d","updated":"2017-08-21 16:07:04.000000000","message":"Name fixtures is undefined currently. I\u0027m guessing there\u0027s a commit that adds using that for CONF patching. For now I just added a cleanup to clear the override","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":408,"context_line":"        \"\"\"Test case to ensure that we DO write logs when"},{"line_number":409,"context_line":"        enable_reporting is True"},{"line_number":410,"context_line":"        \"\"\""},{"line_number":411,"context_line":"        CONF.set_override(\u0027enable_reporting\u0027, True, group\u003d\u0027patrole_log\u0027)"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"        decorator \u003d rbac_rv.action(mock.sentinel.service, mock.sentinel.action)"},{"line_number":414,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9f436f4f_da387e3e","line":411,"range":{"start_line":411,"start_character":8,"end_line":411,"end_character":25},"updated":"2017-08-20 02:17:58.000000000","message":"nit: self.useFixture(fixtures.ConfPatcher(enable_reporting\u003dTrue, group\u003d\u0027patrole_log\u0027))","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"}],"releasenotes/notes/rbac-per-test-log-071a530e957c1c26.yaml":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Added in a new logging feature which logs the result of each Patrole test"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    The format of the new log output is:"},{"line_number":7,"context_line":"      \"[Service]: %s, [Function]: %s, [Rule]: %s, [Expected]: %s, [Actual]: %s,\""},{"line_number":8,"context_line":"      where each \"%s\" is a string that contains:"},{"line_number":9,"context_line":"      * [Service] - The openstack service being tested (Nova, Neutron, etc)"},{"line_number":10,"context_line":"      * [Function] - The name of the test function being invoked (eg: test_list_aggregate_rbac)"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f436f4f_7a4752be","line":7,"range":{"start_line":7,"start_character":23,"end_line":7,"end_character":31},"updated":"2017-08-20 02:17:58.000000000","message":"Test","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    The format of the new log output is:"},{"line_number":7,"context_line":"      \"[Service]: %s, [Function]: %s, [Rule]: %s, [Expected]: %s, [Actual]: %s,\""},{"line_number":8,"context_line":"      where each \"%s\" is a string that contains:"},{"line_number":9,"context_line":"      * [Service] - The openstack service being tested (Nova, Neutron, etc)"},{"line_number":10,"context_line":"      * [Function] - The name of the test function being invoked (eg: test_list_aggregate_rbac)"},{"line_number":11,"context_line":"      * [Rule] - The name of the rule the Patrole test is testing (eg: os_compute_api:os-aggregates)"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f436f4f_da119eae","line":8,"updated":"2017-08-20 02:17:58.000000000","message":"Need a newline after this to format the bullet points below correctly in http://docs-draft.openstack.org/18/493618/17/check/gate-patrole-releasenotes/78725d7//releasenotes/build/html/unreleased.html","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":9,"context_line":"      * [Service] - The openstack service being tested (Nova, Neutron, etc)"},{"line_number":10,"context_line":"      * [Function] - The name of the test function being invoked (eg: test_list_aggregate_rbac)"},{"line_number":11,"context_line":"      * [Rule] - The name of the rule the Patrole test is testing (eg: os_compute_api:os-aggregates)"},{"line_number":12,"context_line":"      * [Expected] - The expected outcome as given by oslo.policy (one of Allowed/Denied)"},{"line_number":13,"context_line":"      * [Actual] - The actual outcome from the Patrole test (one of Allowed/Denied/Error)"},{"line_number":14,"context_line":"      * - In the case where an error occurs, a small summary will be printed in the log following"},{"line_number":15,"context_line":"      *   the word Error"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f436f4f_5a448eb7","line":12,"range":{"start_line":12,"start_character":21,"end_line":12,"end_character":65},"updated":"2017-08-20 02:17:58.000000000","message":"The expected test outcome\n\n(We recently added another way to determine the expected value)","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":11,"context_line":"      * [Rule] - The name of the rule the Patrole test is testing (eg: os_compute_api:os-aggregates)"},{"line_number":12,"context_line":"      * [Expected] - The expected outcome as given by oslo.policy (one of Allowed/Denied)"},{"line_number":13,"context_line":"      * [Actual] - The actual outcome from the Patrole test (one of Allowed/Denied/Error)"},{"line_number":14,"context_line":"      * - In the case where an error occurs, a small summary will be printed in the log following"},{"line_number":15,"context_line":"      *   the word Error"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"    This logging feature has two config variables:"},{"line_number":18,"context_line":"      - enable_reporting:"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f436f4f_ba26da15","line":15,"range":{"start_line":14,"start_character":6,"end_line":15,"end_character":24},"updated":"2017-08-20 02:17:58.000000000","message":"I don\u0027t think this much detail is needed here.","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":14,"context_line":"      * - In the case where an error occurs, a small summary will be printed in the log following"},{"line_number":15,"context_line":"      *   the word Error"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"    This logging feature has two config variables:"},{"line_number":18,"context_line":"      - enable_reporting:"},{"line_number":19,"context_line":"          This enables or disables the enhanced rbac reporting"},{"line_number":20,"context_line":"      - report_log_name:"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f436f4f_3a78aaf6","line":17,"updated":"2017-08-20 02:17:58.000000000","message":"Need a newline here as well","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":15,"context_line":"      *   the word Error"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"    This logging feature has two config variables:"},{"line_number":18,"context_line":"      - enable_reporting:"},{"line_number":19,"context_line":"          This enables or disables the enhanced rbac reporting"},{"line_number":20,"context_line":"      - report_log_name:"},{"line_number":21,"context_line":"          This variable specifies the relative location of the log file to write"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f436f4f_7a2072f8","line":18,"range":{"start_line":18,"start_character":6,"end_line":18,"end_character":7},"updated":"2017-08-20 02:17:58.000000000","message":"s/-/*\n\nto be consistent with above","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    This logging feature has two config variables:"},{"line_number":18,"context_line":"      - enable_reporting:"},{"line_number":19,"context_line":"          This enables or disables the enhanced rbac reporting"},{"line_number":20,"context_line":"      - report_log_name:"},{"line_number":21,"context_line":"          This variable specifies the relative location of the log file to write"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    These variables are part of a new config group patrole_log"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f436f4f_5a1daebb","line":20,"range":{"start_line":20,"start_character":6,"end_line":20,"end_character":7},"updated":"2017-08-20 02:17:58.000000000","message":"Ditto","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":18,"context_line":"      - enable_reporting:"},{"line_number":19,"context_line":"          This enables or disables the enhanced rbac reporting"},{"line_number":20,"context_line":"      - report_log_name:"},{"line_number":21,"context_line":"          This variable specifies the relative location of the log file to write"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    These variables are part of a new config group patrole_log"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f436f4f_9a3af631","line":21,"range":{"start_line":21,"start_character":10,"end_line":21,"end_character":80},"updated":"2017-08-20 02:17:58.000000000","message":"This variable specifies the log name","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"d1b8b707ddc800aa491700a006a8067c7e60b353","unresolved":false,"context_lines":[{"line_number":20,"context_line":"      - report_log_name:"},{"line_number":21,"context_line":"          This variable specifies the relative location of the log file to write"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    These variables are part of a new config group patrole_log"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"9f436f4f_1a7de6e6","line":23,"range":{"start_line":23,"start_character":51,"end_line":23,"end_character":62},"updated":"2017-08-20 02:17:58.000000000","message":"``patrole_log``","commit_id":"fb9098f43c2848e7e892d83bbd7152aee7226c22"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"1a965ecc218f26d5f855c9477ed46930d16b8221","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Added in a new logging feature which logs the result of each Patrole test"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    The format of the new log output is:"},{"line_number":7,"context_line":"      "},{"line_number":8,"context_line":"      \"[Service]: %s, [Test]: %s, [Rule]: %s, [Expected]: %s, [Actual]: %s\""},{"line_number":9,"context_line":"      "},{"line_number":10,"context_line":"      where each \"%s\" is a string that contains:"}],"source_content_type":"text/x-yaml","patch_set":18,"id":"9f436f4f_4ed5d91a","line":7,"updated":"2017-08-21 16:18:16.000000000","message":"Various identation/spacing issues here might result in gate failure and should be cleaned up.","commit_id":"f5892ae5af36b9fb6a1645d060f3a9c4eb7639ba"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"354606d746eaab632488e32c70db2c5a78cace2c","unresolved":false,"context_lines":[{"line_number":22,"context_line":"      * enable_reporting:"},{"line_number":23,"context_line":"          This enables or disables the enhanced rbac reporting"},{"line_number":24,"context_line":"      * report_log_name:"},{"line_number":25,"context_line":"          This variable specifies the name of the log file to write"}],"source_content_type":"text/x-yaml","patch_set":24,"id":"7f287b81_ca4f72bb","line":25,"updated":"2017-08-24 21:16:59.000000000","message":"Need to add the file path config value here too.","commit_id":"22d6b43e2b883a79ae80a420dc662f11c01259f3"}],"releasenotes/notes/rbac-report-log-071a530e957c1c26.yaml":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"e4e127a4a37b49dace3e78bf9742b64a8856de42","unresolved":false,"context_lines":[{"line_number":7,"context_line":"      \"[Service]: %s, [Function]: %s, [Rule]: %s, [Expected]: %s, [Actual]: %s,\""},{"line_number":8,"context_line":"      where each \"%s\" is a string that contains:"},{"line_number":9,"context_line":"      * [Service] - The openstack service being tested (Nova, Neutron, etc)"},{"line_number":10,"context_line":"      * [Function] - The name of the test function being invoked ()"},{"line_number":11,"context_line":"      * [Rule] - The name of the rule the Patrole test is testing"},{"line_number":12,"context_line":"      * [Expected] - The expected outcome as given by oslo.policy (one of Allowed/Denied)"},{"line_number":13,"context_line":"      * [Actual] - The actual outcome from the Patrole test (one of Allowed/Denied/Error)"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"9f436f4f_0e2295b9","line":10,"range":{"start_line":10,"start_character":65,"end_line":10,"end_character":67},"updated":"2017-08-17 02:08:14.000000000","message":"nit: () doesn\u0027t convey anything, either provide example or remove","commit_id":"eec9762fbe4af4eae59957b82ee17e6e3d947ca0"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"e4e127a4a37b49dace3e78bf9742b64a8856de42","unresolved":false,"context_lines":[{"line_number":11,"context_line":"      * [Rule] - The name of the rule the Patrole test is testing"},{"line_number":12,"context_line":"      * [Expected] - The expected outcome as given by oslo.policy (one of Allowed/Denied)"},{"line_number":13,"context_line":"      * [Actual] - The actual outcome from the Patrole test (one of Allowed/Denied/Error)"},{"line_number":14,"context_line":"      * - In the case where an error occurs, a small summary will be printed in the log following the word Error"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"    This logging feature has two config variables:"},{"line_number":17,"context_line":"      - enable_reporting:"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"9f436f4f_ae1ca977","line":14,"updated":"2017-08-17 02:08:14.000000000","message":"Line length","commit_id":"eec9762fbe4af4eae59957b82ee17e6e3d947ca0"}]}
