sailesh1993 / rpms / cloud-init

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