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:
Matt Kunkel 2018-11-27 15:16:41 -06:00 committed by Matt Clay
parent 4eae4c1d63
commit 29ab1e78b7
2 changed files with 4 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- Fix calling deprecate with correct arguments (https://github.com/ansible/ansible/pull/46062).

View file

@ -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: