1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Deprecate norc's default. (#4517)

This commit is contained in:
Felix Fontein 2022-04-26 11:45:43 +02:00 committed by GitHub
parent 54b2f0819d
commit 36a0eca193
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -0,0 +1,2 @@
deprecated_features:
- "gem - the default of the ``norc`` option has been deprecated and will change to ``true`` in community.general 6.0.0. Explicitly specify a value to avoid a deprecation warning (https://github.com/ansible-collections/community.general/pull/4517)."

View file

@ -69,10 +69,10 @@ options:
version_added: 3.3.0
norc:
type: bool
default: false
description:
- Avoid loading any C(.gemrc) file. Ignored for RubyGems prior to 2.5.2.
- "The current default value will be deprecated in community.general 5.0.0: if the value is not explicitly specified, a deprecation message will be shown."
- The current default value C(false) has been deprecated in community.general 5.0.0.
Explicitly specify the value to prevent the deprecation warning to be shown."
- From community.general 6.0.0 on, the default will be changed to C(true).
version_added: 3.3.0
env_shebang:
@ -297,7 +297,7 @@ def main():
user_install=dict(required=False, default=True, type='bool'),
install_dir=dict(required=False, type='path'),
bindir=dict(type='path'),
norc=dict(default=False, type='bool'),
norc=dict(type='bool'),
pre_release=dict(required=False, default=False, type='bool'),
include_doc=dict(required=False, default=False, type='bool'),
env_shebang=dict(required=False, default=False, type='bool'),
@ -315,6 +315,12 @@ def main():
module.fail_json(msg="Cannot maintain state=latest when installing from local source")
if module.params['user_install'] and module.params['install_dir']:
module.fail_json(msg="install_dir requires user_install=false")
if module.params['norc'] is None:
module.deprecate(
'The default of the norc option has been deprecated. It will be changed to `true`'
' in community.general 6.0.0. Specify an explicit value to get rid of this message',
version='6.0.0', collection_name='community.general')
module.params['norc'] = False
if not module.params['gem_source']:
module.params['gem_source'] = module.params['name']