From 3d11eb46b79aa37558675ba3abfed50e03c1899f Mon Sep 17 00:00:00 2001 From: ocket8888 Date: Fri, 10 Jan 2020 14:24:59 -0700 Subject: [PATCH] Fixed wrong import order and Py3-incompatibility --- misc/kickstart_create_network_line.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/misc/kickstart_create_network_line.py b/misc/kickstart_create_network_line.py index 9426bb6771..1992e7d400 100755 --- a/misc/kickstart_create_network_line.py +++ b/misc/kickstart_create_network_line.py @@ -19,10 +19,10 @@ network links in /sys/class/net/*, then emits a ks.cfg network line. ''' +from __future__ import print_function import os import re -from __future__ import print_function global TO_LOG # This "logs" to stdout which is captured during kickstart @@ -170,8 +170,7 @@ def useable_interfaces(net_devs, nc, iface_speed): # if not it is anyway. # Thus we are doing a bond of some sort. # This gives us the fastest interfaces first: - speeds = net_devs.keys() - speeds.sort(reverse=True) + speeds = [k for k in sorted(net_devs.keys(), reverse=True)] fastest = speeds[0] # Walk through "speeds" and take the first one that has more than one # interface. This will only set iface_list if there are 2 or more interfaces: