|
|
@ -674,11 +674,22 @@ class MuxProcess(object):
|
|
|
|
self._setup_master()
|
|
|
|
self._setup_master()
|
|
|
|
self._setup_services()
|
|
|
|
self._setup_services()
|
|
|
|
|
|
|
|
|
|
|
|
# mock checking if sshpass exists; mitogen doesn't need it to ssh
|
|
|
|
# mock checking if sshpass exists
|
|
|
|
# TODO: confirm this
|
|
|
|
# NOTE: extreme hack:
|
|
|
|
# TODO TODO: this isn't working
|
|
|
|
# https://github.com/ansible/ansible/blob/v2.10.0/lib/ansible/plugins/connection/ssh.py#L577
|
|
|
|
ssh.SSHPASS_AVAILABLE = True
|
|
|
|
# is forcing 'sshpass' to exist but Mitogen doesn't need it
|
|
|
|
import epdb; epdb.set_trace()
|
|
|
|
# open to less hacky things here
|
|
|
|
|
|
|
|
# tried from ansible.plugins.connection import ssh; ssh.SSHPASS_AVAILABLE = True
|
|
|
|
|
|
|
|
# but we're in a socket call so that won't work, maybe there's another place we can set it?
|
|
|
|
|
|
|
|
# TODO: here's a place where it only applies to ansible 2.10+
|
|
|
|
|
|
|
|
# we could check distutils.version.LooseVersion(ansible.__version__).version for 2.10.0+
|
|
|
|
|
|
|
|
# won't work on python < 3.3
|
|
|
|
|
|
|
|
from unittest.mock import MagicMock
|
|
|
|
|
|
|
|
if not ssh.Connection(
|
|
|
|
|
|
|
|
play_context=MagicMock(), new_stdin=MagicMock(), shell='bash')._sshpass_available():
|
|
|
|
|
|
|
|
# create a dummy sshpass "program", somehow
|
|
|
|
|
|
|
|
print('MOCK SOMEHOW NOT HACKILY')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# Let the parent know our listening socket is ready.
|
|
|
|
# Let the parent know our listening socket is ready.
|
|
|
|