|
|
@ -195,7 +195,8 @@ def main():
|
|
|
|
# Use pexpect.runu in pexpect>=3.3,<4
|
|
|
|
# Use pexpect.runu in pexpect>=3.3,<4
|
|
|
|
out, rc = pexpect.runu(args, timeout=timeout, withexitstatus=True,
|
|
|
|
out, rc = pexpect.runu(args, timeout=timeout, withexitstatus=True,
|
|
|
|
events=events, cwd=chdir, echo=echo)
|
|
|
|
events=events, cwd=chdir, echo=echo)
|
|
|
|
except (TypeError, AttributeError), e:
|
|
|
|
except (TypeError, AttributeError):
|
|
|
|
|
|
|
|
e = get_exception()
|
|
|
|
# This should catch all insufficient versions of pexpect
|
|
|
|
# This should catch all insufficient versions of pexpect
|
|
|
|
# We deem them insufficient for their lack of ability to specify
|
|
|
|
# We deem them insufficient for their lack of ability to specify
|
|
|
|
# to not echo responses via the run/runu functions, which would
|
|
|
|
# to not echo responses via the run/runu functions, which would
|
|
|
@ -203,7 +204,8 @@ def main():
|
|
|
|
module.fail_json(msg='Insufficient version of pexpect installed '
|
|
|
|
module.fail_json(msg='Insufficient version of pexpect installed '
|
|
|
|
'(%s), this module requires pexpect>=3.3. '
|
|
|
|
'(%s), this module requires pexpect>=3.3. '
|
|
|
|
'Error was %s' % (pexpect.__version__, e))
|
|
|
|
'Error was %s' % (pexpect.__version__, e))
|
|
|
|
except pexpect.ExceptionPexpect, e:
|
|
|
|
except pexpect.ExceptionPexpect:
|
|
|
|
|
|
|
|
e = get_exception()
|
|
|
|
module.fail_json(msg='%s' % e)
|
|
|
|
module.fail_json(msg='%s' % e)
|
|
|
|
|
|
|
|
|
|
|
|
endd = datetime.datetime.now()
|
|
|
|
endd = datetime.datetime.now()
|
|
|
@ -230,5 +232,6 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
# import module snippets
|
|
|
|
# import module snippets
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
|
|
|
|
from ansible.module_utils.pycompat24 import get_exception
|
|
|
|
|
|
|
|
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|