)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":17896,"name":"Rick Bartra","email":"rickbartra@microsoft.com","username":"rb560u"},"change_message_id":"be75a442b997fb8366f738d0b678bd8ea0298224","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Improve test coverage for flavor_access nova policies"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit improves test coverage for flavor_access policies, achieving"},{"line_number":10,"context_line":"the the most amount of coverage in Patrole for these policies that is"},{"line_number":11,"context_line":"currently possible."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"The base policy \"os_compute_api:os-flavor-access\" is covered by"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"ff5d4b2f_1852c768","line":10,"range":{"start_line":10,"start_character":0,"end_line":10,"end_character":7},"updated":"2017-09-19 14:40:18.000000000","message":"nit","commit_id":"2466aeb15e0e08f66edfe81f4a90bf2094a51182"}],"patrole_tempest_plugin/tests/api/compute/test_flavor_access_rbac.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"e23cca3da0f3f799544e94aa95944dbf48e38f78","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        # NOTE: This also enforces other policies like"},{"line_number":70,"context_line":"        # os-flavor-manage:create which might result in test failure."},{"line_number":71,"context_line":"        try:"},{"line_number":72,"context_line":"            body \u003d self._create_flavor(**{\u0027os-flavor-access:is_public\u0027: True})"},{"line_number":73,"context_line":"        except lib_exc.Forbidden as e:"},{"line_number":74,"context_line":"            raise rbac_exceptions.RbacConflictingPolicies(e)"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_a38ee8cd","line":72,"range":{"start_line":72,"start_character":43,"end_line":72,"end_character":69},"updated":"2017-08-22 13:02:35.000000000","message":"use `expected_attr` here","commit_id":"508af9c38a60e6179e78e5026f1363b863a4e20e"},{"author":{"_account_id":23185,"name":"Samantha Blanco","email":"samantha.blanco@att.com","username":"sblanco"},"change_message_id":"20723b3770f352d7c192808f0cbaba8c45a68004","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    @rbac_rule_validation.action("},{"line_number":47,"context_line":"        service\u003d\"nova\","},{"line_number":48,"context_line":"        rule\u003d\"os_compute_api:os-flavor-access\")"},{"line_number":49,"context_line":"    def test_show_flavor_contains_is_public_key(self):"},{"line_number":50,"context_line":"        public_flavor_id \u003d CONF.compute.flavor_ref"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        self.rbac_utils.switch_role(self, toggle_rbac_role\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_d80850da","line":49,"updated":"2017-08-25 18:57:01.000000000","message":"I think the change to this is confusing and doesn\u0027t seem to accomplish anything new or more efficiently than the original show_flavor test.","commit_id":"405c9a272d9bca656d3729d5127b6ef637c2bd5a"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4a762b7fd20c78e8930cd97781616fb6022967ea","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    @rbac_rule_validation.action("},{"line_number":47,"context_line":"        service\u003d\"nova\","},{"line_number":48,"context_line":"        rule\u003d\"os_compute_api:os-flavor-access\")"},{"line_number":49,"context_line":"    def test_show_flavor_contains_is_public_key(self):"},{"line_number":50,"context_line":"        public_flavor_id \u003d CONF.compute.flavor_ref"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        self.rbac_utils.switch_role(self, toggle_rbac_role\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_c4ece52a","line":49,"in_reply_to":"7f287b81_d80850da","updated":"2017-08-25 21:58:33.000000000","message":"The changes below weren\u0027t made for efficiency reasons or anything like that. They were made because the original test was wrong.\n\nSo, while it is *true* that policy enforcement *does* happen regardless, Nova uses 2 types of policy enforcement that makes all the difference:\n\n1) Policy enforcement failure is fatal\n2) Policy enforcement failure is non-fatal\n\nThis is a case of non-fatal [0]. What that means is that Patrole side there\u0027s no way to verify whether the action failed or succeeded -- since an exception is never raised. Instead, if policy enforcement succeeds, then the `expected_attr` is injected into the response body. This is iterated by the policy docs [1] as well.\n\nSo this is really a bug fix (the test before would *always* pass). I will update commit message accordingly.\n\n[0] https://github.com/openstack/nova/blob/1080506f16905d16086974eb729ba3d204139566/nova/api/openstack/compute/flavor_access.py#L68\n[1] https://github.com/openstack/nova/blob/1080506f16905d16086974eb729ba3d204139566/nova/policies/flavor_access.py#L52","commit_id":"405c9a272d9bca656d3729d5127b6ef637c2bd5a"},{"author":{"_account_id":23185,"name":"Samantha Blanco","email":"samantha.blanco@att.com","username":"sblanco"},"change_message_id":"20723b3770f352d7c192808f0cbaba8c45a68004","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        body \u003d self.flavors_client.list_flavors(detail\u003dTrue)[\u0027flavors\u0027]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        expected_attr \u003d \u0027os-flavor-access:is_public\u0027"},{"line_number":70,"context_line":"        if expected_attr not in body[0]:"},{"line_number":71,"context_line":"            raise rbac_exceptions.RbacMalformedResponse("},{"line_number":72,"context_line":"                attribute\u003dexpected_attr)"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_18fed8ad","line":70,"updated":"2017-08-25 18:57:01.000000000","message":"I don\u0027t believe flavors are listed in the same order from machine to machine, so it\u0027s possible the flavor returned from body[0] could be private but that shouldn\u0027t mean the test fails.","commit_id":"405c9a272d9bca656d3729d5127b6ef637c2bd5a"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"4a762b7fd20c78e8930cd97781616fb6022967ea","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        body \u003d self.flavors_client.list_flavors(detail\u003dTrue)[\u0027flavors\u0027]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        expected_attr \u003d \u0027os-flavor-access:is_public\u0027"},{"line_number":70,"context_line":"        if expected_attr not in body[0]:"},{"line_number":71,"context_line":"            raise rbac_exceptions.RbacMalformedResponse("},{"line_number":72,"context_line":"                attribute\u003dexpected_attr)"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_a4f3190a","line":70,"in_reply_to":"7f287b81_18fed8ad","updated":"2017-08-25 21:58:33.000000000","message":"Nice catch, fixed in next patch.","commit_id":"405c9a272d9bca656d3729d5127b6ef637c2bd5a"},{"author":{"_account_id":23185,"name":"Samantha Blanco","email":"samantha.blanco@att.com","username":"sblanco"},"change_message_id":"0959236fff08ebb958ad8612f8f5e52192b94d79","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    @classmethod"},{"line_number":32,"context_line":"    def skip_checks(cls):"},{"line_number":33,"context_line":"        super(FlavorAccessRbacTest, cls).skip_checks()"},{"line_number":34,"context_line":"        if not test.is_extension_enabled(\u0027OS-FLV-EXT-DATA\u0027, \u0027compute\u0027):"},{"line_number":35,"context_line":"            msg \u003d \"OS-FLV-EXT-DATA extension not enabled.\""},{"line_number":36,"context_line":"            raise cls.skipException(msg)"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5f2577a7_65910a9a","line":34,"updated":"2017-09-11 13:57:48.000000000","message":"If we\u0027re going to be modifying this file anyways, we may as well remove this.","commit_id":"64a831a19b5049ec2aec761dcf47b15a9ac5af67"}]}
