)]}'
{"doc/source/cli/oslopolicy-convert-json-to-yaml.rst":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"32d8fbe95f42511871dc34e233fd1c62d8d71d0c","unresolved":false,"context_lines":[{"line_number":29,"context_line":"* Does not auto add the deprecated rules in the file unless it not already"},{"line_number":30,"context_line":"  present in the file."},{"line_number":31,"context_line":"* Keep any extra rules or already exist deprecated rules uncommented"},{"line_number":32,"context_line":"  but at the end of the file with a warning text. "},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"When to use:"},{"line_number":35,"context_line":"############"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f560f44_593d44c2","line":32,"range":{"start_line":32,"start_character":49,"end_line":32,"end_character":50},"updated":"2020-08-26 10:27:43.000000000","message":"White space","commit_id":"8f570da7ffc379fc9bb1219b0451af24eb91c332"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9d33abcc9e90609c3988b383e34d002451417c0c","unresolved":false,"context_lines":[{"line_number":29,"context_line":"* Does not auto add the deprecated rules in the file unless it not already"},{"line_number":30,"context_line":"  present in the file."},{"line_number":31,"context_line":"* Keep any extra rules or already exist deprecated rules uncommented"},{"line_number":32,"context_line":"  but at the end of the file with a warning text. "},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"When to use:"},{"line_number":35,"context_line":"############"}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f560f44_919690ef","line":32,"range":{"start_line":32,"start_character":49,"end_line":32,"end_character":50},"in_reply_to":"9f560f44_593d44c2","updated":"2020-08-26 16:57:59.000000000","message":"Done","commit_id":"8f570da7ffc379fc9bb1219b0451af24eb91c332"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"32d8fbe95f42511871dc34e233fd1c62d8d71d0c","unresolved":false,"context_lines":[{"line_number":32,"context_line":"  but at the end of the file with a warning text. "},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"When to use:"},{"line_number":35,"context_line":"############"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Oslo policy still support the policy file in json format, but that lead to"},{"line_number":38,"context_line":"`multiple issues \u003chttps://specs.openstack.org/openstack/oslo-specs/specs/victoria/policy-json-to-yaml.html#problem-description\u003e`_ ."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f560f44_b99f40b2","line":35,"range":{"start_line":35,"start_character":0,"end_line":35,"end_character":12},"updated":"2020-08-26 10:27:43.000000000","message":"I wondering if it should be \"~~~~~\", however rendered doc looks fine with \"#####\".","commit_id":"8f570da7ffc379fc9bb1219b0451af24eb91c332"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9d33abcc9e90609c3988b383e34d002451417c0c","unresolved":false,"context_lines":[{"line_number":32,"context_line":"  but at the end of the file with a warning text. "},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"When to use:"},{"line_number":35,"context_line":"############"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Oslo policy still support the policy file in json format, but that lead to"},{"line_number":38,"context_line":"`multiple issues \u003chttps://specs.openstack.org/openstack/oslo-specs/specs/victoria/policy-json-to-yaml.html#problem-description\u003e`_ ."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f560f44_71993c1d","line":35,"range":{"start_line":35,"start_character":0,"end_line":35,"end_character":12},"in_reply_to":"9f560f44_b99f40b2","updated":"2020-08-26 16:57:59.000000000","message":"Done","commit_id":"8f570da7ffc379fc9bb1219b0451af24eb91c332"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"000fb3449a09920532abe3cdf3aaafb1aee04cb7","unresolved":false,"context_lines":[{"line_number":40,"context_line":"defaults and scope feature from keystone."},{"line_number":41,"context_line":"Refer `this bug \u003chttps://bugs.launchpad.net/nova/+bug/1875418\u003e`_ for details."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"In future release, oslo policy will be deprecating the json formatted policy"},{"line_number":44,"context_line":"file support and to have a smooth migration to yaml formatted policy file"},{"line_number":45,"context_line":"you can use this tool to convert your existing json formatted file to yaml"},{"line_number":46,"context_line":"file."}],"source_content_type":"text/x-rst","patch_set":2,"id":"9f560f44_25de5e6c","line":43,"range":{"start_line":43,"start_character":35,"end_line":43,"end_character":50},"updated":"2020-08-26 16:09:53.000000000","message":"remove","commit_id":"2f9ec7a6b9b46b2641170c29925c46fcc194c914"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9d33abcc9e90609c3988b383e34d002451417c0c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"defaults and scope feature from keystone."},{"line_number":41,"context_line":"Refer `this bug \u003chttps://bugs.launchpad.net/nova/+bug/1875418\u003e`_ for details."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"In future release, oslo policy will be deprecating the json formatted policy"},{"line_number":44,"context_line":"file support and to have a smooth migration to yaml formatted policy file"},{"line_number":45,"context_line":"you can use this tool to convert your existing json formatted file to yaml"},{"line_number":46,"context_line":"file."}],"source_content_type":"text/x-rst","patch_set":2,"id":"9f560f44_d40e3130","line":43,"range":{"start_line":43,"start_character":35,"end_line":43,"end_character":50},"in_reply_to":"9f560f44_25de5e6c","updated":"2020-08-26 16:57:59.000000000","message":"Done","commit_id":"2f9ec7a6b9b46b2641170c29925c46fcc194c914"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"47b1eab15512df0cef1deb465843ea1f2d280993","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Description"},{"line_number":19,"context_line":"-----------"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The ``oslopolicy-convert-json-to-yaml`` tool can be used to convert the json"},{"line_number":22,"context_line":"format policy file to yaml format. It takes json formatted policy file as input"},{"line_number":23,"context_line":"and convert it to a yaml formatted policy file similar to"},{"line_number":24,"context_line":"``oslopolicy-sample-generator`` tool except keeping the overridden rule"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9f560f44_3cc82220","line":21,"range":{"start_line":21,"start_character":72,"end_line":21,"end_character":76},"updated":"2020-08-27 15:56:19.000000000","message":"JSON (here and elsewhere)","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"89588e3c5aac5997bf53b6bb9a2c110a513d48d2","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Description"},{"line_number":19,"context_line":"-----------"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The ``oslopolicy-convert-json-to-yaml`` tool can be used to convert the json"},{"line_number":22,"context_line":"format policy file to yaml format. It takes json formatted policy file as input"},{"line_number":23,"context_line":"and convert it to a yaml formatted policy file similar to"},{"line_number":24,"context_line":"``oslopolicy-sample-generator`` tool except keeping the overridden rule"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9f560f44_7fb3ac0a","line":21,"range":{"start_line":21,"start_character":72,"end_line":21,"end_character":76},"in_reply_to":"9f560f44_3cc82220","updated":"2020-08-27 16:06:21.000000000","message":"Done","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"47b1eab15512df0cef1deb465843ea1f2d280993","unresolved":false,"context_lines":[{"line_number":19,"context_line":"-----------"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The ``oslopolicy-convert-json-to-yaml`` tool can be used to convert the json"},{"line_number":22,"context_line":"format policy file to yaml format. It takes json formatted policy file as input"},{"line_number":23,"context_line":"and convert it to a yaml formatted policy file similar to"},{"line_number":24,"context_line":"``oslopolicy-sample-generator`` tool except keeping the overridden rule"},{"line_number":25,"context_line":"as uncommented. It does the following:"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9f560f44_1ccb9e1d","line":22,"range":{"start_line":22,"start_character":22,"end_line":22,"end_character":26},"updated":"2020-08-27 15:56:19.000000000","message":"YAML (here and elsewhere)","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"89588e3c5aac5997bf53b6bb9a2c110a513d48d2","unresolved":false,"context_lines":[{"line_number":19,"context_line":"-----------"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The ``oslopolicy-convert-json-to-yaml`` tool can be used to convert the json"},{"line_number":22,"context_line":"format policy file to yaml format. It takes json formatted policy file as input"},{"line_number":23,"context_line":"and convert it to a yaml formatted policy file similar to"},{"line_number":24,"context_line":"``oslopolicy-sample-generator`` tool except keeping the overridden rule"},{"line_number":25,"context_line":"as uncommented. It does the following:"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9f560f44_5fb6a8fa","line":22,"range":{"start_line":22,"start_character":22,"end_line":22,"end_character":26},"in_reply_to":"9f560f44_1ccb9e1d","updated":"2020-08-27 16:06:21.000000000","message":"Done","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"47b1eab15512df0cef1deb465843ea1f2d280993","unresolved":false,"context_lines":[{"line_number":38,"context_line":"`multiple issues \u003chttps://specs.openstack.org/openstack/oslo-specs/specs/victoria/policy-json-to-yaml.html#problem-description\u003e`_ ."},{"line_number":39,"context_line":"One of the key issue came up while nova switched to the new policy with new"},{"line_number":40,"context_line":"defaults and scope feature from keystone."},{"line_number":41,"context_line":"Refer `this bug \u003chttps://bugs.launchpad.net/nova/+bug/1875418\u003e`_ for details."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"In future release, oslo policy will remove the json formatted policy"},{"line_number":44,"context_line":"file support and to have a smooth migration to yaml formatted policy file"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9f560f44_dc4766a2","line":41,"range":{"start_line":41,"start_character":0,"end_line":41,"end_character":6},"updated":"2020-08-27 15:56:19.000000000","message":"Refer to","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"89588e3c5aac5997bf53b6bb9a2c110a513d48d2","unresolved":false,"context_lines":[{"line_number":38,"context_line":"`multiple issues \u003chttps://specs.openstack.org/openstack/oslo-specs/specs/victoria/policy-json-to-yaml.html#problem-description\u003e`_ ."},{"line_number":39,"context_line":"One of the key issue came up while nova switched to the new policy with new"},{"line_number":40,"context_line":"defaults and scope feature from keystone."},{"line_number":41,"context_line":"Refer `this bug \u003chttps://bugs.launchpad.net/nova/+bug/1875418\u003e`_ for details."},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"In future release, oslo policy will remove the json formatted policy"},{"line_number":44,"context_line":"file support and to have a smooth migration to yaml formatted policy file"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9f560f44_9fcb2070","line":41,"range":{"start_line":41,"start_character":0,"end_line":41,"end_character":6},"in_reply_to":"9f560f44_dc4766a2","updated":"2020-08-27 16:06:21.000000000","message":"Done","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"}],"oslo_policy/generator.py":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"32d8fbe95f42511871dc34e233fd1c62d8d71d0c","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    \"\"\"Create a yaml node from policy.RuleDefault or policy.DocumentedRuleDefault."},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    :param default: A policy.RuleDefault or policy.DocumentedRuleDefault object"},{"line_number":158,"context_line":"    :param comment_rule: By default rules will be commentout out in generated"},{"line_number":159,"context_line":"                         yaml format text. If you want to keep few or all rules"},{"line_number":160,"context_line":"                         uncommented then pass this arg as False."},{"line_number":161,"context_line":"    :param add_deprecated_rules: Whether to add the deprecated rules in format"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_f97ed867","line":158,"range":{"start_line":158,"start_character":50,"end_line":158,"end_character":60},"updated":"2020-08-26 10:27:43.000000000","message":"commented","commit_id":"8f570da7ffc379fc9bb1219b0451af24eb91c332"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9d33abcc9e90609c3988b383e34d002451417c0c","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    \"\"\"Create a yaml node from policy.RuleDefault or policy.DocumentedRuleDefault."},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    :param default: A policy.RuleDefault or policy.DocumentedRuleDefault object"},{"line_number":158,"context_line":"    :param comment_rule: By default rules will be commentout out in generated"},{"line_number":159,"context_line":"                         yaml format text. If you want to keep few or all rules"},{"line_number":160,"context_line":"                         uncommented then pass this arg as False."},{"line_number":161,"context_line":"    :param add_deprecated_rules: Whether to add the deprecated rules in format"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_118a80bd","line":158,"range":{"start_line":158,"start_character":50,"end_line":158,"end_character":60},"in_reply_to":"9f560f44_f97ed867","updated":"2020-08-26 16:57:59.000000000","message":"Done","commit_id":"8f570da7ffc379fc9bb1219b0451af24eb91c332"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"000fb3449a09920532abe3cdf3aaafb1aee04cb7","unresolved":false,"context_lines":[{"line_number":413,"context_line":"def _convert_policy_json_to_yaml(namespace, policy_file,"},{"line_number":414,"context_line":"                                 output_file\u003dNone):"},{"line_number":415,"context_line":"    with open(policy_file, \u0027r\u0027) as rule_data:"},{"line_number":416,"context_line":"        file_policies \u003d jsonutils.loads(rule_data.read())"},{"line_number":417,"context_line":"    yaml_format_rules \u003d []"},{"line_number":418,"context_line":"    default_policies \u003d get_policies_dict(namespace)"},{"line_number":419,"context_line":"    for section in sorted(default_policies.keys()):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_656b3684","line":416,"updated":"2020-08-26 16:09:53.000000000","message":"nit: newline under this would be nice","commit_id":"2f9ec7a6b9b46b2641170c29925c46fcc194c914"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9d33abcc9e90609c3988b383e34d002451417c0c","unresolved":false,"context_lines":[{"line_number":413,"context_line":"def _convert_policy_json_to_yaml(namespace, policy_file,"},{"line_number":414,"context_line":"                                 output_file\u003dNone):"},{"line_number":415,"context_line":"    with open(policy_file, \u0027r\u0027) as rule_data:"},{"line_number":416,"context_line":"        file_policies \u003d jsonutils.loads(rule_data.read())"},{"line_number":417,"context_line":"    yaml_format_rules \u003d []"},{"line_number":418,"context_line":"    default_policies \u003d get_policies_dict(namespace)"},{"line_number":419,"context_line":"    for section in sorted(default_policies.keys()):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_74292588","line":416,"in_reply_to":"9f560f44_656b3684","updated":"2020-08-26 16:57:59.000000000","message":"Done","commit_id":"2f9ec7a6b9b46b2641170c29925c46fcc194c914"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"000fb3449a09920532abe3cdf3aaafb1aee04cb7","unresolved":false,"context_lines":[{"line_number":419,"context_line":"    for section in sorted(default_policies.keys()):"},{"line_number":420,"context_line":"        default_rules \u003d default_policies[section]"},{"line_number":421,"context_line":"        for default_rule in default_rules:"},{"line_number":422,"context_line":"            if default_rule.name in file_policies:"},{"line_number":423,"context_line":"                file_rule_check_str \u003d file_policies.pop(default_rule.name)"},{"line_number":424,"context_line":"                # Few rules might be still RuleDefault object so let\u0027s prepare"},{"line_number":425,"context_line":"                # empty \u0027operations\u0027 list for those."}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_451432e9","line":422,"updated":"2020-08-26 16:09:53.000000000","message":"nit:\n\n  if default_rule.name not in file_policies:\n      continue\n\n  file_rule_check_str \u003d file_policies.pop(default_rule.name)\n  ...","commit_id":"2f9ec7a6b9b46b2641170c29925c46fcc194c914"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"9d33abcc9e90609c3988b383e34d002451417c0c","unresolved":false,"context_lines":[{"line_number":419,"context_line":"    for section in sorted(default_policies.keys()):"},{"line_number":420,"context_line":"        default_rules \u003d default_policies[section]"},{"line_number":421,"context_line":"        for default_rule in default_rules:"},{"line_number":422,"context_line":"            if default_rule.name in file_policies:"},{"line_number":423,"context_line":"                file_rule_check_str \u003d file_policies.pop(default_rule.name)"},{"line_number":424,"context_line":"                # Few rules might be still RuleDefault object so let\u0027s prepare"},{"line_number":425,"context_line":"                # empty \u0027operations\u0027 list for those."}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_9422f9a1","line":422,"in_reply_to":"9f560f44_451432e9","updated":"2020-08-26 16:57:59.000000000","message":"Done","commit_id":"2f9ec7a6b9b46b2641170c29925c46fcc194c914"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"47b1eab15512df0cef1deb465843ea1f2d280993","unresolved":false,"context_lines":[{"line_number":410,"context_line":"    return return_code"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"def _convert_policy_json_to_yaml(namespace, policy_file,"},{"line_number":414,"context_line":"                                 output_file\u003dNone):"},{"line_number":415,"context_line":"    with open(policy_file, \u0027r\u0027) as rule_data:"},{"line_number":416,"context_line":"        file_policies \u003d jsonutils.loads(rule_data.read())"},{"line_number":417,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_7c6a9aec","line":414,"range":{"start_line":413,"start_character":0,"end_line":414,"end_character":51},"updated":"2020-08-27 15:56:19.000000000","message":"nit: can fit on one line","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"89588e3c5aac5997bf53b6bb9a2c110a513d48d2","unresolved":false,"context_lines":[{"line_number":410,"context_line":"    return return_code"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"def _convert_policy_json_to_yaml(namespace, policy_file,"},{"line_number":414,"context_line":"                                 output_file\u003dNone):"},{"line_number":415,"context_line":"    with open(policy_file, \u0027r\u0027) as rule_data:"},{"line_number":416,"context_line":"        file_policies \u003d jsonutils.loads(rule_data.read())"},{"line_number":417,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_7fa8cc8a","line":414,"range":{"start_line":413,"start_character":0,"end_line":414,"end_character":51},"in_reply_to":"9f560f44_7c6a9aec","updated":"2020-08-27 16:06:21.000000000","message":"Done","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"47b1eab15512df0cef1deb465843ea1f2d280993","unresolved":false,"context_lines":[{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    yaml_format_rules \u003d []"},{"line_number":419,"context_line":"    default_policies \u003d get_policies_dict(namespace)"},{"line_number":420,"context_line":"    for section in sorted(default_policies.keys()):"},{"line_number":421,"context_line":"        default_rules \u003d default_policies[section]"},{"line_number":422,"context_line":"        for default_rule in default_rules:"},{"line_number":423,"context_line":"            if default_rule.name not in file_policies:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_fc7d0ab2","line":420,"range":{"start_line":420,"start_character":42,"end_line":420,"end_character":49},"updated":"2020-08-27 15:56:19.000000000","message":"unnecessary (sorted on a dict sorts the keys)","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"89588e3c5aac5997bf53b6bb9a2c110a513d48d2","unresolved":false,"context_lines":[{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    yaml_format_rules \u003d []"},{"line_number":419,"context_line":"    default_policies \u003d get_policies_dict(namespace)"},{"line_number":420,"context_line":"    for section in sorted(default_policies.keys()):"},{"line_number":421,"context_line":"        default_rules \u003d default_policies[section]"},{"line_number":422,"context_line":"        for default_rule in default_rules:"},{"line_number":423,"context_line":"            if default_rule.name not in file_policies:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_bf954442","line":420,"range":{"start_line":420,"start_character":42,"end_line":420,"end_character":49},"in_reply_to":"9f560f44_fc7d0ab2","updated":"2020-08-27 16:06:21.000000000","message":"Done","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"47b1eab15512df0cef1deb465843ea1f2d280993","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        for default_rule in default_rules:"},{"line_number":423,"context_line":"            if default_rule.name not in file_policies:"},{"line_number":424,"context_line":"                continue"},{"line_number":425,"context_line":"            file_rule_check_str \u003d file_policies.pop(default_rule.name)"},{"line_number":426,"context_line":"            # Few rules might be still RuleDefault object so let\u0027s prepare"},{"line_number":427,"context_line":"            # empty \u0027operations\u0027 list for those."},{"line_number":428,"context_line":"            operations \u003d [{"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_1c50be31","line":425,"updated":"2020-08-27 15:56:19.000000000","message":"What happens if you have duplicate policies in a file currently? Is that even allowed? With this, we\u0027ll take the first one and ignore all the others. Is that behavior consistent with how we evaluate them (again, assuming you can even have duplicates currently)","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"89588e3c5aac5997bf53b6bb9a2c110a513d48d2","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        for default_rule in default_rules:"},{"line_number":423,"context_line":"            if default_rule.name not in file_policies:"},{"line_number":424,"context_line":"                continue"},{"line_number":425,"context_line":"            file_rule_check_str \u003d file_policies.pop(default_rule.name)"},{"line_number":426,"context_line":"            # Few rules might be still RuleDefault object so let\u0027s prepare"},{"line_number":427,"context_line":"            # empty \u0027operations\u0027 list for those."},{"line_number":428,"context_line":"            operations \u003d [{"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_ffd7bcec","line":425,"in_reply_to":"9f560f44_1c50be31","updated":"2020-08-27 16:06:21.000000000","message":"duplicates are allowed (i mean no error on this), while loading rule from file it is added in self.files_rules one by one and the last one found override the all previous one\n- https://github.com/openstack/oslo.policy/blob/a626ad12fe5a3abd49d70e3e5b95589d279ab578/oslo_policy/policy.py#L825\n\nIn this tool, if there is any duplicate then we will keep those at the end of file with warning text L460 but will no remove it. This way we can keep the backward compatibility and will not break existing deployment and let oslo.policy load the file same way as it was doing with json file.","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"47b1eab15512df0cef1deb465843ea1f2d280993","unresolved":false,"context_lines":[{"line_number":423,"context_line":"            if default_rule.name not in file_policies:"},{"line_number":424,"context_line":"                continue"},{"line_number":425,"context_line":"            file_rule_check_str \u003d file_policies.pop(default_rule.name)"},{"line_number":426,"context_line":"            # Few rules might be still RuleDefault object so let\u0027s prepare"},{"line_number":427,"context_line":"            # empty \u0027operations\u0027 list for those."},{"line_number":428,"context_line":"            operations \u003d [{"},{"line_number":429,"context_line":"                \u0027method\u0027: \u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_7c43ba6c","line":426,"range":{"start_line":426,"start_character":14,"end_line":426,"end_character":17},"updated":"2020-08-27 15:56:19.000000000","message":"Some","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"89588e3c5aac5997bf53b6bb9a2c110a513d48d2","unresolved":false,"context_lines":[{"line_number":423,"context_line":"            if default_rule.name not in file_policies:"},{"line_number":424,"context_line":"                continue"},{"line_number":425,"context_line":"            file_rule_check_str \u003d file_policies.pop(default_rule.name)"},{"line_number":426,"context_line":"            # Few rules might be still RuleDefault object so let\u0027s prepare"},{"line_number":427,"context_line":"            # empty \u0027operations\u0027 list for those."},{"line_number":428,"context_line":"            operations \u003d [{"},{"line_number":429,"context_line":"                \u0027method\u0027: \u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_9f904050","line":426,"range":{"start_line":426,"start_character":14,"end_line":426,"end_character":17},"in_reply_to":"9f560f44_7c43ba6c","updated":"2020-08-27 16:06:21.000000000","message":"Done","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"47b1eab15512df0cef1deb465843ea1f2d280993","unresolved":false,"context_lines":[{"line_number":432,"context_line":"            if hasattr(default_rule, \u0027operations\u0027):"},{"line_number":433,"context_line":"                operations \u003d default_rule.operations"},{"line_number":434,"context_line":"            # Converting json file rules to DocumentedRuleDefault rules so"},{"line_number":435,"context_line":"            # that we can covert the json file to yaml including"},{"line_number":436,"context_line":"            # descriptions which is what \u0027oslopolicy-sample-generator\u0027"},{"line_number":437,"context_line":"            # tool does."},{"line_number":438,"context_line":"            file_rule \u003d policy.DocumentedRuleDefault("}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_dc512632","line":435,"range":{"start_line":435,"start_character":26,"end_line":435,"end_character":32},"updated":"2020-08-27 15:56:19.000000000","message":"convert","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"89588e3c5aac5997bf53b6bb9a2c110a513d48d2","unresolved":false,"context_lines":[{"line_number":432,"context_line":"            if hasattr(default_rule, \u0027operations\u0027):"},{"line_number":433,"context_line":"                operations \u003d default_rule.operations"},{"line_number":434,"context_line":"            # Converting json file rules to DocumentedRuleDefault rules so"},{"line_number":435,"context_line":"            # that we can covert the json file to yaml including"},{"line_number":436,"context_line":"            # descriptions which is what \u0027oslopolicy-sample-generator\u0027"},{"line_number":437,"context_line":"            # tool does."},{"line_number":438,"context_line":"            file_rule \u003d policy.DocumentedRuleDefault("}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_1f8ef02c","line":435,"range":{"start_line":435,"start_character":26,"end_line":435,"end_character":32},"in_reply_to":"9f560f44_dc512632","updated":"2020-08-27 16:06:21.000000000","message":"Done","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"47b1eab15512df0cef1deb465843ea1f2d280993","unresolved":false,"context_lines":[{"line_number":472,"context_line":"                     {\u0027name\u0027: file_rule,"},{"line_number":473,"context_line":"                      \u0027check_str\u0027: check_str})"},{"line_number":474,"context_line":"        yaml_format_rules.append(rule_text)"},{"line_number":475,"context_line":"    if output_file:"},{"line_number":476,"context_line":"        with open(output_file, \u0027w\u0027) as fh:"},{"line_number":477,"context_line":"            fh.writelines(yaml_format_rules)"},{"line_number":478,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_fc2b4a91","line":475,"updated":"2020-08-27 15:56:19.000000000","message":"nit: newline before this would be nice","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"89588e3c5aac5997bf53b6bb9a2c110a513d48d2","unresolved":false,"context_lines":[{"line_number":472,"context_line":"                     {\u0027name\u0027: file_rule,"},{"line_number":473,"context_line":"                      \u0027check_str\u0027: check_str})"},{"line_number":474,"context_line":"        yaml_format_rules.append(rule_text)"},{"line_number":475,"context_line":"    if output_file:"},{"line_number":476,"context_line":"        with open(output_file, \u0027w\u0027) as fh:"},{"line_number":477,"context_line":"            fh.writelines(yaml_format_rules)"},{"line_number":478,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_7f81ecfa","line":475,"in_reply_to":"9f560f44_fc2b4a91","updated":"2020-08-27 16:06:21.000000000","message":"Done","commit_id":"86f05627da821206fb0859dbd957b66dc9a43df1"}]}
