mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
now handles non string values for sysctl
This commit is contained in:
parent
4097cbf317
commit
8405edd5a2
1 changed files with 13 additions and 5 deletions
|
@ -185,12 +185,20 @@ class SysctlModule(object):
|
|||
def _parse_value(self, value):
|
||||
if value is None:
|
||||
return ''
|
||||
elif value.lower() in BOOLEANS_TRUE:
|
||||
elif isinstance(value, bool):
|
||||
if value:
|
||||
return '1'
|
||||
else:
|
||||
return '0'
|
||||
elif isinstance(value, basestring):
|
||||
if value.lower() in BOOLEANS_TRUE:
|
||||
return '1'
|
||||
elif value.lower() in BOOLEANS_FALSE:
|
||||
return '0'
|
||||
else:
|
||||
return value.strip()
|
||||
else:
|
||||
return value
|
||||
|
||||
# ==============================================================
|
||||
# SYSCTL COMMAND MANAGEMENT
|
||||
|
|
Loading…
Reference in a new issue