Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@xz-dev
Copy link

@xz-dev xz-dev commented Sep 14, 2023

First, stdin not need --tty option, it only dependent --interactive option. Secendly, when running in subprocess mode, disable --tty option if parent process does not have a tty. This prevents the subprocess incorrectly detecting tty and enabling interactive features like ansible-config init.
For example, if you use ansible-navigator config init -m stdout > config, the subprocess will incorrectly detect tty and waiting 'q' to exit less and cause errors of config. This change avoids that.

More code see at here ansible_navigator. ansible_navigator enable input_fd even if in non-tty mode, It is understandable because they are able to control the input and output based on needs.

First, stdin not need --tty option, it only dependent --interactive option.
Secendly, when running in subprocess mode, disable --tty option if
parent process does not have a tty. This prevents the
subprocess incorrectly detecting tty and enabling interactive
features like `ansible-config init`.
For example, if you use `ansible-navigator config init -m stdout > config`, the subprocess will incorrectly detect tty and waiting 'q' to exit less and cause errors of config. This change avoids that.
@Shrews
Copy link
Contributor

Shrews commented Sep 20, 2023

I kinda have a feeling this might break pexpect and passwords (not sure we have testing mechanisms set up for that). Someone will have to dig into that aspect and do some validation there.

@Shrews
Copy link
Contributor

Shrews commented Sep 22, 2023

I've done some manual testing in various scenarios (pexpect w/ passwords, subprocess in container connecting stdin to the input, etc) and it seems to work as expected. However, I'm not 100% certain I've covered all of the scenarios. This really needs some testing from the Controller team to validate that nothing on their side is affected negatively by this.

@xz-dev
Copy link
Author

xz-dev commented Oct 13, 2023

Is there anything else that needs testing? I'd be happy to continue improving this PR.

@sonarqubecloud
Copy link

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

Successfully merging this pull request may close these issues.

2 participants