Browse Source

drop use of six

Change-Id: I40bb06d1d445d8eb8281f421a94d7dead2a89872
changes/75/710775/1
Hervé Beraud 2 years ago
parent
commit
2245235ece
  1. 1
      lower-constraints.txt
  2. 5
      oslo_limit/limit.py
  3. 1
      requirements.txt

1
lower-constraints.txt

@ -9,6 +9,5 @@ openstackdocstheme==1.20.0
openstacksdk==0.31.1
oslotest==3.2.0
reno==2.5.0
six==1.10.0
Sphinx==1.8.0
stestr==1.0.0

5
oslo_limit/limit.py

@ -17,7 +17,6 @@ from keystoneauth1 import loading
from openstack import connection
from oslo_config import cfg
from oslo_log import log
import six
from oslo_limit import exception
from oslo_limit import opts
@ -110,7 +109,7 @@ class Enforcer(object):
:raises exception.ClaimExceedsLimit: when over limits
"""
if not project_id or not isinstance(project_id, six.string_types):
if not project_id or not isinstance(project_id, str):
msg = 'project_id must be a non-empty string.'
raise ValueError(msg)
if not isinstance(deltas, dict) or len(deltas) == 0:
@ -118,7 +117,7 @@ class Enforcer(object):
raise ValueError(msg)
for k, v in deltas.items():
if not isinstance(k, six.string_types):
if not isinstance(k, str):
raise ValueError('resource name is not a string.')
elif not isinstance(v, int):
raise ValueError('resource limit is not an integer.')

1
requirements.txt

@ -2,7 +2,6 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
keystoneauth1>=3.9.0 # Apache-2.0
six>=1.10.0 # MIT
oslo.config>=5.2.0 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0
oslo.log>=3.44.0 # Apache-2.0

Loading…
Cancel
Save