Merge "Switch to collections.abc.MutableMapping"

This commit is contained in:
Zuul 2021-02-16 14:05:41 +00:00 committed by Gerrit Code Review
commit 5ff7b4ca14

View File

@ -9,7 +9,8 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import collections
import collections.abc
from oslo_policy import policy
import pecan
@ -163,7 +164,7 @@ def flatten(d, parent_key=''):
items = []
for k, v in d.items():
new_key = parent_key + '.' + k if parent_key else k
if isinstance(v, collections.MutableMapping):
if isinstance(v, collections.abc.MutableMapping):
items.extend(flatten(v, new_key).items())
else:
items.append((new_key, v))