1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

sysctl: switch basestring to string_types (#24277)

This commit is contained in:
jctanner 2017-05-03 21:31:57 -04:00 committed by GitHub
parent 2052ed48d5
commit 08a3ea2221

View file

@ -119,6 +119,7 @@ EXAMPLES = '''
import os import os
import tempfile import tempfile
from ansible.module_utils.basic import get_platform, get_exception, AnsibleModule, BOOLEANS_TRUE, BOOLEANS_FALSE from ansible.module_utils.basic import get_platform, get_exception, AnsibleModule, BOOLEANS_TRUE, BOOLEANS_FALSE
from ansible.module_utils.six import string_types
class SysctlModule(object): class SysctlModule(object):
@ -216,7 +217,7 @@ class SysctlModule(object):
return '1' return '1'
else: else:
return '0' return '0'
elif isinstance(value, basestring): elif isinstance(value, string_types):
if value.lower() in BOOLEANS_TRUE: if value.lower() in BOOLEANS_TRUE:
return '1' return '1'
elif value.lower() in BOOLEANS_FALSE: elif value.lower() in BOOLEANS_FALSE: