Merge "Fix oslo policy DeprecatedRule warnings"

This commit is contained in:
Zuul 2021-07-06 11:03:55 +00:00 committed by Gerrit Code Review
commit 8c8e1a94f8
3 changed files with 66 additions and 83 deletions

View File

@ -72,16 +72,17 @@ rules = [
'policy in the supplied policy.json file.',
deprecated_rule=policy.DeprecatedRule(
name='default',
check_str='role:admin'),
check_str='role:admin',
deprecated_reason='In order to allow operators to '
'accept the default policies from code by not defining '
'them in the policy file, while still working with old '
'policy files that rely on the ``default`` rule for '
'policies that are not specified in the policy file, '
'the ``default`` rule must now be explicitly set to '
'``"role:admin"`` when that is the desired default for '
'unspecified rules.',
deprecated_since='Ussuri'),
'accept the default policies from code by not '
'defining them in the policy file, while still '
'working with old policy files that rely on the '
'``default`` rule for policies that are '
'not specified in the policy file, the ``default`` '
'rule must now be explicitly set to '
'``"role:admin"`` when that is the desired default '
'for unspecified rules.',
deprecated_since='Ussuri')),
policy.RuleDefault(name='context_is_admin', check_str='role:admin',
description='Defines the rule for the is_admin:True '
'check.'),

View File

@ -31,10 +31,9 @@ image_policies = [
'method': 'POST'}
],
deprecated_rule=policy.DeprecatedRule(
name="add_image", check_str="rule:default"
),
name="add_image", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY)
),
policy.DocumentedRuleDefault(
name="delete_image",
@ -46,10 +45,9 @@ image_policies = [
'method': 'DELETE'}
],
deprecated_rule=policy.DeprecatedRule(
name="delete_image", check_str="rule:default"
),
name="delete_image", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="get_image",
@ -61,10 +59,9 @@ image_policies = [
'method': 'GET'}
],
deprecated_rule=policy.DeprecatedRule(
name="get_image", check_str="rule:default"
),
name="get_image", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="get_images",
@ -76,10 +73,9 @@ image_policies = [
'method': 'GET'}
],
deprecated_rule=policy.DeprecatedRule(
name="get_images", check_str="rule:default"
),
name="get_images", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="modify_image",
@ -91,10 +87,9 @@ image_policies = [
'method': 'PATCH'}
],
deprecated_rule=policy.DeprecatedRule(
name="modify_image", check_str="rule:default"
),
name="modify_image", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="publicize_image",
@ -116,10 +111,9 @@ image_policies = [
'method': 'PATCH'}
],
deprecated_rule=policy.DeprecatedRule(
name="communitize_image", check_str="rule:default"
),
name="communitize_image", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
@ -132,10 +126,9 @@ image_policies = [
'method': 'GET'}
],
deprecated_rule=policy.DeprecatedRule(
name="download_image", check_str="rule:default"
),
name="download_image", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="upload_image",
@ -147,10 +140,9 @@ image_policies = [
'method': 'PUT'}
],
deprecated_rule=policy.DeprecatedRule(
name="upload_image", check_str="rule:default"
),
name="upload_image", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
@ -163,10 +155,9 @@ image_policies = [
'method': 'PATCH'}
],
deprecated_rule=policy.DeprecatedRule(
name="delete_image_location", check_str="rule:default"
),
name="delete_image_location", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="get_image_location",
@ -178,10 +169,9 @@ image_policies = [
'method': 'GET'}
],
deprecated_rule=policy.DeprecatedRule(
name="get_image_location", check_str="rule:default"
),
name="get_image_location", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="set_image_location",
@ -193,10 +183,9 @@ image_policies = [
'method': 'PATCH'}
],
deprecated_rule=policy.DeprecatedRule(
name="set_image_location", check_str="rule:default"
),
name="set_image_location", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
@ -209,10 +198,9 @@ image_policies = [
'method': 'POST'}
],
deprecated_rule=policy.DeprecatedRule(
name="add_member", check_str="rule:default"
),
name="add_member", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="delete_member",
@ -224,10 +212,9 @@ image_policies = [
'method': 'DELETE'}
],
deprecated_rule=policy.DeprecatedRule(
name="delete_member", check_str="rule:default"
),
name="delete_member", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="get_member",
@ -239,10 +226,9 @@ image_policies = [
'method': 'GET'}
],
deprecated_rule=policy.DeprecatedRule(
name="get_member", check_str="rule:default"
),
name="get_member", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="get_members",
@ -254,10 +240,9 @@ image_policies = [
'method': 'GET'}
],
deprecated_rule=policy.DeprecatedRule(
name="get_members", check_str="rule:default"
),
name="get_members", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="modify_member",
@ -269,10 +254,9 @@ image_policies = [
'method': 'PUT'}
],
deprecated_rule=policy.DeprecatedRule(
name="modify_member", check_str="rule:default"
),
name="modify_member", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.RuleDefault(
@ -295,10 +279,9 @@ image_policies = [
'method': 'POST'}
],
deprecated_rule=policy.DeprecatedRule(
name="deactivate", check_str="rule:default"
),
name="deactivate", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(
name="reactivate",
@ -310,10 +293,9 @@ image_policies = [
'method': 'POST'}
],
deprecated_rule=policy.DeprecatedRule(
name="reactivate", check_str="rule:default"
),
name="reactivate", check_str="rule:default",
deprecated_reason=DEPRECATED_REASON,
deprecated_since=versionutils.deprecated.WALLABY
deprecated_since=versionutils.deprecated.WALLABY),
),
policy.DocumentedRuleDefault(

View File

@ -43,7 +43,7 @@ oslo.log>=4.3.0 # Apache-2.0
oslo.messaging>=5.29.0,!=9.0.0 # Apache-2.0
oslo.middleware>=3.31.0 # Apache-2.0
oslo.reports>=1.18.0 # Apache-2.0
oslo.policy>=3.6.2 # Apache-2.0
oslo.policy>=3.7.0 # Apache-2.0
retrying!=1.3.0,>=1.2.3 # Apache-2.0
osprofiler>=1.4.0 # Apache-2.0