mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41: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
|
@ -17,9 +17,10 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from io import StringIO
|
||||
import os
|
||||
import re
|
||||
from collections import MutableSequence
|
||||
from io import StringIO
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils.six.moves import configparser
|
||||
|
@ -110,7 +111,7 @@ class LookupModule(LookupBase):
|
|||
else:
|
||||
var = self.read_ini(path, key, paramvals['section'], paramvals['default'], paramvals['re'])
|
||||
if var is not None:
|
||||
if type(var) is list:
|
||||
if isinstance(var, MutableSequence):
|
||||
for v in var:
|
||||
ret.append(v)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue