test_s3: modify make_json_policy to support conditionals

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
This commit is contained in:
Abhishek Lekshmanan 2017-10-13 16:31:38 +02:00
parent eee2d9a82c
commit fe35325ab8

View file

@ -8754,8 +8754,11 @@ def make_json_policy(action, resource, principal={"AWS": "*"}, conditions=None):
}] }]
} }
if conditions is not None: # Currently lets only support adding a common conditional to every
policy["Statement"]["Condition"] = conditions # statement in this function
for statement in policy["Statement"]:
if conditions is not None:
statement["Condition"] = conditions
return json.dumps(policy) return json.dumps(policy)