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/synchronize.py
Replace deprecated module_utils imports: - ansible.module_utils._text -> ansible.module_utils.common.text.converters - 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
1b079a3d17
commit
bd5f969ef1
1 changed files with 9 additions and 2 deletions
|
|
@ -367,9 +367,16 @@ EXAMPLES = r'''
|
||||||
import os
|
import os
|
||||||
import errno
|
import errno
|
||||||
|
|
||||||
|
# TODO(Python2): shlex.quote was added in Python 3.3. This module may run on
|
||||||
|
# target hosts with Python 2.7 (e.g., older RHEL systems in CI integration tests).
|
||||||
|
# Remove the try/except fallback to pipes.quote when Python 2 support is dropped.
|
||||||
|
try:
|
||||||
|
from shlex import quote as shlex_quote
|
||||||
|
except ImportError:
|
||||||
|
from pipes import quote as shlex_quote
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils._text import to_bytes, to_native
|
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
||||||
from ansible.module_utils.six.moves import shlex_quote
|
|
||||||
|
|
||||||
|
|
||||||
client_addr = None
|
client_addr = None
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue