)]}'
{"oslo_policy/shell.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8d03e6096ff32ccbf487e23cac6444a4855415ce","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    parser.add_argument("},{"line_number":85,"context_line":"        \u0027--namespaced\u0027,"},{"line_number":86,"context_line":"        help\u003d\u0027assume the policy file uses namespaces, and only evaluates \u0027"},{"line_number":87,"context_line":"             \u0027rules with a : as a namespave separator\u0027)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    args \u003d parser.parse_args()"},{"line_number":90,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_f7a07390","line":87,"range":{"start_line":87,"start_character":34,"end_line":87,"end_character":43},"updated":"2018-10-16 10:00:41.000000000","message":"namespace","commit_id":"5057e42164b513a4b201a2ba21495ca695cdd040"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8d03e6096ff32ccbf487e23cac6444a4855415ce","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        is_admin \u003d args.is_admin.lower() \u003d\u003d \"true\""},{"line_number":92,"context_line":"    except Exception:"},{"line_number":93,"context_line":"        is_admin \u003d False"},{"line_number":94,"context_line":"    try:"},{"line_number":95,"context_line":"        namespaced \u003d args.namespaced.lower() !\u003d \"false\""},{"line_number":96,"context_line":"    except Exception:"},{"line_number":97,"context_line":"        namespaced \u003d True"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_379b4b64","line":95,"range":{"start_line":94,"start_character":0,"end_line":95,"end_character":55},"updated":"2018-10-16 10:00:41.000000000","message":"Rather than doing this, could you use a boolean option (Look for \u0027store_true\u0027) in the argparse docs [1].\n\nLater: I see we already are doing something else for \u0027--is-admin\u0027 so I guess we want to be consistent here. You can ignore this.\n\n[1] https://docs.python.org/3/library/argparse.html","commit_id":"5057e42164b513a4b201a2ba21495ca695cdd040"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"9f5ff9001720b88fe201c511bad4373e6e412a4d","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        help\u003d\u0027set is_admin\u003dTrue on the credentials used for the evaluation\u0027)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    parser.add_argument("},{"line_number":85,"context_line":"        \u0027--namespaced\u0027,"},{"line_number":86,"context_line":"        help\u003d\u0027assume the policy file uses namespaces, and only evaluates \u0027"},{"line_number":87,"context_line":"             \u0027rules with a : as a namespace separator\u0027)"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_6ded1200","line":85,"updated":"2018-11-02 13:34:13.000000000","message":"We usually have options like --namespaced and --no-namespaced set up to use the store_true and store_false actions, instead of requiring the user to pass true/false as an argument to the option.","commit_id":"e239a64dfb543fa7930707e6bf3f1c5914b21c18"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"6bde9d2edbadf50780f463ddbfceccbc2e84266d","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        help\u003d\u0027set is_admin\u003dTrue on the credentials used for the evaluation\u0027)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    parser.add_argument("},{"line_number":85,"context_line":"        \u0027--namespaced\u0027,"},{"line_number":86,"context_line":"        help\u003d\u0027assume the policy file uses namespaces, and only evaluates \u0027"},{"line_number":87,"context_line":"             \u0027rules with a : as a namespace separator\u0027)"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_f7bec8ff","line":85,"in_reply_to":"3f79a3b5_6ded1200","updated":"2018-11-02 15:56:35.000000000","message":"I agree, although as Stephen pointed out this is an unfortunate existing pattern in this CLI. Does anyone know if we can change that without breaking existing callers who pass a parameter?","commit_id":"e239a64dfb543fa7930707e6bf3f1c5914b21c18"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"30c66925b6c3e0f6871c430746c6ad371f38c301","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        help\u003d\u0027set is_admin\u003dTrue on the credentials used for the evaluation\u0027)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    parser.add_argument("},{"line_number":85,"context_line":"        \u0027--namespaced\u0027,"},{"line_number":86,"context_line":"        help\u003d\u0027assume the policy file uses namespaces, and only evaluates \u0027"},{"line_number":87,"context_line":"             \u0027rules with a : as a namespace separator\u0027)"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_f54d5d93","line":85,"in_reply_to":"3f79a3b5_a841d1a9","updated":"2018-11-02 18:23:02.000000000","message":"Oh, sorry, I missed Stephen\u0027s earlier review comment.\n\nFrankly, I would rather use the more widely standard pattern here and come back and fix those other options later.","commit_id":"e239a64dfb543fa7930707e6bf3f1c5914b21c18"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8f96a4230892ab283462173f520092b41256a2e7","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        help\u003d\u0027set is_admin\u003dTrue on the credentials used for the evaluation\u0027)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    parser.add_argument("},{"line_number":85,"context_line":"        \u0027--namespaced\u0027,"},{"line_number":86,"context_line":"        help\u003d\u0027assume the policy file uses namespaces, and only evaluates \u0027"},{"line_number":87,"context_line":"             \u0027rules with a : as a namespace separator\u0027)"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_a841d1a9","line":85,"in_reply_to":"3f79a3b5_f7bec8ff","updated":"2018-11-02 17:07:09.000000000","message":"Yeah, what Ben said. I figured local consistency was better, even if it meant doing things awkwardly like this.\n\n\u003e Does anyone know if we can change that without breaking existing callers who pass a parameter?\n\nIn theory, we could rework \u0027--is-admin\u0027 to make its argument optional (nargs\u003d\u0027?\u0027) but that\u0027s an extra change and I\u0027m not sure what happens if \u0027--is-admin\u0027 isn\u0027t the last option. Would it consume the next option in the list?","commit_id":"e239a64dfb543fa7930707e6bf3f1c5914b21c18"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"33127d07d282813d23efd16b835406258639a594","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        help\u003d\u0027configuration file for the oslopolicy-checker enforcer\u0027))"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    conf.register_cli_opt(cfg.BoolOpt("},{"line_number":145,"context_line":"        \u0027namespaced\u0027,"},{"line_number":146,"context_line":"        help\u003d\u0027assume the policy file uses namespaces, and only evaluates \u0027"},{"line_number":147,"context_line":"             \u0027rules with a : as a namespace separator\u0027))"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_9b853f0d","line":145,"updated":"2019-12-18 22:23:51.000000000","message":"I think we want this to default to True, based on the commit message and my reading of the previous version. The existing behavior assumes namespacing, but because BoolOpt defaults to None this will evaluate as false so we\u0027ll start skipping the : check.\n\nPreviously this was handled in a roundabout way by assuming anything except the explicit string \"false\" was true, which I think means either None or \"\" would have evaluated as true. I\u0027m not sure which argparse would default to, but it doesn\u0027t matter.\n\nOff the top of my head I\u0027m not sure whether BoolOpt allows you to specify an explicit value on the CLI or if it\u0027s just a flag. If the latter we might need to invert the logic and call this not_namespaced or something.","commit_id":"c59417dc64753b961476685e8366831b1c72b279"}]}
