get_latest_lease() function in CloudStack datasource does not match with lease filenames on fedora 25

Bug #1653115 reported by Loek
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Scott Moser

Bug Description

The get_latest_lease() in cloud-init's CloudStack datasource does not match fedora 25's dhcp lease file names;

The file cloudinit/sources/DataSourceCloudStack.py in Fedora 25;

    for file_name in lease_files:
        if file_name.startswith("dhclient.") and \
           (file_name.endswith(".lease") or file_name.endswith(".leases")):

The file cloudinit/sources/DataSourceCloudStack.py in Fedora 24;

    for file_name in lease_files:
        if file_name.endswith(".lease") or file_name.endswith(".leases"):

Lease file names as specified in /etc/sysconfig/network-scripts/network-functions on Fedora 25;

generate_lease_file_name () {
    local ver=$1
    LEASEFILE="/var/lib/dhclient/dhclient$ver-${DEVICE}.leases"
    if [ -f $LEASEFILE ]; then
         return
    fi
    LEASEFILE="/var/lib/dhclient/dhclient$ver-${UUID}-${DEVICE}.lease"
}

Cloud-init matches filenames starting with 'dhclient.' but the actual filename starts with 'dhclient-'.

Revision history for this message
Chad Smith (chad.smith) wrote :
Changed in cloud-init:
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → Scott Moser (smoser)
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.