Skip to content

Commit

Permalink
[cloud][py3] Fix AttributeError in iam_policy on python3 (ansible#30551)
Browse files Browse the repository at this point in the history
  • Loading branch information
vutenkov authored and ryansb committed Sep 20, 2017
1 parent a030472 commit 875153d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ansible/modules/cloud/amazon/iam_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
'''
import json
import urllib

try:
import boto
Expand All @@ -131,6 +130,7 @@
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ec2 import connect_to_aws, ec2_argument_spec, get_aws_connection_info, boto_exception
from ansible.module_utils.six import string_types
from ansible.module_utils.six.moves import urllib


def user_action(module, iam, name, policy_name, skip, pdoc, state):
Expand All @@ -145,7 +145,7 @@ def user_action(module, iam, name, policy_name, skip, pdoc, state):
'''
urllib is needed here because boto returns url encoded strings instead
'''
if urllib.unquote(iam.get_user_policy(name, pol).
if urllib.parse.unquote(iam.get_user_policy(name, pol).
get_user_policy_result.policy_document) == pdoc:
policy_match = True
matching_policies.append(pol)
Expand Down Expand Up @@ -194,7 +194,7 @@ def role_action(module, iam, name, policy_name, skip, pdoc, state):
try:
matching_policies = []
for pol in current_policies:
if urllib.unquote(iam.get_role_policy(name, pol).
if urllib.parse.unquote(iam.get_role_policy(name, pol).
get_role_policy_result.policy_document) == pdoc:
policy_match = True
matching_policies.append(pol)
Expand Down Expand Up @@ -239,7 +239,7 @@ def group_action(module, iam, name, policy_name, skip, pdoc, state):
policy_names]
matching_policies = []
for pol in current_policies:
if urllib.unquote(iam.get_group_policy(name, pol).
if urllib.parse.unquote(iam.get_group_policy(name, pol).
get_group_policy_result.policy_document) == pdoc:
policy_match = True
matching_policies.append(pol)
Expand Down

0 comments on commit 875153d

Please sign in to comment.