mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-07-25 00:44:46 +00:00
Fix deprecated imports in plugins/shell/csh.py
Replace deprecated module_utils imports: - ansible.module_utils.six.text_type -> str - ansible.module_utils.six.moves.shlex_quote -> shlex.quote Fixes #686 Co-authored-by: Cursor AI Signed-off-by: Pavel Bar <pbar@redhat.com>
This commit is contained in:
@@ -13,8 +13,7 @@ DOCUMENTATION = '''
|
|||||||
- shell_common
|
- shell_common
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from ansible.module_utils.six import text_type
|
from shlex import quote as shlex_quote
|
||||||
from ansible.module_utils.six.moves import shlex_quote
|
|
||||||
from ansible.plugins.shell import ShellBase
|
from ansible.plugins.shell import ShellBase
|
||||||
|
|
||||||
|
|
||||||
@@ -43,5 +42,5 @@ class ShellModule(ShellBase):
|
|||||||
ret = []
|
ret = []
|
||||||
# All the -u options must be first, so we process them first
|
# All the -u options must be first, so we process them first
|
||||||
ret += ['-u %s' % k for k, v in kwargs.items() if v is None]
|
ret += ['-u %s' % k for k, v in kwargs.items() if v is None]
|
||||||
ret += ['%s=%s' % (k, shlex_quote(text_type(v))) for k, v in kwargs.items() if v is not None]
|
ret += ['%s=%s' % (k, shlex_quote(str(v))) for k, v in kwargs.items() if v is not None]
|
||||||
return 'env %s' % ' '.join(ret)
|
return 'env %s' % ' '.join(ret)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
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
|
||||||
tests/unit/mock/yaml_helper.py pylint:ansible-bad-import-from
|
tests/unit/mock/yaml_helper.py pylint:ansible-bad-import-from
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
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
|
||||||
tests/unit/mock/yaml_helper.py pylint:ansible-bad-import-from
|
tests/unit/mock/yaml_helper.py pylint:ansible-bad-import-from
|
||||||
|
|||||||
Reference in New Issue
Block a user