Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key presses aren't passed through to ansible process #1800

Open
snopoke opened this issue May 30, 2018 · 0 comments
Open

key presses aren't passed through to ansible process #1800

snopoke opened this issue May 30, 2018 · 0 comments

Comments

@snopoke
Copy link
Contributor

snopoke commented May 30, 2018

When running a playbook that uses async tasks (like setup_pg_standby.yml any key presses aren't passed through to the ansible process.

For example when waiting for a task to complete the user is prompted:

TASK [pause] *******************************************************************
Pausing for 300 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)

Pressing ctrl+C at this point will terminate the process completely:

Traceback (most recent call last):
  File "/home/skelly/.virtualenvs/ansible/bin/cchq", line 11, in <module>
    load_entry_point('commcare-cloud', 'console_scripts', 'cchq')()
  File "/home/skelly/commcare-cloud/src/commcare_cloud/commcare_cloud.py", line 158, in main
    exit_code = commands[args.command].run(args, unknown_args)
  File "/home/skelly/commcare-cloud/src/commcare_cloud/commands/ansible/ansible_playbook.py", line 128, in run
    return run_action_with_check_mode(run_check, run_apply, args.skip_check, args.quiet, always_skip_check)
  File "/home/skelly/commcare-cloud/src/commcare_cloud/commands/ansible/helpers.py", line 117, in run_action_with_check_mode
    exit_code = run_apply()
  File "/home/skelly/commcare-cloud/src/commcare_cloud/commands/ansible/ansible_playbook.py", line 126, in run_apply
    return ansible_playbook(environment, args.playbook, *unknown_args)
  File "/home/skelly/commcare-cloud/src/commcare_cloud/commands/ansible/ansible_playbook.py", line 117, in ansible_playbook
    p.communicate(input='{}\n'.format(environment.get_ansible_vault_password()))
  File "/usr/lib/python2.7/subprocess.py", line 796, in communicate
    self.wait()
  File "/usr/lib/python2.7/subprocess.py", line 1376, in wait
    pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
  File "/usr/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
    return func(*args)
KeyboardInterrupt
 [ERROR]: User interrupted execution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant