mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
replace type() with isinstance() (#5541)
Replace all use of type() with isintance() Addresses https://github.com/ansible/ansible/issues/18310
This commit is contained in:
parent
2744fde7c9
commit
06e1141106
7 changed files with 17 additions and 17 deletions
|
@ -143,7 +143,7 @@ def _run_module(wrapped_cmd, jid, job_path):
|
|||
if json_warnings:
|
||||
# merge JSON junk warnings with any existing module warnings
|
||||
module_warnings = result.get('warnings', [])
|
||||
if type(module_warnings) is not list:
|
||||
if not isinstance(module_warnings, list):
|
||||
module_warnings = [module_warnings]
|
||||
module_warnings.extend(json_warnings)
|
||||
result['warnings'] = module_warnings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue