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):
}]
}
# Currently lets only support adding a common conditional to every
# statement in this function
for statement in policy["Statement"]:
if conditions is not None:
policy["Statement"]["Condition"] = conditions
statement["Condition"] = conditions
return json.dumps(policy)