diff options
author | Kim Hagen <kim.sidney@gmail.com> | 2018-10-22 14:56:52 +0200 |
---|---|---|
committer | Kim Hagen <kim.sidney@gmail.com> | 2018-10-22 14:56:52 +0200 |
commit | dab1aa69b8e99d841ba90c42c30796e68242bbe2 (patch) | |
tree | 37cbdec3ead86c3ff7170c8a8e69ab4f181a9da5 /cloudinit | |
parent | c6596d86435fdb1933a7755de110e8f6e8de6aaf (diff) | |
download | vyos-cloud-init-dab1aa69b8e99d841ba90c42c30796e68242bbe2.tar.gz vyos-cloud-init-dab1aa69b8e99d841ba90c42c30796e68242bbe2.zip |
Get ip address on azure
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/sources/DataSourceAzure.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py index 0ee622e2..b66da647 100644 --- a/cloudinit/sources/DataSourceAzure.py +++ b/cloudinit/sources/DataSourceAzure.py @@ -12,6 +12,7 @@ import os import os.path import re from time import time +from subprocess import call from xml.dom import minidom import xml.etree.ElementTree as ET @@ -257,6 +258,11 @@ class DataSourceAzure(sources.DataSource): dsname = 'Azure' _negotiated = False + process_name = 'dhclient' + + tmpps = os.popen("ps -Af").read() + if process_name not in tmpps[:]: + call(['/sbin/dhclient', DEFAULT_PRIMARY_NIC]) def __init__(self, sys_cfg, distro, paths): sources.DataSource.__init__(self, sys_cfg, distro, paths) |