summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceCloudStack.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-08-23 16:48:42 -0400
committerScott Moser <smoser@brickies.net>2016-08-23 16:48:42 -0400
commit86e2614b6c3db342aa5a6590e91b9e459bbcb484 (patch)
tree6996805b91a0c1c31f3afea3a689348bf760de63 /cloudinit/sources/DataSourceCloudStack.py
parentc937c66dd0d1ad7b73dcc2efb5eb4c16b05f4479 (diff)
parent9f7ce5f090689b664ffce7e0b4ac78bfeafd1a79 (diff)
downloadvyos-cloud-init-86e2614b6c3db342aa5a6590e91b9e459bbcb484.tar.gz
vyos-cloud-init-86e2614b6c3db342aa5a6590e91b9e459bbcb484.zip
merge trunk at 0.7.7~bzr1245
Diffstat (limited to 'cloudinit/sources/DataSourceCloudStack.py')
-rw-r--r--cloudinit/sources/DataSourceCloudStack.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/cloudinit/sources/DataSourceCloudStack.py b/cloudinit/sources/DataSourceCloudStack.py
index 455a4652..4de1f563 100644
--- a/cloudinit/sources/DataSourceCloudStack.py
+++ b/cloudinit/sources/DataSourceCloudStack.py
@@ -25,14 +25,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
-import time
from socket import inet_ntoa
from struct import pack
+import time
from cloudinit import ec2_utils as ec2
from cloudinit import log as logging
+from cloudinit import sources
from cloudinit import url_helper as uhelp
-from cloudinit import sources, util
+from cloudinit import util
LOG = logging.getLogger(__name__)
@@ -206,7 +207,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: