sailesh1993 / rpms / cloud-init

Forked from rpms/cloud-init a year ago
Clone
Blob Blame History Raw
From c49b8b2ec4fcee5212440d996bc3dafa74992470 Mon Sep 17 00:00:00 2001
From: Eduardo Otubo <otubo@redhat.com>
Date: Thu, 14 Mar 2019 15:01:34 +0100
Subject: [PATCH] Revert: azure: ensure that networkmanager hook script runs

RH-Author: Eduardo Otubo <otubo@redhat.com>
Message-id: <20190314150134.28636-1-otubo@redhat.com>
Patchwork-id: 84868
O-Subject: [RHEL-8.0.1 cloud-init PATCHv2] Revert: azure: ensure that networkmanager hook script runs
Bugzilla: 1579237
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>

This patch reverts the commit:

commit c48497435e8195dbd87262c2f00e484e63fe3343
Author: Lars Kellogg-Stedman <lars@redhat.com>
Date:   Thu Jun 15 12:20:39 2017 -0400

    azure: ensure that networkmanager hook script runs

    The networkmanager hook script was failing to run due to the changes
    we made to resolve rhbz#1440831.  This corrects the regression by
    allowing the NM hook script to run regardless of whether or not
    cloud-init is "enabled".

    Resolves: rhbz#1460206
    X-downstream-only: true

Resolves: rhbz:1579237
X-downstream-only: yes

Signed-off-by: Eduardo Otubo <otubo@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 tools/hook-dhclient        | 3 ++-
 tools/hook-network-manager | 3 ++-
 tools/hook-rhel.sh         | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/hook-dhclient b/tools/hook-dhclient
index 181cd51..02122f3 100755
--- a/tools/hook-dhclient
+++ b/tools/hook-dhclient
@@ -13,7 +13,8 @@ is_azure() {
 }
 
 is_enabled() {
-    # only execute hooks if cloud-init is running on azure
+    # only execute hooks if cloud-init is enabled and on azure
+    [ -e /run/cloud-init/enabled ] || return 1
     is_azure
 }
 
diff --git a/tools/hook-network-manager b/tools/hook-network-manager
index 1d52cad..67d9044 100755
--- a/tools/hook-network-manager
+++ b/tools/hook-network-manager
@@ -13,7 +13,8 @@ is_azure() {
 }
 
 is_enabled() {
-    # only execute hooks if cloud-init running on azure
+    # only execute hooks if cloud-init is enabled and on azure
+    [ -e /run/cloud-init/enabled ] || return 1
     is_azure
 }
 
diff --git a/tools/hook-rhel.sh b/tools/hook-rhel.sh
index d75767e..513a551 100755
--- a/tools/hook-rhel.sh
+++ b/tools/hook-rhel.sh
@@ -13,7 +13,8 @@ is_azure() {
 }
 
 is_enabled() {
-    # only execute hooks if cloud-init is running on azure
+    # only execute hooks if cloud-init is enabled and on azure
+    [ -e /run/cloud-init/enabled ] || return 1
     is_azure
 }
 
-- 
1.8.3.1