From 6402d36af3db7cc556cca0dd6fa31e75a8e24013 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 26 Jul 2016 09:52:16 -0400 Subject: [PATCH] now using type=json which takes care of str/dict --- cloud/amazon/s3_bucket.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cloud/amazon/s3_bucket.py b/cloud/amazon/s3_bucket.py index f8582e0b5f1..7b283bf313e 100644 --- a/cloud/amazon/s3_bucket.py +++ b/cloud/amazon/s3_bucket.py @@ -199,13 +199,7 @@ def _create_or_update_bucket(connection, module, location): module.fail_json(msg=e.message) if policy is not None: - # Deal with policy if either JSON formatted string or just data structure - if isinstance(policy, basestring): - compare_policy = json.dumps(policy) - load_policy = policy - else: - compare_policy = policy - load_policy = json.loads(policy) + compare_policy = json.loads(policy) if current_policy is None or json.loads(current_policy) != compare_policy: try: @@ -346,7 +340,7 @@ def main(): argument_spec.update( dict( force = dict(required=False, default='no', type='bool'), - policy = dict(required=False), + policy = dict(required=False, type='json'), name = dict(required=True, type='str'), requester_pays = dict(default='no', type='bool'), s3_url = dict(aliases=['S3_URL'], type='str'),