mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-03-07 10:05:18 +01:00
Fix deprecated imports in plugins/shell/fish.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:
parent
1d76c2ff5f
commit
a9bdfed194
2 changed files with 2 additions and 4 deletions
|
|
@ -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.sh import ShellModule as ShModule
|
from ansible.plugins.shell.sh import ShellModule as ShModule
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -42,7 +41,7 @@ class ShellModule(ShModule):
|
||||||
if v is None:
|
if v is None:
|
||||||
ret.append('set -e %s;' % k)
|
ret.append('set -e %s;' % k)
|
||||||
else:
|
else:
|
||||||
ret.append('set -lx %s %s;' % (k, shlex_quote(text_type(v))))
|
ret.append('set -lx %s %s;' % (k, shlex_quote(str(v))))
|
||||||
return ' '.join(ret)
|
return ' '.join(ret)
|
||||||
|
|
||||||
def build_module_command(self, env_string, shebang, cmd, arg_path=None):
|
def build_module_command(self, env_string, shebang, cmd, arg_path=None):
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
tests/utils/shippable/timing.py shebang
|
tests/utils/shippable/timing.py shebang
|
||||||
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
|
||||||
tests/unit/modules/conftest.py pylint:ansible-bad-import-from
|
tests/unit/modules/conftest.py pylint:ansible-bad-import-from
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue