Don't include a default for cli as it overrides config with lesser pr… (#80650)

* Don't include a default for CLI as it overrides config with lesser precedence

  connection plugins should already use the same config entries (and more)
  than DEFAULT_TIMEOUT.
pull/80683/head
Brian Coca 1 year ago committed by GitHub
parent 1568f07b22
commit 06dcb4ad7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
bugfixes:
- connection timeouts defined in ansible.cfg will now be properly used, the --timeout cli option was obscuring them by always being set.
breaking_changes:
- Any plugin using the config system and the `cli` entry to use the `timeout` from the command line, will see the value change if the use had configured it in any of the lower precedence methods.
If relying on this behaviour to consume the global/generic timeout from the DEFAULT_TIMEOUT constant, please consult the documentation on plugin configuration to add the overlaping entries.

@ -250,8 +250,8 @@ def add_connect_options(parser):
help='connect as this user (default=%s)' % C.DEFAULT_REMOTE_USER)
connect_group.add_argument('-c', '--connection', dest='connection', default=C.DEFAULT_TRANSPORT,
help="connection type to use (default=%s)" % C.DEFAULT_TRANSPORT)
connect_group.add_argument('-T', '--timeout', default=C.DEFAULT_TIMEOUT, type=int, dest='timeout',
help="override the connection timeout in seconds (default=%s)" % C.DEFAULT_TIMEOUT)
connect_group.add_argument('-T', '--timeout', default=None, type=int, dest='timeout',
help="override the connection timeout in seconds (default depends on connection)")
# ssh only
connect_group.add_argument('--ssh-common-args', default=None, dest='ssh_common_args',

Loading…
Cancel
Save