Repair 2 deprecation warnings

Using SDK uncovered 2 code deprecation warnings:

openstack/resource.py:210: DeprecationWarning: Using or importing the
  ABCs from 'collections' instead of from 'collections.abc' is deprecated
  since Python 3.3, and in 3.9 it will stop working class
  _ComponentManager(collections.MutableMapping):

openstack/resource.py:351: DeprecationWarning: inspect.getargspec() is
  deprecated since Python 3.0, use inspect.signature() or
    inspect.getfullargspec() len(inspect.getargspec(type_).args) > 1) #

Follow recommendations and replace those usages

Change-Id: I0a38dceb1739ba0601d751d5a9837524353475b5
This commit is contained in:
Artem Goncharov 2020-09-04 16:37:44 +02:00
parent 4b7a108391
commit 10017ff68f

View File

@ -207,7 +207,7 @@ class Computed(_BaseComponent):
key = "_computed"
class _ComponentManager(collections.MutableMapping):
class _ComponentManager(collections.abc.MutableMapping):
"""Storage of a component type"""
def __init__(self, attributes=None, synchronized=False):
@ -348,7 +348,7 @@ class QueryParameters:
# single-argument (like int) and double-argument type functions.
try:
provide_resource_type = (
len(inspect.getargspec(type_).args) > 1)
len(inspect.getfullargspec(type_).args) > 1)
except TypeError:
provide_resource_type = False