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).

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1770082

Title:
  systemd-networkd not renaming devices on boot

To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1770082/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to