summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2016-04-29 11:59:45 +0100
committerDaniel Watkins <daniel.watkins@canonical.com>2016-04-29 11:59:45 +0100
commit0aa443a1b70393a4c5a027735f45330081274c45 (patch)
treed8ca9d0035260b33a8e8c9109dcd2960fe30a42b
parentb029dcefe1ed33be8ed80f2e376ca6874dfd64f7 (diff)
parentaee0edd93cb4d78b5e0d1aec71e977aabf31cdd0 (diff)
downloadvyos-cloud-init-0aa443a1b70393a4c5a027735f45330081274c45.tar.gz
vyos-cloud-init-0aa443a1b70393a4c5a027735f45330081274c45.zip
cloudstack: Only use DHCPv4 lease files as a datasource
LP: #1576273
-rw-r--r--ChangeLog2
-rw-r--r--cloudinit/sources/DataSourceCloudStack.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7bfd0c0a..c5444ba4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -105,6 +105,8 @@
- centos: Ensure that resolve conf object is written as a str (LP: #1479988)
- chef: straighten out validation_cert and validation_key (LP: #1568940)
- phone_home: allow usage of fqdn (LP: #1566824) [Ollie Armstrong]
+ - cloudstack: Only use DHCPv4 lease files as a datasource (LP: #1576273)
+ [Wido den Hollander]
0.7.6:
- open 0.7.6
diff --git a/cloudinit/sources/DataSourceCloudStack.py b/cloudinit/sources/DataSourceCloudStack.py
index 455a4652..4ba019df 100644
--- a/cloudinit/sources/DataSourceCloudStack.py
+++ b/cloudinit/sources/DataSourceCloudStack.py
@@ -206,7 +206,8 @@ def get_latest_lease():
latest_mtime = -1
latest_file = None
for file_name in lease_files:
- if file_name.endswith(".lease") or file_name.endswith(".leases"):
+ if file_name.startswith("dhclient.") and \
+ (file_name.endswith(".lease") or file_name.endswith(".leases")):
abs_path = os.path.join(lease_d, file_name)
mtime = os.path.getmtime(abs_path)
if mtime > latest_mtime: