Skip to content

Commit

Permalink
Add more casts to int
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <[email protected]>
  • Loading branch information
alinabuzachis committed Jul 13, 2021
1 parent b0328c8 commit 24a9d47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/modules/ecs_taskdefinition.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,12 +829,12 @@ def main():

if linux_param == 'maxSwap' and launch_type == 'FARGATE':
module.fail_json(msg='maxSwap parameter is not supported with the FARGATE launch type.')
elif linux_param == 'maxSwap' and container['linuxParameters']['maxSwap'] < 0:
elif linux_param == 'maxSwap' and int(container['linuxParameters']['maxSwap']) < 0:
module.fail_json(msg='Accepted values for maxSwap are 0 or any positive integer.')

if (
linux_param == 'swappiness' and
(container['linuxParameters']['swappiness'] < 0 or container['linuxParameters']['swappiness'] > 100)
(int(container['linuxParameters']['swappiness']) < 0 or int(container['linuxParameters']['swappiness']) > 100)
):
module.fail_json(msg='Accepted values for swappiness are whole numbers between 0 and 100.')

Expand Down

0 comments on commit 24a9d47

Please sign in to comment.