Skip to content

Commit ca7a0b1

Browse files
committed
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
1 parent 79a4606 commit ca7a0b1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cloudkittyclient/v2/scope.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414
#
15+
from oslo_utils import strutils
16+
1517
from cloudkittyclient.common import base
1618
from cloudkittyclient import exc
1719

18-
from distutils.util import strtobool
19-
2020

2121
class ScopeManager(base.BaseManager):
2222
"""Class used to handle /v2/scope endpoint"""
@@ -133,7 +133,8 @@ def update_scope(self, **kwargs):
133133
)
134134

135135
if kwargs.get('active'):
136-
body['active'] = strtobool(kwargs.get('active'))
136+
body['active'] = strutils.bool_from_string(
137+
kwargs.get('active'), strict=True)
137138

138139
# Stripping None
139140
body = dict(filter(lambda elem: elem[1] is not None, body.items()))

0 commit comments

Comments
 (0)