Merge "Replace six.iteritems() with .items()"
This commit is contained in:
commit
2da4c582ae
|
@ -23,7 +23,6 @@ from pecan import expose
|
|||
from pecan import request
|
||||
|
||||
import restcomm
|
||||
import six
|
||||
|
||||
from kingbird.common import exceptions
|
||||
from kingbird.common.i18n import _
|
||||
|
@ -215,7 +214,7 @@ class QuotaManagerController(object):
|
|||
if CONF.use_default_quota_class:
|
||||
default_quotas = db_api.quota_class_get_default(context)
|
||||
|
||||
for resource, default in six.iteritems(config_defaults):
|
||||
for resource, default in config_defaults.items():
|
||||
# get rid of the 'quota_' prefix
|
||||
resource_name = resource[6:]
|
||||
if default_quotas:
|
||||
|
|
|
@ -18,8 +18,6 @@ import pecan
|
|||
from pecan import expose
|
||||
from pecan import request
|
||||
|
||||
import six
|
||||
|
||||
from kingbird.api.controllers import restcomm
|
||||
from kingbird.common import consts
|
||||
from kingbird.common import exceptions
|
||||
|
@ -94,7 +92,7 @@ class QuotaClassSetController(object):
|
|||
|
||||
utils.validate_quota_limits(quota_class_set)
|
||||
|
||||
for key, value in six.iteritems(quota_class_set):
|
||||
for key, value in quota_class_set.items():
|
||||
try:
|
||||
db_api.quota_class_update(context, class_name, key, value)
|
||||
except exceptions.QuotaClassNotFound:
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import six
|
||||
|
||||
import oslo_messaging
|
||||
|
||||
|
@ -23,7 +22,7 @@ class Mapping(object):
|
|||
def __init__(self, mapping):
|
||||
self.direct_mapping = mapping
|
||||
self.reverse_mapping = {}
|
||||
for key, value in six.iteritems(mapping):
|
||||
for key, value in mapping.items():
|
||||
self.reverse_mapping[value] = key
|
||||
|
||||
_SINGLETON_MAPPING = Mapping({
|
||||
|
@ -38,7 +37,7 @@ class KingbirdSerializer(oslo_messaging.Serializer):
|
|||
|
||||
def serialize_entity(self, context, entity):
|
||||
if isinstance(entity, dict):
|
||||
for key, value in six.iteritems(entity):
|
||||
for key, value in entity.items():
|
||||
entity[key] = self.serialize_entity(context, value)
|
||||
|
||||
elif isinstance(entity, list):
|
||||
|
@ -55,7 +54,7 @@ class KingbirdSerializer(oslo_messaging.Serializer):
|
|||
|
||||
def deserialize_entity(self, context, entity):
|
||||
if isinstance(entity, dict):
|
||||
for key, value in six.iteritems(entity):
|
||||
for key, value in entity.items():
|
||||
entity[key] = self.deserialize_entity(context, value)
|
||||
|
||||
elif isinstance(entity, list):
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
|
||||
import datetime
|
||||
from oslo_config import cfg
|
||||
import six
|
||||
import sqlalchemy
|
||||
|
||||
CLASS_NAME = 'default'
|
||||
|
@ -40,7 +39,7 @@ def upgrade(migrate_engine):
|
|||
|
||||
# Set default quota limits
|
||||
qci = quota_classes.insert()
|
||||
for resource, default in six.iteritems(CONF.kingbird_global_limit):
|
||||
for resource, default in CONF.kingbird_global_limit.items():
|
||||
qci.execute({'created_at': CREATED_AT,
|
||||
'class_name': CLASS_NAME,
|
||||
'resource': resource[6:],
|
||||
|
|
Loading…
Reference in New Issue