mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 15:34:01 -07:00
python3 compatiblity
remove use of basestring deal with configparser
This commit is contained in:
parent
943e4d37f5
commit
5b11494437
5 changed files with 13 additions and 7 deletions
|
@ -607,7 +607,8 @@ class TaskExecutor:
|
|||
try:
|
||||
cmd = subprocess.Popen(['ssh','-o','ControlPersist'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
(out, err) = cmd.communicate()
|
||||
if "Bad configuration option" in err or "Usage:" in err:
|
||||
err = to_unicode(err)
|
||||
if u"Bad configuration option" in err or u"Usage:" in err:
|
||||
conn_type = "paramiko"
|
||||
except OSError:
|
||||
conn_type = "paramiko"
|
||||
|
@ -645,7 +646,9 @@ class TaskExecutor:
|
|||
try:
|
||||
connection._connect()
|
||||
except AnsibleConnectionFailure:
|
||||
display.debug('connection failed, fallback to accelerate')
|
||||
res = handler._execute_module(module_name='accelerate', module_args=accelerate_args, task_vars=variables, delete_remote_tmp=False)
|
||||
display.debug(res)
|
||||
connection._connect()
|
||||
|
||||
return connection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue