Comment 76 for bug 1770082

Revision history for this message
Marcos (markinholiveira) wrote :

I found time to run more tests and discovered that my patches were wrong... And the fix was actually even simpler.

root@netplan:~# cat fix-bug-1770082.diff
Index: b/netplan/cli/commands/apply.py
===================================================================
--- a/netplan/cli/commands/apply.py 2018-10-04 16:04:57.000000000 +0000
+++ b/netplan/cli/commands/apply.py 2018-10-15 18:37:06.975347468 +0000
@@ -140,9 +140,9 @@
             driver = match.get('driver')
             mac = match.get('macaddress')
             if driver:
- matches['by-driver'][driver] = phy
+ matches['by-driver'][driver] = newname
             if mac:
- matches['by-mac'][mac] = phy
+ matches['by-mac'][mac] = newname

         # /sys/class/net/ens3/device -> ../../../virtio0
         # /sys/class/net/ens3/device/driver -> ../../../../bus/virtio/drivers/virtio_net

Just changed two words...
I created a pull request on github (https://github.com/CanonicalLtd/netplan/pull/50).