|
|
@ -185,12 +185,20 @@ class SysctlModule(object):
|
|
|
|
def _parse_value(self, value):
|
|
|
|
def _parse_value(self, value):
|
|
|
|
if value is None:
|
|
|
|
if value is None:
|
|
|
|
return ''
|
|
|
|
return ''
|
|
|
|
elif value.lower() in BOOLEANS_TRUE:
|
|
|
|
elif isinstance(value, bool):
|
|
|
|
return '1'
|
|
|
|
if value:
|
|
|
|
elif value.lower() in BOOLEANS_FALSE:
|
|
|
|
return '1'
|
|
|
|
return '0'
|
|
|
|
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:
|
|
|
|
else:
|
|
|
|
return value.strip()
|
|
|
|
return value
|
|
|
|
|
|
|
|
|
|
|
|
# ==============================================================
|
|
|
|
# ==============================================================
|
|
|
|
# SYSCTL COMMAND MANAGEMENT
|
|
|
|
# SYSCTL COMMAND MANAGEMENT
|
|
|
|