You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WALinuxAgent parses data explicitly listed as internal to systemd and not for direct access
#2979 updated WALinuxAgent to handle Ubuntu's switch to from ISC DHCP Client to systemd-networkd. That change introduced code that reads from files in /run/systemd/netif/leases/, which begin with a line indicating that they contain "private data. Do not parse."
As this is an internal interface to systemd, it may change at any time in a way that could break WALinuxAgent. This issue was discussed in the original PR and concludes that "there is no proper way of getting the lease file details." This was an accurate statement at the time, but that has been addressed with systemd 256, which exposes the DHCP lease details through the systemd-networkd dbus interface.
An example of obtaining option 245 using via the dbus interface on the commandline using busctl and jq (for parsing the json responses) is:
This can, of course, be implemented in pure python.
It would be good to update WALinuxAgent to use supported interfaces where possible. Distros using systemd <256 will likely need to continue parsing internal systemd-networkd state.
The text was updated successfully, but these errors were encountered:
WALinuxAgent parses data explicitly listed as internal to systemd and not for direct access
#2979 updated WALinuxAgent to handle Ubuntu's switch to from ISC DHCP Client to systemd-networkd. That change introduced code that reads from files in
/run/systemd/netif/leases/
, which begin with a line indicating that they contain "private data. Do not parse."As this is an internal interface to systemd, it may change at any time in a way that could break WALinuxAgent. This issue was discussed in the original PR and concludes that "there is no proper way of getting the lease file details." This was an accurate statement at the time, but that has been addressed with systemd 256, which exposes the DHCP lease details through the systemd-networkd dbus interface.
An example of obtaining option 245 using via the dbus interface on the commandline using busctl and jq (for parsing the json responses) is:
This can, of course, be implemented in pure python.
It would be good to update WALinuxAgent to use supported interfaces where possible. Distros using systemd <256 will likely need to continue parsing internal systemd-networkd state.
The text was updated successfully, but these errors were encountered: