-
Bug
-
Resolution: Done
-
Minor
-
None
-
None
While I was working on end-to-end testing for ipa-hcc and idm-domains-backend (HMS-2038), I ran into an issue with the CI pipeline. It blocked and eventually timed out. It took me a while to figure out that the get-ipa-hcc-register.py script does not include the "--unattended" option, so the script was waiting for confirmation from the user. It turns out that the sys.stdin.isatty() check does not trigger under Ansible. The ssh connection of Ansible has stdin connected to a pseudo terminal interface.
Can we do a better job in detecting automation tools like Ansible and Chef? Or at least have a timeout, so ipa-hcc registers exits with an error after 30 seconds or so? Python's input() doesn't have a timeout argument. We could emulated it with select() syscall or signal.alert() + custom signal handler.
Related to: https://gitlab.cee.redhat.com/identity-management/idmocp/ipa-hcc/-/merge_requests/74