25 lines
622 B
Diff
25 lines
622 B
Diff
|
--- cloudinit/net/__init__.py.orig
|
||
|
+++ cloudinit/net/__init__.py
|
||
|
@@ -7,6 +7,7 @@
|
||
|
|
||
|
import errno
|
||
|
import functools
|
||
|
+import glob
|
||
|
import ipaddress
|
||
|
import logging
|
||
|
import os
|
||
|
@@ -698,6 +699,12 @@ def _rename_interfaces(
|
||
|
renames, strict_present=True, strict_busy=True, current_info=None
|
||
|
):
|
||
|
|
||
|
+ net_devs = glob.glob('/sys/class/net/*')
|
||
|
+ for dev in net_devs:
|
||
|
+ dev_name = dev.split('/')[-1]
|
||
|
+ for dev_data in renames:
|
||
|
+ if dev_name in dev_data:
|
||
|
+ del renames[renames.index(dev_data)]
|
||
|
+
|
||
|
if not len(renames):
|
||
|
LOG.debug("no interfaces to rename")
|
||
|
return
|