Merge "Replace distutils"

This commit is contained in:
Zuul
2024-10-14 15:18:32 +00:00
committed by Gerrit Code Review

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()))