Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace uses of sort_json_policy_dict with compare_policies #52943

Merged
merged 3 commits into from
Feb 28, 2019

Conversation

s-hertel
Copy link
Contributor

SUMMARY

Use compare_policies since it is compatible with Python 3
remove sort_json_policy_dict from the AWS guidelines since it only works consistently on Python 2

Fixes #43029

ISSUE TYPE
  • Bugfix Pull Request

…compatible with Python 3 and remove sort_json_policy_dict from the AWS guidelines since it only works on Python 2
@ansibot
Copy link
Contributor

ansibot commented Feb 25, 2019

@ansibot
Copy link
Contributor

ansibot commented Feb 25, 2019

@s-hertel, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 aws bug This issue/PR relates to a bug. cloud core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. python3 support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 25, 2019
@samdoran samdoran self-assigned this Feb 26, 2019
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Feb 26, 2019
@@ -292,19 +292,15 @@ def run(ecr, params, verbosity):

elif policy_text is not None:
try:
policy = sort_json_policy_dict(policy)
Copy link
Contributor

@samdoran samdoran Feb 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing, not a blocker: Since this line is gone, the returned policy is no longer sorted but only when verbosity > 2. I'm not sure how much that matters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, missed that! I added a commit to sort policy lists only containing string types so it works on python 3.

@bretmartin
Copy link
Contributor

You are a scholar and a gentleperson. This works for me.

@samdoran samdoran merged commit 8a02f89 into ansible:devel Feb 28, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 aws bug This issue/PR relates to a bug. cloud core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. python3 support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sort_json_policy_dict in ec2 module utils does not work with multi-statement policies (affects iam_role et al)
4 participants