forked from TrueCloudLab/s3-tests
test_s3: modify make_json_policy to support conditionals
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
This commit is contained in:
parent
eee2d9a82c
commit
fe35325ab8
1 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue