mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-03-07 10:05:18 +01:00
Fix deprecated imports in plugins/modules/sysctl.py
Replace deprecated module_utils imports: - ansible.module_utils._text -> ansible.module_utils.common.text.converters - ansible.module_utils.six.string_types -> str Fixes #686 Co-authored-by: Cursor AI Signed-off-by: Pavel Bar <pbar@redhat.com>
This commit is contained in:
parent
9eeacedd72
commit
b8b424e4ee
2 changed files with 2 additions and 4 deletions
|
|
@ -110,9 +110,8 @@ import re
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.six import string_types
|
from ansible.module_utils.common.text.converters import to_native
|
||||||
from ansible.module_utils.parsing.convert_bool import BOOLEANS_FALSE, BOOLEANS_TRUE
|
from ansible.module_utils.parsing.convert_bool import BOOLEANS_FALSE, BOOLEANS_TRUE
|
||||||
from ansible.module_utils._text import to_native
|
|
||||||
|
|
||||||
|
|
||||||
class SysctlModule(object):
|
class SysctlModule(object):
|
||||||
|
|
@ -224,7 +223,7 @@ class SysctlModule(object):
|
||||||
return '1'
|
return '1'
|
||||||
else:
|
else:
|
||||||
return '0'
|
return '0'
|
||||||
elif isinstance(value, string_types):
|
elif isinstance(value, str):
|
||||||
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:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
tests/utils/shippable/timing.py shebang
|
tests/utils/shippable/timing.py shebang
|
||||||
plugins/modules/sysctl.py pylint:ansible-bad-import-from
|
|
||||||
plugins/shell/csh.py pylint:ansible-bad-import-from
|
plugins/shell/csh.py pylint:ansible-bad-import-from
|
||||||
plugins/shell/fish.py pylint:ansible-bad-import-from
|
plugins/shell/fish.py pylint:ansible-bad-import-from
|
||||||
tests/unit/mock/procenv.py pylint:ansible-bad-import-from
|
tests/unit/mock/procenv.py pylint:ansible-bad-import-from
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue