summaryrefslogtreecommitdiff
path: root/cloudinit/net
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/net')
-rw-r--r--cloudinit/net/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index e5b45926..4641e54d 100644
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -351,8 +351,9 @@ def find_fallback_network_device():
if 'eth0' in potential_interfaces:
name = 'eth0'
else:
- name = potential_interfaces.sort(
- key=lambda x: int(x.strip(string.ascii_letters)))[0]
+ potential_interfaces.sort(
+ key=lambda x: int(x.strip(string.ascii_letters)))
+ name = potential_interfaces[0]
sysfs_mac = os.path.join(SYS_CLASS_NET, name, 'address')
mac = util.load_file(sysfs_mac).strip()