)]}'
{"keystone/assignment/controllers.py":[{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"357d9140e8adf8d4b9914aeb3d657bcf4afaf09d","unresolved":false,"context_lines":[{"line_number":687,"context_line":"    def _expand_inherited_assignments(self, ref, context):"},{"line_number":688,"context_line":"        \"\"\"Get role assignments from inherited assignments."},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"        If the OS-INERIT extension is enabled, the refs lists may"},{"line_number":691,"context_line":"        contain roles to be inherited from domain to project, so expand"},{"line_number":692,"context_line":"        these as well into project equivalents"},{"line_number":693,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_f610b14f","line":690,"updated":"2014-09-05 14:55:46.000000000","message":"Typo: OS-INERIT-\u003eOS-INHERIT","commit_id":"6ea7744785deff7e2e00a4021ec84e49730c2348"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"357d9140e8adf8d4b9914aeb3d657bcf4afaf09d","unresolved":false,"context_lines":[{"line_number":698,"context_line":"        project_ids \u003d self._get_project_ids_from_domain(ref)"},{"line_number":699,"context_line":"        base_entry \u003d copy.deepcopy(ref)"},{"line_number":700,"context_line":"        domain_id \u003d base_entry[\u0027scope\u0027][\u0027domain\u0027][\u0027id\u0027]"},{"line_number":701,"context_line":"        base_entry[\u0027scope\u0027].pop(\u0027domain\u0027)"},{"line_number":702,"context_line":"        # For each project, create an equivalent role assignment"},{"line_number":703,"context_line":"        for project_id in project_ids:"},{"line_number":704,"context_line":"            # If it\u0027s a group assignment, then create equivalent user"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_d66acdb1","line":701,"updated":"2014-09-05 14:55:46.000000000","message":"Two lines above may be reduced:\ndomain_id \u003d base_entry[\u0027scope\u0027].pop(\u0027domain\u0027)[\u0027id\u0027]","commit_id":"6ea7744785deff7e2e00a4021ec84e49730c2348"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"357d9140e8adf8d4b9914aeb3d657bcf4afaf09d","unresolved":false,"context_lines":[{"line_number":707,"context_line":"                members \u003d self._get_group_members(base_entry)"},{"line_number":708,"context_line":"                sub_entry \u003d copy.deepcopy(base_entry)"},{"line_number":709,"context_line":"                group_id \u003d sub_entry[\u0027group\u0027][\u0027id\u0027]"},{"line_number":710,"context_line":"                sub_entry.pop(\u0027group\u0027)"},{"line_number":711,"context_line":"                for member in members:"},{"line_number":712,"context_line":"                    new_entry \u003d ("},{"line_number":713,"context_line":"                        self._build_project_equivalent_of_group_domain_role("}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_f6d8b1f0","line":710,"updated":"2014-09-05 14:55:46.000000000","message":"Same here","commit_id":"6ea7744785deff7e2e00a4021ec84e49730c2348"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"357d9140e8adf8d4b9914aeb3d657bcf4afaf09d","unresolved":false,"context_lines":[{"line_number":740,"context_line":"        # equivalent user role assignment for each of the group members"},{"line_number":741,"context_line":"        base_entry \u003d copy.deepcopy(ref)"},{"line_number":742,"context_line":"        group_id \u003d base_entry[\u0027group\u0027][\u0027id\u0027]"},{"line_number":743,"context_line":"        base_entry.pop(\u0027group\u0027)"},{"line_number":744,"context_line":"        for member in members:"},{"line_number":745,"context_line":"            user_entry \u003d self._build_user_assignment_equivalent_of_group("},{"line_number":746,"context_line":"                member, group_id, base_entry, context)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_f65b5151","line":743,"updated":"2014-09-05 14:55:46.000000000","message":"Same as at line 700: pop() will return deleted element","commit_id":"6ea7744785deff7e2e00a4021ec84e49730c2348"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"357d9140e8adf8d4b9914aeb3d657bcf4afaf09d","unresolved":false,"context_lines":[{"line_number":782,"context_line":"                target \u003d \u0027Domain: %s\u0027 % dom_id"},{"line_number":783,"context_line":"            elif \u0027project\u0027 in ref[\u0027scope\u0027]:"},{"line_number":784,"context_line":"                proj_id \u003d ref[\u0027scope\u0027][\u0027project\u0027].get(\u0027id\u0027, \u0027Unknown\u0027)"},{"line_number":785,"context_line":"                target \u003d \u0027Project: %s\u0027 % proj_id"},{"line_number":786,"context_line":"        if \u0027role\u0027 in ref and \u0027id\u0027 in ref[\u0027role\u0027]:"},{"line_number":787,"context_line":"            role_id \u003d ref[\u0027role\u0027][\u0027id\u0027]"},{"line_number":788,"context_line":"        LOG.warning("}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_31bde302","line":785,"updated":"2014-09-05 14:55:46.000000000","message":"Maybe wrap everything in try/except?\n\ntry:\n    target \u003d \u0027Domain: %s\u0027 % ref[\u0027scope\u0027][\u0027domain\u0027].get(\u0027id\u0027, \u0027Unknown\u0027)\nexcept KeyError:\n    try:\n        target \u003d \u0027Project: %s\u0027 % ref[\u0027scope\u0027][\u0027project\u0027].get(\u0027id\u0027, \u0027Unknown\u0027)\n    except KeyError:\n        target \u003d \u0027Unknown\u0027\n\nAnd same for the role.","commit_id":"6ea7744785deff7e2e00a4021ec84e49730c2348"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"50a37713c871858afe00e6acefc78b65c99c18aa","unresolved":false,"context_lines":[{"line_number":676,"context_line":"            if \u0027OS-INHERIT:inherited_to\u0027 in ref[\u0027scope\u0027]:"},{"line_number":677,"context_line":"                refs \u003d self._expand_inherited_assignments(ref, context)"},{"line_number":678,"context_line":"                new_refs.extend(refs)"},{"line_number":679,"context_line":"            elif \u0027group\u0027 in ref:"},{"line_number":680,"context_line":"                refs \u003d self._expand_user_to_group_assignments(ref, context)"},{"line_number":681,"context_line":"                new_refs.extend(refs)"},{"line_number":682,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_f10ec6e4","line":679,"updated":"2014-09-08 14:34:50.000000000","message":"So \u0027group\u0027 in ref and \u0027OS-INHERIT:inherited_to\u0027 in ref[\u0027scope\u0027] are mutually exclusive? Is it checked anywhere?\nI\u0027m not so familiar with the code yet and there may be some caveats about this constraint, but maybe change \u0027elif\u0027 to \u0027if\u0027 here?","commit_id":"a3e27e59fca3ff8ec0d35ba590247aba33d68c70"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"50a37713c871858afe00e6acefc78b65c99c18aa","unresolved":false,"context_lines":[{"line_number":696,"context_line":"        # Get the list of projects owned by this domain. A domain scope is"},{"line_number":697,"context_line":"        # guaranteed since we checked this when we built the refs list"},{"line_number":698,"context_line":"        project_ids \u003d self._get_project_ids_from_domain(ref)"},{"line_number":699,"context_line":"        base_entry \u003d copy.deepcopy(ref)"},{"line_number":700,"context_line":"        domain \u003d base_entry[\u0027scope\u0027].pop(\u0027domain\u0027)"},{"line_number":701,"context_line":"        domain_id \u003d domain[\u0027id\u0027]"},{"line_number":702,"context_line":"        # For each project, create an equivalent role assignment"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_1188aae6","line":699,"updated":"2014-09-08 14:34:50.000000000","message":"I really cannot see why use deep copy when shallow copy is ehough.\nbase_entry \u003d copy.deepcopy(ref) \u003d\u003e base_entry \u003d dict(ref)","commit_id":"a3e27e59fca3ff8ec0d35ba590247aba33d68c70"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"50a37713c871858afe00e6acefc78b65c99c18aa","unresolved":false,"context_lines":[{"line_number":697,"context_line":"        # guaranteed since we checked this when we built the refs list"},{"line_number":698,"context_line":"        project_ids \u003d self._get_project_ids_from_domain(ref)"},{"line_number":699,"context_line":"        base_entry \u003d copy.deepcopy(ref)"},{"line_number":700,"context_line":"        domain \u003d base_entry[\u0027scope\u0027].pop(\u0027domain\u0027)"},{"line_number":701,"context_line":"        domain_id \u003d domain[\u0027id\u0027]"},{"line_number":702,"context_line":"        # For each project, create an equivalent role assignment"},{"line_number":703,"context_line":"        for project_id in project_ids:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_f4a4f409","line":700,"updated":"2014-09-08 14:34:50.000000000","message":"As far as I understand domain is removed from the scope only to be filled somewhere else.","commit_id":"a3e27e59fca3ff8ec0d35ba590247aba33d68c70"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"50a37713c871858afe00e6acefc78b65c99c18aa","unresolved":false,"context_lines":[{"line_number":705,"context_line":"            # roles based on membership of the group"},{"line_number":706,"context_line":"            if \u0027group\u0027 in base_entry:"},{"line_number":707,"context_line":"                members \u003d self._get_group_members(base_entry)"},{"line_number":708,"context_line":"                sub_entry \u003d copy.deepcopy(base_entry)"},{"line_number":709,"context_line":"                group \u003d sub_entry.pop(\u0027group\u0027)"},{"line_number":710,"context_line":"                group_id \u003d group[\u0027id\u0027]"},{"line_number":711,"context_line":"                for member in members:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_91e1fa9c","line":708,"updated":"2014-09-08 14:34:50.000000000","message":"Again deepcopy. You do here nothing changing values referenced neither by base_entry nor by sub_entry.\nMore to say there is a potential risk in using deep copy: running into a cyclic reference.","commit_id":"a3e27e59fca3ff8ec0d35ba590247aba33d68c70"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"50a37713c871858afe00e6acefc78b65c99c18aa","unresolved":false,"context_lines":[{"line_number":841,"context_line":""},{"line_number":842,"context_line":"        The template has had the \u0027domain\u0027 and \u0027group\u0027 entities removed, so"},{"line_number":843,"context_line":"        substitute a \u0027user-project\u0027 one, modifying the \u0027assignment\u0027 link"},{"line_number":844,"context_line":"        to match."},{"line_number":845,"context_line":""},{"line_number":846,"context_line":"        \"\"\""},{"line_number":847,"context_line":"        project_entry \u003d copy.deepcopy(template)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_145c1825","line":844,"updated":"2014-09-08 14:34:50.000000000","message":"Function expects template with particular modifications, so please either validate it or do modifications here, accepting template in some canonical form.","commit_id":"a3e27e59fca3ff8ec0d35ba590247aba33d68c70"},{"author":{"_account_id":13055,"name":"Alexander Makarov","email":"ajiekcahdp.makapob@gmail.com","username":"amakarov"},"change_message_id":"5a14d8d3f9308066a30f8f713c0f9f4437fb6db1","unresolved":false,"context_lines":[{"line_number":844,"context_line":"        to match."},{"line_number":845,"context_line":""},{"line_number":846,"context_line":"        \"\"\""},{"line_number":847,"context_line":"        project_entry \u003d copy.deepcopy(template)"},{"line_number":848,"context_line":"        project_entry[\u0027user\u0027] \u003d {\u0027id\u0027: user_id}"},{"line_number":849,"context_line":"        project_entry[\u0027scope\u0027][\u0027project\u0027] \u003d {\u0027id\u0027: project_id}"},{"line_number":850,"context_line":"        project_entry[\u0027links\u0027][\u0027assignment\u0027] \u003d ("}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_570f822e","line":847,"updated":"2014-09-08 14:50:22.000000000","message":"It\u0027d better to create new entries explicitly:\n1. Improves readability - function will turn into dict construction with visible structure\n2. Deprecates external template preparations\nIf entry template structure is so unstructured you always know what entry must be returned by the function.","commit_id":"a3e27e59fca3ff8ec0d35ba590247aba33d68c70"}]}
