summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceCloudStack.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-04-27 12:50:12 -0400
committerScott Moser <smoser@brickies.net>2017-04-27 12:50:12 -0400
commit8310484a880690529a4936615df596d467e51708 (patch)
tree886aeb1a6e3ca809e466ddbcacbe9741b56dafa0 /cloudinit/sources/DataSourceCloudStack.py
parentaf63cf763946bca6163dc797195a3aeae975f8da (diff)
parent513e99e049eab4acea14e187f59d760adc755b40 (diff)
downloadvyos-cloud-init-8310484a880690529a4936615df596d467e51708.tar.gz
vyos-cloud-init-8310484a880690529a4936615df596d467e51708.zip
merge from 513e99e049ea at 0.7.9-113-g513e99e0
Diffstat (limited to 'cloudinit/sources/DataSourceCloudStack.py')
-rw-r--r--cloudinit/sources/DataSourceCloudStack.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cloudinit/sources/DataSourceCloudStack.py b/cloudinit/sources/DataSourceCloudStack.py
index b0ab275c..0188d894 100644
--- a/cloudinit/sources/DataSourceCloudStack.py
+++ b/cloudinit/sources/DataSourceCloudStack.py
@@ -178,9 +178,10 @@ def get_default_gateway():
def get_dhclient_d():
# find lease files directory
- supported_dirs = ["/var/lib/dhclient", "/var/lib/dhcp"]
+ supported_dirs = ["/var/lib/dhclient", "/var/lib/dhcp",
+ "/var/lib/NetworkManager"]
for d in supported_dirs:
- if os.path.exists(d):
+ if os.path.exists(d) and len(os.listdir(d)) > 0:
LOG.debug("Using %s lease directory", d)
return d
return None
@@ -207,8 +208,8 @@ def get_latest_lease():
def get_vr_address():
# Get the address of the virtual router via dhcp leases
- # see http://bit.ly/T76eKC for documentation on the virtual router.
# If no virtual router is detected, fallback on default gateway.
+ # See http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.8/virtual_machines/user-data.html # noqa
lease_file = get_latest_lease()
if not lease_file:
LOG.debug("No lease file found, using default gateway")