mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-02 23:31: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
|
@ -4,6 +4,7 @@ import yaml
|
|||
import inspect
|
||||
import collections
|
||||
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.modules.cloud.openstack import os_server
|
||||
|
||||
|
||||
|
@ -26,7 +27,7 @@ def params_from_doc(func):
|
|||
for task in cfg:
|
||||
for module, params in task.items():
|
||||
for k, v in params.items():
|
||||
if k in ['nics'] and type(v) == str:
|
||||
if k in ['nics'] and isinstance(v, string_types):
|
||||
params[k] = [v]
|
||||
task[module] = collections.defaultdict(str,
|
||||
params)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue