)]}'
{"cinder/context.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"128d815794d6aac093aa71fc6e1b9909979d4a39","unresolved":true,"context_lines":[{"line_number":217,"context_line":"            # lazy-load issues when the attribute doesn\u0027t exist."},{"line_number":218,"context_line":"            try:"},{"line_number":219,"context_line":"                target[\u0027project_id\u0027] \u003d target_obj.project_id"},{"line_number":220,"context_line":"            except Exception:"},{"line_number":221,"context_line":"                pass"},{"line_number":222,"context_line":"            try:"},{"line_number":223,"context_line":"                target[\u0027user_id\u0027] \u003d target_obj.user_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"1615d98c_abfe518b","line":220,"range":{"start_line":220,"start_character":19,"end_line":220,"end_character":28},"updated":"2021-08-20 16:07:34.000000000","message":"I\u0027m not intimately familiar with versioned objects, but what happens if you ask for an attribute that doesn\u0027t exist? Is there a way to except something more specific here, especially since we\u0027re swallowing whatever is raised?","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"ee199763741ec7836665e02b3f3ac0ec582de5b2","unresolved":true,"context_lines":[{"line_number":217,"context_line":"            # lazy-load issues when the attribute doesn\u0027t exist."},{"line_number":218,"context_line":"            try:"},{"line_number":219,"context_line":"                target[\u0027project_id\u0027] \u003d target_obj.project_id"},{"line_number":220,"context_line":"            except Exception:"},{"line_number":221,"context_line":"                pass"},{"line_number":222,"context_line":"            try:"},{"line_number":223,"context_line":"                target[\u0027user_id\u0027] \u003d target_obj.user_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"325a3e2b_48d27940","line":220,"range":{"start_line":220,"start_character":19,"end_line":220,"end_character":28},"in_reply_to":"1615d98c_abfe518b","updated":"2021-08-20 16:34:58.000000000","message":"I initially tried using hasattr() to pre-test for the attributes, but that in turn caused some lazy-loads like [1] to fail.\n\n[1] https://opendev.org/openstack/cinder/src/branch/master/cinder/objects/volume.py#L415\n\nSo then I\u0027d need to catch that one, and the code started to get way more involved than I intended. In the end, I decided to keep it simple. If the attribute is available, then fine, we grab it. If it isn\u0027t available then we really don\u0027t need to distinguish the reason why.","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"}],"cinder/policy.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"128d815794d6aac093aa71fc6e1b9909979d4a39","unresolved":true,"context_lines":[{"line_number":55,"context_line":"            use_conf\u003duse_conf,"},{"line_number":56,"context_line":"            fallback_to_json_file\u003dFalse)"},{"line_number":57,"context_line":"        if suppress_deprecation_warnings:"},{"line_number":58,"context_line":"            _ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":59,"context_line":"        register_rules(_ENFORCER)"},{"line_number":60,"context_line":"        _ENFORCER.load_rules()"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"2d2119df_7ba465d1","line":58,"updated":"2021-08-20 16:07:34.000000000","message":"nit: we could just pass the kwarg regardless:\n\n  _ENFORCER \u003d policy.Enforcer(\n    CONF,\n    use_conf\u003duse_conf,\n    fallback_to_json_file\u003dFalse)\n  _ENFORCER.suppress_deprecation_warnings \u003d suppress_deprecation_warnings","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"ee199763741ec7836665e02b3f3ac0ec582de5b2","unresolved":true,"context_lines":[{"line_number":55,"context_line":"            use_conf\u003duse_conf,"},{"line_number":56,"context_line":"            fallback_to_json_file\u003dFalse)"},{"line_number":57,"context_line":"        if suppress_deprecation_warnings:"},{"line_number":58,"context_line":"            _ENFORCER.suppress_deprecation_warnings \u003d True"},{"line_number":59,"context_line":"        register_rules(_ENFORCER)"},{"line_number":60,"context_line":"        _ENFORCER.load_rules()"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"6ee08919_801ee1fc","line":58,"in_reply_to":"2d2119df_7ba465d1","updated":"2021-08-20 16:34:58.000000000","message":"Ooh, right! I just followed nova\u0027s example, but using kwargs is better. I\u0027m expecting more feedback on this patch, and will fix this in the next update.","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"}],"cinder/tests/fixtures.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"128d815794d6aac093aa71fc6e1b9909979d4a39","unresolved":true,"context_lines":[{"line_number":165,"context_line":"            UnHelperfulClientChannel))"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"class PolicyFixture(fixtures.Fixture):"},{"line_number":169,"context_line":"    \"\"\"Load the live policy for tests."},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    A base policy fixture that starts with the assumption that you\u0027d"}],"source_content_type":"text/x-python","patch_set":1,"id":"a1dbde5c_dc5de112","line":168,"updated":"2021-08-20 16:07:34.000000000","message":"Nice, I thought cinder already had this somewhere. Thanks for adding it!","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"ee199763741ec7836665e02b3f3ac0ec582de5b2","unresolved":true,"context_lines":[{"line_number":165,"context_line":"            UnHelperfulClientChannel))"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"class PolicyFixture(fixtures.Fixture):"},{"line_number":169,"context_line":"    \"\"\"Load the live policy for tests."},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    A base policy fixture that starts with the assumption that you\u0027d"}],"source_content_type":"text/x-python","patch_set":1,"id":"fe6786e9_9bda2bb7","line":168,"in_reply_to":"a1dbde5c_dc5de112","updated":"2021-08-20 16:34:58.000000000","message":"Nova\u0027s are (yes, there are multiples) more complex, but I deliberately trimmed this one down to be as light weight as possible. It\u0027s better to add functionality when it\u0027s needed than blindly grabbing everything nova did.","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4889ec2fa0f61dc31def01e908742f85d3c06c2f","unresolved":false,"context_lines":[{"line_number":165,"context_line":"            UnHelperfulClientChannel))"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"class PolicyFixture(fixtures.Fixture):"},{"line_number":169,"context_line":"    \"\"\"Load the live policy for tests."},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    A base policy fixture that starts with the assumption that you\u0027d"}],"source_content_type":"text/x-python","patch_set":1,"id":"82564ea7_5adcd0ef","line":168,"in_reply_to":"fe6786e9_9bda2bb7","updated":"2021-08-20 16:38:36.000000000","message":"Ack","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"}],"cinder/tests/unit/policies/base.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"128d815794d6aac093aa71fc6e1b9909979d4a39","unresolved":true,"context_lines":[{"line_number":29,"context_line":"class BasePolicyTest(test.TestCase):"},{"line_number":30,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":31,"context_line":"        super().__init__(*args, **kwargs)"},{"line_number":32,"context_line":"        self.enforce_scope \u003d False"},{"line_number":33,"context_line":"        self.enforce_new_defaults \u003d False"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def setUp(self):"},{"line_number":36,"context_line":"        super().setUp()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1e94bf94_5cbfbf27","line":33,"range":{"start_line":32,"start_character":0,"end_line":33,"end_character":41},"updated":"2021-08-20 16:07:34.000000000","message":"Do we expect to use this class for testing legacy rbac (enforce_scope\u003dFalse, enforce_new_defaults\u003dFalse) in addition to secure RBAC (enforce_new_defaults\u003dTrue)?\n\nIf not, and this is only going to be used for testing new/default policies, I wonder if we can\u0027t just set this to enforce \"secure\" RBAC in the base implementation.","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"ee199763741ec7836665e02b3f3ac0ec582de5b2","unresolved":true,"context_lines":[{"line_number":29,"context_line":"class BasePolicyTest(test.TestCase):"},{"line_number":30,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":31,"context_line":"        super().__init__(*args, **kwargs)"},{"line_number":32,"context_line":"        self.enforce_scope \u003d False"},{"line_number":33,"context_line":"        self.enforce_new_defaults \u003d False"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def setUp(self):"},{"line_number":36,"context_line":"        super().setUp()"}],"source_content_type":"text/x-python","patch_set":1,"id":"25700954_dbb10331","line":33,"range":{"start_line":32,"start_character":0,"end_line":33,"end_character":41},"in_reply_to":"1e94bf94_5cbfbf27","updated":"2021-08-20 16:34:58.000000000","message":"I expect for Xena we specifically want to test the lagacy rules. You can see where I use the ability to test both variants in [1] and [2]. Maybe we\u0027ll want to change the defaults in a later release?\n\n[1] https://review.opendev.org/c/openstack/cinder/+/759943/12/cinder/tests/unit/policies/test_attachments.py#28\n[2] https://review.opendev.org/c/openstack/cinder/+/759943/12/cinder/tests/unit/policies/test_attachments.py#224","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4889ec2fa0f61dc31def01e908742f85d3c06c2f","unresolved":false,"context_lines":[{"line_number":29,"context_line":"class BasePolicyTest(test.TestCase):"},{"line_number":30,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":31,"context_line":"        super().__init__(*args, **kwargs)"},{"line_number":32,"context_line":"        self.enforce_scope \u003d False"},{"line_number":33,"context_line":"        self.enforce_new_defaults \u003d False"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def setUp(self):"},{"line_number":36,"context_line":"        super().setUp()"}],"source_content_type":"text/x-python","patch_set":1,"id":"c3262b98_de687016","line":33,"range":{"start_line":32,"start_character":0,"end_line":33,"end_character":41},"in_reply_to":"25700954_dbb10331","updated":"2021-08-20 16:38:36.000000000","message":"Ack","commit_id":"9453801c1b39cc6e6e22c912501c994a6c309c31"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"de38ea32c01697462a616e52c851d47ba23e33ae","unresolved":true,"context_lines":[{"line_number":54,"context_line":"        self.project_id \u003d uuids.project_id"},{"line_number":55,"context_line":"        self.project_id_other \u003d uuids.project_id_other"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        self.context_details \u003d {"},{"line_number":58,"context_line":"            \u0027legacy_admin\u0027: dict("},{"line_number":59,"context_line":"                project_id\u003dself.admin_project_id,"},{"line_number":60,"context_line":"                roles\u003d[\u0027admin\u0027, \u0027member\u0027, \u0027reader\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"7b11f7ae_1880eb98","line":57,"updated":"2021-08-27 19:37:54.000000000","message":"I don\u0027t know how you want to handle this, but for Xena we only have 3 of the 5 eventual personas:\n\n1. project-reader\n2. project-member\n3. \"system-admin\"\n\n\"system-admin\" has all the powers to administer the cinder system, but since we aren\u0027t recognizing scope in Xena, it\u0027s basically any user in a project who has the \u0027admin\u0027 role (so, basically, what you have as the legacy_admin, below).\n\nIn Yoga, we\u0027ll be rewriting the policies so that your system_admin at line 66 will be the \"system-admin\", and we\u0027ll add in the project-admin and system-reader.","commit_id":"b325e254a5748b6c27c99025a1be062cafeb2b00"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d0719c9ef1d4c3e94f392273cfadafc2b520ebba","unresolved":true,"context_lines":[{"line_number":29,"context_line":"    \u0027legacy_admin\u0027,"},{"line_number":30,"context_line":"    \u0027legacy_owner\u0027,"},{"line_number":31,"context_line":"    \u0027system_admin\u0027,"},{"line_number":32,"context_line":"    # NOTE: Xena does not support these system scoped personae. They need"},{"line_number":33,"context_line":"    # to be tested in Yoga when support is added for system scope."},{"line_number":34,"context_line":"    # \u0027system_member\u0027,"},{"line_number":35,"context_line":"    # \u0027system_reader\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"f5ede5e4_2491ad3c","line":32,"range":{"start_line":32,"start_character":54,"end_line":32,"end_character":62},"updated":"2021-09-03 15:53:09.000000000","message":"personas","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"379574228000fca5b92ab1d7002a66a44f930cd6","unresolved":true,"context_lines":[{"line_number":29,"context_line":"    \u0027legacy_admin\u0027,"},{"line_number":30,"context_line":"    \u0027legacy_owner\u0027,"},{"line_number":31,"context_line":"    \u0027system_admin\u0027,"},{"line_number":32,"context_line":"    # NOTE: Xena does not support these system scoped personae. They need"},{"line_number":33,"context_line":"    # to be tested in Yoga when support is added for system scope."},{"line_number":34,"context_line":"    # \u0027system_member\u0027,"},{"line_number":35,"context_line":"    # \u0027system_reader\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"18ff863b_d73c4550","line":32,"range":{"start_line":32,"start_character":54,"end_line":32,"end_character":62},"in_reply_to":"f5ede5e4_2491ad3c","updated":"2021-09-03 16:17:39.000000000","message":"I could reply by saying the Pope and my old latin teacher would disagree, but then I\u0027d be pedantic.\n\n*grin*","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d0719c9ef1d4c3e94f392273cfadafc2b520ebba","unresolved":true,"context_lines":[{"line_number":176,"context_line":"                    # first policy itself fail to pass (even test override the"},{"line_number":177,"context_line":"                    # first policy to allow for everyone but still, scope"},{"line_number":178,"context_line":"                    # checks can leads to PolicyNotAuthorized error)."},{"line_number":179,"context_line":"                    # For example: flavor extra specs policy for GET flavor"},{"line_number":180,"context_line":"                    # API. In that case, flavor extra spec policy is checked"},{"line_number":181,"context_line":"                    # after the GET flavor policy. So any context failing on"},{"line_number":182,"context_line":"                    # GET flavor will raise the  PolicyNotAuthorized and for"},{"line_number":183,"context_line":"                    # that case we do not have any way to verify the flavor"},{"line_number":184,"context_line":"                    # extra specs so skip that context to check in test."},{"line_number":185,"context_line":"                except exception.PolicyNotAuthorized:"},{"line_number":186,"context_line":"                    pass"},{"line_number":187,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a5ac002_cbfb40d9","line":184,"range":{"start_line":179,"start_character":35,"end_line":184,"end_character":72},"updated":"2021-09-03 15:53:09.000000000","message":"i think we need a cinder specific example here, the two i can think of are\n1) bootable volume multiattach policy: https://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L2101-L2103\n2) target is multiattach during retype: https://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L1678-L1679","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"379574228000fca5b92ab1d7002a66a44f930cd6","unresolved":true,"context_lines":[{"line_number":176,"context_line":"                    # first policy itself fail to pass (even test override the"},{"line_number":177,"context_line":"                    # first policy to allow for everyone but still, scope"},{"line_number":178,"context_line":"                    # checks can leads to PolicyNotAuthorized error)."},{"line_number":179,"context_line":"                    # For example: flavor extra specs policy for GET flavor"},{"line_number":180,"context_line":"                    # API. In that case, flavor extra spec policy is checked"},{"line_number":181,"context_line":"                    # after the GET flavor policy. So any context failing on"},{"line_number":182,"context_line":"                    # GET flavor will raise the  PolicyNotAuthorized and for"},{"line_number":183,"context_line":"                    # that case we do not have any way to verify the flavor"},{"line_number":184,"context_line":"                    # extra specs so skip that context to check in test."},{"line_number":185,"context_line":"                except exception.PolicyNotAuthorized:"},{"line_number":186,"context_line":"                    pass"},{"line_number":187,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5475954e_118f6c67","line":184,"range":{"start_line":179,"start_character":35,"end_line":184,"end_character":72},"in_reply_to":"9a5ac002_cbfb40d9","updated":"2021-09-03 16:17:39.000000000","message":"That\u0027s quite possible. The comment you see here is largely taken from the original nova patch, and I can\u0027t vouch for it being 100% accurate, at least in the way that cinder uses this code.","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d0719c9ef1d4c3e94f392273cfadafc2b520ebba","unresolved":true,"context_lines":[{"line_number":187,"context_line":"            else:"},{"line_number":188,"context_line":"                response \u003d ensure_raises(req, *args, **kwargs)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        return response"}],"source_content_type":"text/x-python","patch_set":5,"id":"d1e4506b_fb9c7482","line":190,"range":{"start_line":190,"start_character":15,"end_line":190,"end_character":23},"updated":"2021-09-03 15:53:09.000000000","message":"Seeing the attachment tests, we are not using this response anywhere (there might be an idea of using it specifically in some APIs)\nSo we can skip returning or even creating this response variable altogether","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"379574228000fca5b92ab1d7002a66a44f930cd6","unresolved":true,"context_lines":[{"line_number":187,"context_line":"            else:"},{"line_number":188,"context_line":"                response \u003d ensure_raises(req, *args, **kwargs)"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        return response"}],"source_content_type":"text/x-python","patch_set":5,"id":"f9c6ddeb_ee52447f","line":190,"range":{"start_line":190,"start_character":15,"end_line":190,"end_character":23},"in_reply_to":"d1e4506b_fb9c7482","updated":"2021-09-03 16:17:39.000000000","message":"See [1] for an example where the response is being used. The attachments tests didn\u0027t need it.\n\n[1] https://review.opendev.org/c/openstack/cinder/+/804459/5/cinder/tests/unit/policies/test_backups.py#120","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"}],"cinder/tests/unit/test_context.py":[{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d0719c9ef1d4c3e94f392273cfadafc2b520ebba","unresolved":true,"context_lines":[{"line_number":151,"context_line":"                                              project_id\u003d\u0027my_project\u0027)"},{"line_number":152,"context_line":"        self.addCleanup(policy.reset)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    def _dict_target_obj(project_id):"},{"line_number":155,"context_line":"        return {"},{"line_number":156,"context_line":"            \u0027user_id\u0027: \u0027me\u0027,"},{"line_number":157,"context_line":"            \u0027project_id\u0027: project_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1c716810_adc68760","line":154,"range":{"start_line":154,"start_character":8,"end_line":154,"end_character":24},"updated":"2021-09-03 15:53:09.000000000","message":"i think this should be _dict_target, since dict and obj together sounds confusing","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"379574228000fca5b92ab1d7002a66a44f930cd6","unresolved":true,"context_lines":[{"line_number":151,"context_line":"                                              project_id\u003d\u0027my_project\u0027)"},{"line_number":152,"context_line":"        self.addCleanup(policy.reset)"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"    def _dict_target_obj(project_id):"},{"line_number":155,"context_line":"        return {"},{"line_number":156,"context_line":"            \u0027user_id\u0027: \u0027me\u0027,"},{"line_number":157,"context_line":"            \u0027project_id\u0027: project_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"e76071e5_ac1afe2f","line":154,"range":{"start_line":154,"start_character":8,"end_line":154,"end_character":24},"in_reply_to":"1c716810_adc68760","updated":"2021-09-03 16:17:39.000000000","message":"yeah, names are awkward. What I was trying to convey is a function that creates a \"target_obj\" (for the ddt.data below), but one that happens to be a dict and not a real OVO.","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d0719c9ef1d4c3e94f392273cfadafc2b520ebba","unresolved":true,"context_lines":[{"line_number":157,"context_line":"            \u0027project_id\u0027: project_id,"},{"line_number":158,"context_line":"        }"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _real_target_obj(project_id):"},{"line_number":161,"context_line":"        target_obj \u003d objects_base.CinderObject()"},{"line_number":162,"context_line":"        target_obj.user_id \u003d \u0027me\u0027"},{"line_number":163,"context_line":"        target_obj.project_id \u003d project_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"ac157f5c_6bf8bf4b","line":160,"range":{"start_line":160,"start_character":8,"end_line":160,"end_character":24},"updated":"2021-09-03 15:53:09.000000000","message":"we can call it similarly, _target_obj or _obj_target or any other suitable name","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"},{"author":{"_account_id":21129,"name":"Alan Bishop","email":"abishopsweng@gmail.com","username":"ASBishop","status":"ex Red Hat"},"change_message_id":"379574228000fca5b92ab1d7002a66a44f930cd6","unresolved":true,"context_lines":[{"line_number":157,"context_line":"            \u0027project_id\u0027: project_id,"},{"line_number":158,"context_line":"        }"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def _real_target_obj(project_id):"},{"line_number":161,"context_line":"        target_obj \u003d objects_base.CinderObject()"},{"line_number":162,"context_line":"        target_obj.user_id \u003d \u0027me\u0027"},{"line_number":163,"context_line":"        target_obj.project_id \u003d project_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"6cc40e56_d9620cbb","line":160,"range":{"start_line":160,"start_character":8,"end_line":160,"end_character":24},"in_reply_to":"ac157f5c_6bf8bf4b","updated":"2021-09-03 16:17:39.000000000","message":"See above. I agree the names are awkward, but in this instance the function is returning a \"target_obj\" for the ddt.data that _is_ an OVO (as opposed to a dict).","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d0719c9ef1d4c3e94f392273cfadafc2b520ebba","unresolved":true,"context_lines":[{"line_number":200,"context_line":"            \u0027target_obj\u0027: None,"},{"line_number":201,"context_line":"            \u0027expected\u0027: False,"},{"line_number":202,"context_line":"        },"},{"line_number":203,"context_line":"        {"},{"line_number":204,"context_line":"            # PASS: target inherits \u0027my_project\u0027 from the context"},{"line_number":205,"context_line":"            \u0027target\u0027: None,"},{"line_number":206,"context_line":"            \u0027target_obj\u0027: None,"},{"line_number":207,"context_line":"            \u0027expected\u0027: True,"},{"line_number":208,"context_line":"        },"},{"line_number":209,"context_line":"    )"},{"line_number":210,"context_line":"    @ddt.unpack"},{"line_number":211,"context_line":"    def test_authorize(self, target, target_obj, expected):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fd06f98f_7a56efcf","line":208,"range":{"start_line":203,"start_character":0,"end_line":208,"end_character":9},"updated":"2021-09-03 15:53:09.000000000","message":"i think we should also test the case when we pass both target and target_obj, although that seems unlikely in real policy authorize implementation, just to be on safe side","commit_id":"81e0da35dc04ebd1409b401f02f2d3455ac98b27"}]}
