)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"c0cb632fb57d2bee38ec1929ee12982f93cfa612","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add rest interface to get recent access rule"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When we do manila share-access-list, we could see"},{"line_number":10,"context_line":"the whole rules. But sometime, we should find which"},{"line_number":11,"context_line":"rule is the recent one. Because as our design, if"},{"line_number":12,"context_line":"we do allow-access, and then the share instance"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7ffa3b31_1824fdc5","line":9,"range":{"start_line":9,"start_character":18,"end_line":9,"end_character":35},"updated":"2017-04-14 01:29:30.000000000","message":"access-list","commit_id":"c6287f4495340b711d3c5b557ef9f430db76f01b"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"c0cb632fb57d2bee38ec1929ee12982f93cfa612","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add rest interface to get recent access rule"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When we do manila share-access-list, we could see"},{"line_number":10,"context_line":"the whole rules. But sometime, we should find which"},{"line_number":11,"context_line":"rule is the recent one. Because as our design, if"},{"line_number":12,"context_line":"we do allow-access, and then the share instance"},{"line_number":13,"context_line":"access-status becomes error which is caused by the"},{"line_number":14,"context_line":"recent access-rule. So, we could select it and delete it."},{"line_number":15,"context_line":"But if we delete another right one, the instance access-status"},{"line_number":16,"context_line":"still can be active. But the wrong access rule is still in."},{"line_number":17,"context_line":"So I thinnk we could add the function like access_get_recent."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7ffa3b31_3818d97f","line":14,"range":{"start_line":10,"start_character":17,"end_line":14,"end_character":19},"updated":"2017-04-14 01:29:30.000000000","message":"Why do you care about the \"recent\" rule? Can\u0027t you verify access rules in \"error\" state?\n\nWe don\u0027t support filtering based on status directly on the API, but you could do\n\n  $ manila access-list \u003cmyshare\u003e | grep \u0027error\u0027\n\nto list all rules in error state.","commit_id":"c6287f4495340b711d3c5b557ef9f430db76f01b"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"c0cb632fb57d2bee38ec1929ee12982f93cfa612","unresolved":false,"context_lines":[{"line_number":12,"context_line":"we do allow-access, and then the share instance"},{"line_number":13,"context_line":"access-status becomes error which is caused by the"},{"line_number":14,"context_line":"recent access-rule. So, we could select it and delete it."},{"line_number":15,"context_line":"But if we delete another right one, the instance access-status"},{"line_number":16,"context_line":"still can be active. But the wrong access rule is still in."},{"line_number":17,"context_line":"So I thinnk we could add the function like access_get_recent."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I406d6a3d418e9caea47a7748d3fc73c1a116347e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7ffa3b31_b803c90f","line":16,"range":{"start_line":15,"start_character":35,"end_line":16,"end_character":20},"updated":"2017-04-14 01:29:30.000000000","message":"Are you sure this behavior exists in master?","commit_id":"c6287f4495340b711d3c5b557ef9f430db76f01b"}],"manila/share/api.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"4f241a26fb609d1f8b739b6b6489cdd91edf97ac","unresolved":false,"context_lines":[{"line_number":1686,"context_line":"        \"\"\"Returns recent access rules for share.\"\"\""},{"line_number":1687,"context_line":"        policy.check_policy(context, \u0027share\u0027, \u0027access_get_all\u0027)"},{"line_number":1688,"context_line":"        rules \u003d self.db.share_access_get_all_for_share(context, share[\u0027id\u0027])"},{"line_number":1689,"context_line":"        recent \u003d None"},{"line_number":1690,"context_line":"        recent_rule \u003d None"},{"line_number":1691,"context_line":"        for rule in rules:"},{"line_number":1692,"context_line":"            if recent:"},{"line_number":1693,"context_line":"                if rule.created_at \u003e recent:"},{"line_number":1694,"context_line":"                    recent \u003d rule.created_at"},{"line_number":1695,"context_line":"                    recent_rule \u003d rule"},{"line_number":1696,"context_line":"            else:"},{"line_number":1697,"context_line":"                recent_rule \u003d rule"},{"line_number":1698,"context_line":"            recent \u003d rule.created_at"},{"line_number":1699,"context_line":"        if recent_rule:"},{"line_number":1700,"context_line":"            return [rule]"},{"line_number":1701,"context_line":"        else:"},{"line_number":1702,"context_line":"            return []"},{"line_number":1703,"context_line":""},{"line_number":1704,"context_line":"    def access_get(self, context, access_id):"},{"line_number":1705,"context_line":"        \"\"\"Returns access rule with the id.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"7ffa3b31_9327ceb7","line":1702,"range":{"start_line":1689,"start_character":0,"end_line":1702,"end_character":21},"updated":"2017-04-14 01:32:08.000000000","message":"you can do this filtering in the database layer:\n\nhttps://github.com/openstack/manila/blob/b709ec3/manila/db/sqlalchemy/api.py#L196","commit_id":"c6287f4495340b711d3c5b557ef9f430db76f01b"}]}
