mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-28 11:59:09 -07:00
Python 3.8 collections compatibility fixes.
Includes a new pylint blacklist plugin to prevent regressions.
This commit is contained in:
parent
c4d1f0d416
commit
a11f631ee4
56 changed files with 317 additions and 104 deletions
|
@ -19,7 +19,6 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import collections
|
||||
import re
|
||||
import json
|
||||
|
||||
|
@ -27,6 +26,7 @@ from itertools import chain
|
|||
|
||||
from ansible.errors import AnsibleConnectionFailure
|
||||
from ansible.module_utils._text import to_text
|
||||
from ansible.module_utils.common._collections_compat import Mapping
|
||||
from ansible.module_utils.network.common.config import NetworkConfig, dumps
|
||||
from ansible.module_utils.network.common.utils import to_list
|
||||
from ansible.plugins.cliconf import CliconfBase
|
||||
|
@ -75,7 +75,7 @@ class Cliconf(CliconfBase):
|
|||
requests = []
|
||||
self.send_command('configure')
|
||||
for cmd in to_list(candidate):
|
||||
if not isinstance(cmd, collections.Mapping):
|
||||
if not isinstance(cmd, Mapping):
|
||||
cmd = {'command': cmd}
|
||||
|
||||
results.append(self.send_command(**cmd))
|
||||
|
@ -199,7 +199,7 @@ class Cliconf(CliconfBase):
|
|||
|
||||
responses = list()
|
||||
for cmd in to_list(commands):
|
||||
if not isinstance(cmd, collections.Mapping):
|
||||
if not isinstance(cmd, Mapping):
|
||||
cmd = {'command': cmd}
|
||||
|
||||
output = cmd.pop('output', None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue