From c03f96ffaeb64e8cd374b6ed15d24cc21fdec034 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 17 Jul 2021 00:16:26 +0900 Subject: [PATCH] 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 --- manila/share/drivers/netapp/utils.py | 4 ++-- manila/tests/api/contrib/stubs.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manila/share/drivers/netapp/utils.py b/manila/share/drivers/netapp/utils.py index 68428913ca..1fad8d2e1c 100644 --- a/manila/share/drivers/netapp/utils.py +++ b/manila/share/drivers/netapp/utils.py @@ -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] diff --git a/manila/tests/api/contrib/stubs.py b/manila/tests/api/contrib/stubs.py index d375e67498..9b03e0f541 100644 --- a/manila/tests/api/contrib/stubs.py +++ b/manila/tests/api/contrib/stubs.py @@ -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)