Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2.In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: I0c903ca9d566c89e4e0d6bd129dc1f7bc3e95db9
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
|
||||
import copy
|
||||
|
||||
import six
|
||||
|
||||
from heat.engine.resources.openstack.neutron import net
|
||||
from heat.engine.resources.openstack.neutron import port
|
||||
@@ -32,7 +31,7 @@ class ImmutableNet(net.Net):
|
||||
|
||||
properties_schema = {
|
||||
k: _copy_schema_immutable(v)
|
||||
for k, v in six.iteritems(net.Net.properties_schema)
|
||||
for k, v in net.Net.properties_schema.items()
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +40,7 @@ class ImmutablePort(port.Port):
|
||||
|
||||
properties_schema = {
|
||||
k: _copy_schema_immutable(v)
|
||||
for k, v in six.iteritems(port.Port.properties_schema)
|
||||
for k, v in port.Port.properties_schema.items()
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +49,7 @@ class ImmutableSubnet(subnet.Subnet):
|
||||
|
||||
properties_schema = {
|
||||
k: _copy_schema_immutable(v)
|
||||
for k, v in six.iteritems(subnet.Subnet.properties_schema)
|
||||
for k, v in subnet.Subnet.properties_schema.items()
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user