Backport/2.6/44726 Fix calling deprecate with correct arguments (#48375)
* Fix calling deprecate with correct arguments (#44726)
This fixes #44702
(cherry picked from commit 66eec42f53
)
* Backport PR#44726 - Fix deperecate call
This commit is contained in:
parent
4eae4c1d63
commit
29ab1e78b7
2 changed files with 4 additions and 0 deletions
2
changelogs/fragments/44726-correct_deprecate_call.yaml
Normal file
2
changelogs/fragments/44726-correct_deprecate_call.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Fix calling deprecate with correct arguments (https://github.com/ansible/ansible/pull/46062).
|
|
@ -2352,6 +2352,8 @@ class AnsibleModule(object):
|
||||||
for d in kwargs['deprecations']:
|
for d in kwargs['deprecations']:
|
||||||
if isinstance(d, SEQUENCETYPE) and len(d) == 2:
|
if isinstance(d, SEQUENCETYPE) and len(d) == 2:
|
||||||
self.deprecate(d[0], version=d[1])
|
self.deprecate(d[0], version=d[1])
|
||||||
|
elif isinstance(d, Mapping):
|
||||||
|
self.deprecate(d['msg'], version=d.get('version', None))
|
||||||
else:
|
else:
|
||||||
self.deprecate(d)
|
self.deprecate(d)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue