Skip to content

Commit

Permalink
fix sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
marknet15 committed Jan 27, 2022
1 parent 88772c7 commit d7307ba
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/modules/iam_managed_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ def get_or_create_policy_version(policy, policy_document):

for v in versions:
try:
document = client.get_policy_version(PolicyArn=policy['Arn'],
VersionId=v['VersionId'])['PolicyVersion']['Document']
document = client.get_policy_version(PolicyArn=policy['Arn'], VersionId=v['VersionId'])['PolicyVersion']['Document']
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
module.fail_json_aws(e, msg="Couldn't get policy version {0}".format(v['VersionId']))

Expand Down Expand Up @@ -281,8 +280,7 @@ def create_or_update_policy(existing_policy):

# Create policy when none already exists
try:
rvalue = client.create_policy(PolicyName=name, Path='/',
PolicyDocument=policy, Description=description)
rvalue = client.create_policy(PolicyName=name, Path='/', PolicyDocument=policy, Description=description)
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
module.fail_json_aws(e, msg="Couldn't create policy {0}".format(name))

Expand Down

0 comments on commit d7307ba

Please sign in to comment.