From 2c2f42c7672769838238056860b7300d48afa960 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Tue, 8 Mar 2022 07:15:59 +0100 Subject: [PATCH] Consume collections abc classes from correct module As noted in the Python documentation [0], abstract members of the `collections` module was moved to `collections.abc` in Python 3.3 and scheduled for removal in Python 3.10. 0: https://docs.python.org/3.9/library/collections.html (cherry picked from commit 5e9216a7fc52f41de815071e091d3cfcb01f0d75) --- zaza/charm_lifecycle/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zaza/charm_lifecycle/utils.py b/zaza/charm_lifecycle/utils.py index 9ece73521..8e398d2db 100644 --- a/zaza/charm_lifecycle/utils.py +++ b/zaza/charm_lifecycle/utils.py @@ -123,7 +123,7 @@ def _concat_model_alias_maps(data): """ new_data = {DEFAULT_MODEL_ALIAS: []} for item in data: - if isinstance(item, collections.Mapping): + if isinstance(item, collections.abc.Mapping): new_data.update(item) else: new_data[DEFAULT_MODEL_ALIAS].append(item) @@ -151,7 +151,7 @@ def get_deployment_type(deployment_directive): """ if isinstance(deployment_directive, str): return RAW_BUNDLE - if isinstance(deployment_directive, collections.Mapping): + if isinstance(deployment_directive, collections.abc.Mapping): if len(deployment_directive) == 1: first_value = deployment_directive[list(deployment_directive)[0]] if isinstance(first_value, list):