summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/sources/DataSourceAzure.py6
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)