Azure data source assumes use of dhclient

Bug #1936823 reported by Robert Schweikert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Medium
Unassigned

Bug Description

The Azure data source assumes that all Linux distros use dhclient. Location of a lease file is hard coded to

"""
LEASE_FILE = '/var/lib/dhcp/dhclient.eth0.leases'
"""

and if the file is not found the data source reports errors:

"""
Failed to read /var/lib/dhcp/dhclient.eth0.leases: [Errno 2] No such file or directory: '/var/lib/dhcp/dhclient.eth0.leases'
"""

Further, during the cloud-init local stage cloud-init establishes a temporary dhclient connect but the lease file is written to a temporray location such as:

"""
/var/tmp/cloud-init/cloud-init-dhcp-sbhredt8/dhcp.leases
"""

The Azure data source should check if the network is up rather than depending on specific markers in the file system left by specific implementations for dhcp connections. The kernel sysfs provides more reliable methods to detect network connection precense.

James Falcon (falcojr)
Changed in cloud-init:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Triaged → 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.