mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 04:34:24 -07:00
booleanize value for ternary
This commit is contained in:
parent
3ff67fc217
commit
035b4b95b0
1 changed files with 1 additions and 1 deletions
|
@ -205,7 +205,7 @@ def regex_search(value, regex, *args, **kwargs):
|
||||||
|
|
||||||
def ternary(value, true_val, false_val):
|
def ternary(value, true_val, false_val):
|
||||||
''' value ? true_val : false_val '''
|
''' value ? true_val : false_val '''
|
||||||
if value:
|
if bool(value):
|
||||||
return true_val
|
return true_val
|
||||||
else:
|
else:
|
||||||
return false_val
|
return false_val
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue