)]}'
{"nova/tests/unit/policies/base.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"0e17ce9c14569c668d0c2aade67df712870a8ab0","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                    unauthorize_response.append("},{"line_number":176,"context_line":"                        ensure_return(req, *args1, **kwargs1))"},{"line_number":177,"context_line":"                except exception.PolicyNotAuthorized:"},{"line_number":178,"context_line":"                    continue"},{"line_number":179,"context_line":"            else:"},{"line_number":180,"context_line":"                ensure_raises(req, *args1, **kwargs1)"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4c43b2_4b325cf3","line":178,"updated":"2020-04-13 22:13:24.000000000","message":"I\u0027m wondering why does ignoring PolicyNotAuthorized work here? I would have thought we\u0027d have to append to unauthorize_response when catching the exception, but yet the tests pass.\n\nCould you please briefly explain why this is? Maybe worth a code comment.","commit_id":"044a20cb20060724d891a6da78bda95f0205ced3"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"0e5d8424e36d237c67d5065a118c4c47d648b227","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                    unauthorize_response.append("},{"line_number":176,"context_line":"                        ensure_return(req, *args1, **kwargs1))"},{"line_number":177,"context_line":"                except exception.PolicyNotAuthorized:"},{"line_number":178,"context_line":"                    continue"},{"line_number":179,"context_line":"            else:"},{"line_number":180,"context_line":"                ensure_raises(req, *args1, **kwargs1)"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4c43b2_6b63d8dd","line":178,"in_reply_to":"3f4c43b2_4b325cf3","updated":"2020-04-13 22:18:23.000000000","message":"yeah i should add a note here.\n\nThis is only for multi policy checks where second policy is with fatal\u003dfalse but first not.  For example: flavor specs in flavor show API:  flavor extra spec policy is checked after get flavor policy. So any context failing on get flavor will raise the  PolicyNotAuthorized and in that case we do not have way to verify the flavor extra specs as context is already failed in first policy check. For that case, we catch the exception here and skip to add that response in unauthorize_response.","commit_id":"044a20cb20060724d891a6da78bda95f0205ced3"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"34a907b00bb1f8d7d6b30f735d906f890759ab71","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                    unauthorize_response.append("},{"line_number":176,"context_line":"                        ensure_return(req, *args1, **kwargs1))"},{"line_number":177,"context_line":"                except exception.PolicyNotAuthorized:"},{"line_number":178,"context_line":"                    continue"},{"line_number":179,"context_line":"            else:"},{"line_number":180,"context_line":"                ensure_raises(req, *args1, **kwargs1)"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4c43b2_ab832056","line":178,"in_reply_to":"3f4c43b2_6b63d8dd","updated":"2020-04-13 22:21:08.000000000","message":"Ah, I see, thanks. Definitely would support adding a code comment here explaining this :)","commit_id":"044a20cb20060724d891a6da78bda95f0205ced3"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"900d353b94b704c3f7028e8db1f9cc8ab5056a68","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                    unauthorize_response.append("},{"line_number":176,"context_line":"                        ensure_return(req, *args1, **kwargs1))"},{"line_number":177,"context_line":"                except exception.PolicyNotAuthorized:"},{"line_number":178,"context_line":"                    continue"},{"line_number":179,"context_line":"            else:"},{"line_number":180,"context_line":"                ensure_raises(req, *args1, **kwargs1)"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4c43b2_6bf3d89f","line":178,"in_reply_to":"3f4c43b2_ab832056","updated":"2020-04-13 23:04:48.000000000","message":"done.","commit_id":"044a20cb20060724d891a6da78bda95f0205ced3"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5ddc7ff1cb559b8a02852e55f7d46e05294ae56c","unresolved":false,"context_lines":[{"line_number":188,"context_line":"                    # after the GET flavor policy. So any context failing on"},{"line_number":189,"context_line":"                    # GET flavor will raise the  PolicyNotAuthorized and for"},{"line_number":190,"context_line":"                    # that case we do not have any way to verify the flavor"},{"line_number":191,"context_line":"                    # extra specs so skip that context to check in test."},{"line_number":192,"context_line":"                except exception.PolicyNotAuthorized:"},{"line_number":193,"context_line":"                    continue"},{"line_number":194,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4c43b2_2ee6fe17","line":191,"updated":"2020-04-14 00:18:01.000000000","message":"++ thanks","commit_id":"6726811028b4e8e7888cbb35447d61b2b2a934fb"}],"nova/tests/unit/policies/test_flavor_extra_specs.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"ef241f90dba427e74fc5c702acd3c29e9ef406ff","unresolved":false,"context_lines":[{"line_number":313,"context_line":"            self.assertIn(\u0027extra_specs\u0027, resp.obj[\u0027server\u0027][\u0027flavor\u0027])"},{"line_number":314,"context_line":"        for resp in unauthorize_res:"},{"line_number":315,"context_line":"            self.assertNotIn(\u0027extra_specs\u0027, resp.obj[\u0027server\u0027][\u0027flavor\u0027])"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"class FlavorExtraSpecsScopeTypePolicyTest(FlavorExtraSpecsPolicyTest):"},{"line_number":319,"context_line":"    \"\"\"Test Flavor Extra Specs APIs policies with system scope enabled."}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4c43b2_cb82ec4f","line":316,"range":{"start_line":316,"start_character":0,"end_line":316,"end_character":0},"updated":"2020-04-13 22:21:33.000000000","message":"oh, i missed the test for PUT server API here which also add the flavor extra spec with this policy check.","commit_id":"044a20cb20060724d891a6da78bda95f0205ced3"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5ddc7ff1cb559b8a02852e55f7d46e05294ae56c","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        rule \u003d s_policies.SERVERS % \u0027update\u0027"},{"line_number":320,"context_line":"        # server \u0027update\u0027 policy is checked before flavor extra specs \u0027index\u0027"},{"line_number":321,"context_line":"        # policy so we have to allow it for everyone otherwise it will fail"},{"line_number":322,"context_line":"        # fist for unauthorized contexts."},{"line_number":323,"context_line":"        self.policy.set_rules({rule: \"@\"}, overwrite\u003dFalse)"},{"line_number":324,"context_line":"        req \u003d fakes.HTTPRequest.blank(\u0027\u0027, version\u003d\u00272.47\u0027)"},{"line_number":325,"context_line":"        rule_name \u003d policies.POLICY_ROOT % \u0027index\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4c43b2_4eed4aee","line":322,"range":{"start_line":322,"start_character":10,"end_line":322,"end_character":14},"updated":"2020-04-14 00:18:01.000000000","message":"first? or something else?","commit_id":"6726811028b4e8e7888cbb35447d61b2b2a934fb"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"5b1b798baf06c257135f8bc9d001cca535290f5d","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        rule \u003d s_policies.SERVERS % \u0027update\u0027"},{"line_number":320,"context_line":"        # server \u0027update\u0027 policy is checked before flavor extra specs \u0027index\u0027"},{"line_number":321,"context_line":"        # policy so we have to allow it for everyone otherwise it will fail"},{"line_number":322,"context_line":"        # fist for unauthorized contexts."},{"line_number":323,"context_line":"        self.policy.set_rules({rule: \"@\"}, overwrite\u003dFalse)"},{"line_number":324,"context_line":"        req \u003d fakes.HTTPRequest.blank(\u0027\u0027, version\u003d\u00272.47\u0027)"},{"line_number":325,"context_line":"        rule_name \u003d policies.POLICY_ROOT % \u0027index\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4c43b2_ae8e8e24","line":322,"range":{"start_line":322,"start_character":10,"end_line":322,"end_character":14},"in_reply_to":"3f4c43b2_4eed4aee","updated":"2020-04-14 00:32:22.000000000","message":"first, done","commit_id":"6726811028b4e8e7888cbb35447d61b2b2a934fb"}]}
