mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
* Replace distutils.spawn.find_executable.
* Replace distutils.util.strtobool.
(cherry picked from commit 77b7b4f75b
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
89560ea2e7
commit
77bf1fedf5
6 changed files with 36 additions and 27 deletions
|
@ -26,7 +26,6 @@ DOCUMENTATION = '''
|
|||
- name: ansible_zone_host
|
||||
'''
|
||||
|
||||
import distutils.spawn
|
||||
import os
|
||||
import os.path
|
||||
import subprocess
|
||||
|
@ -34,6 +33,7 @@ import traceback
|
|||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils.six.moves import shlex_quote
|
||||
from ansible.module_utils.common.process import get_bin_path
|
||||
from ansible.module_utils.common.text.converters import to_bytes
|
||||
from ansible.plugins.connection import ConnectionBase, BUFSIZE
|
||||
from ansible.utils.display import Display
|
||||
|
@ -64,10 +64,10 @@ class Connection(ConnectionBase):
|
|||
|
||||
@staticmethod
|
||||
def _search_executable(executable):
|
||||
cmd = distutils.spawn.find_executable(executable)
|
||||
if not cmd:
|
||||
try:
|
||||
return get_bin_path(executable)
|
||||
except ValueError:
|
||||
raise AnsibleError("%s command not found in PATH" % executable)
|
||||
return cmd
|
||||
|
||||
def list_zones(self):
|
||||
process = subprocess.Popen([self.zoneadm_cmd, 'list', '-ip'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue