3956c3
From d3a5f6f36ca673bc69d2e020c65fb85bf0dfc519 Mon Sep 17 00:00:00 2001
3956c3
From: Ryan McCabe <rmccabe@redhat.com>
3956c3
Date: Tue, 13 Feb 2018 22:42:17 -0500
3956c3
Subject: [PATCH] azure: Fix publishing of hostname
3956c3
3956c3
Set the DHCP_HOSTNAME env var before bouncing the interfaces
3956c3
to ensure that the hostname is published correctly.
3956c3
3956c3
Resolves: rhbz#1434109
3956c3
3956c3
X-downstream-only: yes
3956c3
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
3956c3
---
3956c3
 cloudinit/sources/DataSourceAzure.py | 3 ++-
3956c3
 1 file changed, 2 insertions(+), 1 deletion(-)
3956c3
3956c3
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
3956c3
index 48a3e1df..a0ebd2ba 100644
3956c3
--- a/cloudinit/sources/DataSourceAzure.py
3956c3
+++ b/cloudinit/sources/DataSourceAzure.py
3956c3
@@ -27,7 +27,8 @@ AGENT_START = ['service', 'walinuxagent', 'start']
3956c3
 AGENT_START_BUILTIN = "__builtin__"
3956c3
 BOUNCE_COMMAND = [
3956c3
     'sh', '-xc',
3956c3
-    "i=$interface; x=0; ifdown $i || x=$?; ifup $i || x=$?; exit $x"
3956c3
+    "i=$interface; DHCP_HOSTNAME=$hostname; x=0; "
3956c3
+    "ifdown $i || x=$?; ifup $i || x=$?; exit $x"
3956c3
 ]
3956c3
 # azure systems will always have a resource disk, and 66-azure-ephemeral.rules
3956c3
 # ensures that it gets linked to this path.
3956c3
-- 
3956c3
2.14.3
3956c3