Only show one deprecation warning if version and date are both defined. (#69808)
This prefers date to version on the basis that date will have been added in 2.10, and version retained for 2.9 compatibility
This commit is contained in:
parent
66bd385f6f
commit
b69e5c55f4
1 changed files with 5 additions and 5 deletions
|
@ -137,16 +137,16 @@ def list_deprecations(argument_spec, params, prefix=''):
|
|||
sub_prefix = '%s["%s"]' % (prefix, arg_name)
|
||||
else:
|
||||
sub_prefix = arg_name
|
||||
if arg_opts.get('removed_in_version') is not None:
|
||||
deprecations.append({
|
||||
'msg': "Param '%s' is deprecated. See the module docs for more information" % sub_prefix,
|
||||
'version': arg_opts.get('removed_in_version')
|
||||
})
|
||||
if arg_opts.get('removed_at_date') is not None:
|
||||
deprecations.append({
|
||||
'msg': "Param '%s' is deprecated. See the module docs for more information" % sub_prefix,
|
||||
'date': arg_opts.get('removed_at_date')
|
||||
})
|
||||
elif arg_opts.get('removed_in_version') is not None:
|
||||
deprecations.append({
|
||||
'msg': "Param '%s' is deprecated. See the module docs for more information" % sub_prefix,
|
||||
'version': arg_opts.get('removed_in_version')
|
||||
})
|
||||
# Check sub-argument spec
|
||||
sub_argument_spec = arg_opts.get('options')
|
||||
if sub_argument_spec is not None:
|
||||
|
|
Loading…
Reference in a new issue