Replace six.itervalues() with dict.values() in kuryr-kubernetes
1.As mentioned in [1], we should avoid using six.itervalues to achieve iterators. We can use dict.values instead, as it will return iterators in PY3 as well. And dict.values will more readable. 2.In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3#Common_patterns [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: I0f1fab85a7454515c1718594bf2c2aaa958d489b
This commit is contained in:
parent
bf76034162
commit
768e7b4e35
|
@ -13,7 +13,6 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import six
|
||||
|
||||
from kuryr.lib._i18n import _
|
||||
from kuryr.lib.binding.drivers import utils as kl_utils
|
||||
|
@ -342,4 +341,4 @@ def osvif_to_neutron_fixed_ips(subnets):
|
|||
|
||||
|
||||
def osvif_to_neutron_network_ids(subnets):
|
||||
return list(set(net.id for net in six.itervalues(subnets)))
|
||||
return list(set(net.id for net in subnets.values()))
|
||||
|
|
Loading…
Reference in New Issue