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
Add TTY check and argument to disable it (#50603) #68260
base: devel
Are you sure you want to change the base?
Conversation
The test
The test
|
This PR should also contain a changelog fragment (see changelogs/fragments
) as well as tests to verify this functionality.
lib/ansible/cli/vault.py
Outdated
@@ -76,6 +76,7 @@ def init_parser(self): | |||
create_parser = subparsers.add_parser('create', help='Create new vault encrypted file', parents=[vault_id, common]) | |||
create_parser.set_defaults(func=self.execute_create) | |||
create_parser.add_argument('args', help='Filename', metavar='file_name', nargs='*') | |||
create_parser.add_argument('-n', '--no-check', default=False, help='skip TTY check', dest='no_check', action='store_true') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This argument name should be more descriptive, such as --skip-tty-check
. We also recommend dropping the shortopt of -n
as that is overloaded and would lead to more confusion.
Is AnsibleOptionsError the correct error type, or should it be changed? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
SUMMARY
Fixes #50603
Runs a TTY check before launching the editor and raises an error if false. One can add the --no-check flag to override this check and launch the editor anyways.
ISSUE TYPE
COMPONENT NAME
ansible-vault create
ADDITIONAL INFORMATION
Running the command
now returns the following output instead of creating an invisible editor window.