Merge lp:~wido/cloud-init/cloudstack-dhcp into lp:~cloud-init-dev/cloud-init/trunk

Proposed by Dan Watkins
Status: Merged
Merged at revision: 1213
Proposed branch: lp:~wido/cloud-init/cloudstack-dhcp
Merge into: lp:~cloud-init-dev/cloud-init/trunk
Diff against target: 13 lines (+2/-1)
1 file modified
cloudinit/sources/ (+2/-1)
To merge this branch: bzr merge lp:~wido/cloud-init/cloudstack-dhcp
Reviewer Review Type Date Requested Status
Wido den Hollander (community) Approve
cloud-init Commiters Pending
Review via email:
To post a comment you must log in.
Revision history for this message
Wido den Hollander (wido) wrote :

I run this patch in production on our CloudStack environment which also has IPv6 with DHCPv6 enabled. Previous to this patch cloud-init would fail and with this patch it works.

review: Approve
Revision history for this message
Scott Moser (smoser) wrote :

i really hate \ at the end of the line.
would have preferred

if (file_name.startswith("dhclient.") and
        (file_name.endswith(".lease") or file_name.endswith(".leases"))):

oh well.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cloudinit/sources/'
2--- cloudinit/sources/ 2016-04-04 16:31:28 +0000
3+++ cloudinit/sources/ 2016-04-29 10:50:55 +0000
4@@ -206,7 +206,8 @@
5 latest_mtime = -1
6 latest_file = None
7 for file_name in lease_files:
8- if file_name.endswith(".lease") or file_name.endswith(".leases"):
9+ if file_name.startswith("dhclient.") and \
10+ (file_name.endswith(".lease") or file_name.endswith(".leases")):
11 abs_path = os.path.join(lease_d, file_name)
12 mtime = os.path.getmtime(abs_path)
13 if mtime > latest_mtime: