mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Migrate most uses of if type() to if isinstance()
Also convert those checks to use abcs instead of dict and list. Make a sentinel class for strategies to report when they've reache the end
This commit is contained in:
parent
64fe7402ff
commit
6bad4e57bd
12 changed files with 49 additions and 34 deletions
|
@ -22,6 +22,7 @@ __metaclass__ = type
|
|||
import os
|
||||
import time
|
||||
import json
|
||||
from collections import MutableMapping
|
||||
|
||||
from ansible.module_utils._text import to_bytes
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
@ -54,7 +55,7 @@ class CallbackModule(CallbackBase):
|
|||
os.makedirs("/var/log/ansible/hosts")
|
||||
|
||||
def log(self, host, category, data):
|
||||
if type(data) == dict:
|
||||
if isinstance(data, MutableMapping):
|
||||
if '_ansible_verbose_override' in data:
|
||||
# avoid logging extraneous data
|
||||
data = 'omitted'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue