Skip to content

Commit

Permalink
fix(utils): capture step_cli attempt to open tty
Browse files Browse the repository at this point in the history
This workaround captures a different or updated error message
from `step-cli` when it attempts to open `/dev/tty`:

    open /dev/tty: no such device or address

Ideally, `step-cli` would provide a way to avoid this entirely; c.f:
  - smallstep/cli#502
  • Loading branch information
eengstrom committed Jul 12, 2021
1 parent d41dbcd commit c5dcc48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/module_utils/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def run_step_cli_command(cli_executable, cli_command, module, result, params=Non
if not module.check_mode:
rc, result["stdout"], result["stderr"] = module.run_command(args)
if rc != 0:
if "error allocating terminal" in result["stderr"]:
if ("error allocating terminal" in result["stderr"] or "open /dev/tty: no such device or address" in result["stderr"]):
result["msg"] = (
"step-cli tried and failed to open a terminal for interactive input. "
"This usually means that you're missing a parameter that step-cli is now asking for, "
Expand Down

0 comments on commit c5dcc48

Please sign in to comment.