Replace distutils

distutils was deprecated in Python 3.10 and was removed in Python
3.12 [1].

[1] https://docs.python.org//3.10/library/distutils.html

Change-Id: Iade3ecba97cb35f0afcb8e9fbde8dd1095b6fb47
This commit is contained in:
Takashi Kajinami
2024-10-02 23:36:38 +09:00
parent 79a4606ce2
commit ca7a0b1be2

View File

@@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
#
from oslo_utils import strutils
from cloudkittyclient.common import base
from cloudkittyclient import exc
from distutils.util import strtobool
class ScopeManager(base.BaseManager):
"""Class used to handle /v2/scope endpoint"""
@@ -133,7 +133,8 @@ class ScopeManager(base.BaseManager):
)
if kwargs.get('active'):
body['active'] = strtobool(kwargs.get('active'))
body['active'] = strutils.bool_from_string(
kwargs.get('active'), strict=True)
# Stripping None
body = dict(filter(lambda elem: elem[1] is not None, body.items()))