summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorWesley Wiedenmeier <wesley.wiedenmeier@gmail.com>2016-03-22 02:20:06 -0500
committerWesley Wiedenmeier <wesley.wiedenmeier@gmail.com>2016-03-22 02:20:06 -0500
commit3a3f960d5cfee60766e7de9e1fced537cac72106 (patch)
tree1c627056b6999a7fe232bad00a8a8c7d35481915 /cloudinit
parent7eccb0f0f3693662b3f288e7a74cb5bd6d7814ea (diff)
downloadvyos-cloud-init-3a3f960d5cfee60766e7de9e1fced537cac72106.tar.gz
vyos-cloud-init-3a3f960d5cfee60766e7de9e1fced537cac72106.zip
In generate_fallback_config() fix function to sort potential interfaces to work
on interfaces with characters between their numbers
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/net/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index 389c2afb..36f07a02 100644
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -346,7 +346,7 @@ def generate_fallback_config():
name = DEFAULT_PRIMARY_INTERFACE
else:
potential_interfaces.sort(
- key=lambda x: int(x.strip(string.ascii_letters)))
+ key=lambda x: int(''.join(i for i in x if i in string.digits)))
name = potential_interfaces[0]
sysfs_mac = os.path.join(SYS_CLASS_NET, name, 'address')