mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-17 22:30:59 +00:00
booleanize value for ternary
This commit is contained in:
@@ -205,7 +205,7 @@ def regex_search(value, regex, *args, **kwargs):
|
||||
|
||||
def ternary(value, true_val, false_val):
|
||||
''' value ? true_val : false_val '''
|
||||
if value:
|
||||
if bool(value):
|
||||
return true_val
|
||||
else:
|
||||
return false_val
|
||||
|
||||
Reference in New Issue
Block a user