Azure data source contains hardcoded distribution-specific paths

Bug #1571629 reported by Lars Kellogg-Stedman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Undecided
Unassigned

Bug Description

The Azure data source (in sources/helpers/azure.py) attempts to read the current DHCP lease from /var/lib/dhcp/dhclient.eth0.leases, but that path does not exist on, for example, RHEL/Fedora/CentOS environments (which appear to use /var/lib/dhclient/dhclient--eth0.lease).

The location of the lease file should probably be part of the Distro object.

A secondary problem is that the WALinuxAgentShim class does not have any access to the Distro object, so that code needs some fiddling to implement this fix.

Related branches

Revision history for this message
Lars Kellogg-Stedman (larsks) wrote :

...and systems running NetworkManager store it somewhere *else*:

  $ ps -fe | grep dhclient
  root 27312 27292 0 Apr11 ? 00:00:00 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-eth0.pid -lf /var/lib/NetworkManager/dhclient-e4599575-5a21-46c1-bfe3-62cb23268b69-eth0.lease -cf /var/lib/NetworkManager/dhclient-eth0.conf eth0

Handling this properly probably entails talking to NetworkManager via the API (or the via nmcli tool).

Revision history for this message
Johnson Shi (johnsonshi) wrote :

Also tested and got this on CentOS 6.8.

no longer affects: centos
Revision history for this message
Johnson Shi (johnsonshi) wrote :

It still affects CentOS 6.8. I accidentally triggered it to say that it no longer affects centos, but it actually still does.

Johnson Shi (johnsonshi)
Changed in cloud-init:
assignee: nobody → Johnson Shi (johnsonshi)
status: New → In Progress
Johnson Shi (johnsonshi)
Changed in cloud-init:
assignee: Johnson Shi (johnsonshi) → nobody
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: In Progress → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.