Replace deprecated import of ABCs from collections

ABCs in collections should be imported from collections.abc and direct
import from collections is deprecated since Python 3.3.

Closes-Bug: #1936667
Change-Id: Ie82a523b4f8ab3d44d0fc9d70cb1ca6c059cc48f
This commit is contained in:
Takashi Kajinami 2021-07-17 00:16:26 +09:00
parent 35af72a875
commit c03f96ffae
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@
# under the License.
"""Utilities for NetApp drivers."""
import collections
from collections import abc
import decimal
import platform
import re
@ -107,7 +107,7 @@ def convert_to_list(value):
return []
elif isinstance(value, six.string_types):
return [value]
elif isinstance(value, collections.Iterable):
elif isinstance(value, abc.Iterable):
return list(value)
else:
return [value]

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import collections
from collections import abc
import datetime
from manila.common import constants
@ -68,7 +68,7 @@ def stub_share(id, **kwargs):
# NOTE(ameade): We must wrap the dictionary in an class in order to stub
# object attributes.
class wrapper(collections.Mapping):
class wrapper(abc.Mapping):
def __getitem__(self, name):
if hasattr(self, name):
return getattr(self, name)