sailesh1993 / rpms / cloud-init

Forked from rpms/cloud-init a year ago
Clone
18322d
From a00bafbfc54b010d7bbe95536929c678288d4c80 Mon Sep 17 00:00:00 2001
18322d
From: Eduardo Otubo <otubo@redhat.com>
18322d
Date: Mon, 1 Jul 2019 11:22:52 +0200
18322d
Subject: [PATCH 1/2] Revert: azure: ensure that networkmanager hook script
18322d
 runs
18322d
18322d
RH-Author: Eduardo Otubo <otubo@redhat.com>
18322d
Message-id: <20190701112252.32674-1-otubo@redhat.com>
18322d
Patchwork-id: 89162
18322d
O-Subject: [rhel-8.1.0 cloud-init PATCH] Revert: azure: ensure that networkmanager hook script runs
18322d
Bugzilla: 1692914
18322d
RH-Acked-by: Mohammed Gamal <mgamal@redhat.com>
18322d
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
18322d
18322d
This patch reverts the commit:
18322d
18322d
commit c48497435e8195dbd87262c2f00e484e63fe3343
18322d
Author: Lars Kellogg-Stedman <lars@redhat.com>
18322d
Date:   Thu Jun 15 12:20:39 2017 -0400
18322d
18322d
    azure: ensure that networkmanager hook script runs
18322d
18322d
    The networkmanager hook script was failing to run due to the changes
18322d
    we made to resolve rhbz#1440831.  This corrects the regression by
18322d
    allowing the NM hook script to run regardless of whether or not
18322d
    cloud-init is "enabled".
18322d
18322d
    Resolves: rhbz#1460206
18322d
    X-downstream-only: true
18322d
18322d
Resolves: rhbz#1692914
18322d
X-downstream-only: true
18322d
18322d
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
18322d
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
18322d
---
18322d
 tools/hook-dhclient        | 3 ++-
18322d
 tools/hook-network-manager | 3 ++-
18322d
 tools/hook-rhel.sh         | 3 ++-
18322d
 3 files changed, 6 insertions(+), 3 deletions(-)
18322d
18322d
diff --git a/tools/hook-dhclient b/tools/hook-dhclient
18322d
index 181cd51..02122f3 100755
18322d
--- a/tools/hook-dhclient
18322d
+++ b/tools/hook-dhclient
18322d
@@ -13,7 +13,8 @@ is_azure() {
18322d
 }
18322d
 
18322d
 is_enabled() {
18322d
-    # only execute hooks if cloud-init is running on azure
18322d
+    # only execute hooks if cloud-init is enabled and on azure
18322d
+    [ -e /run/cloud-init/enabled ] || return 1
18322d
     is_azure
18322d
 }
18322d
 
18322d
diff --git a/tools/hook-network-manager b/tools/hook-network-manager
18322d
index 1d52cad..67d9044 100755
18322d
--- a/tools/hook-network-manager
18322d
+++ b/tools/hook-network-manager
18322d
@@ -13,7 +13,8 @@ is_azure() {
18322d
 }
18322d
 
18322d
 is_enabled() {
18322d
-    # only execute hooks if cloud-init running on azure
18322d
+    # only execute hooks if cloud-init is enabled and on azure
18322d
+    [ -e /run/cloud-init/enabled ] || return 1
18322d
     is_azure
18322d
 }
18322d
 
18322d
diff --git a/tools/hook-rhel.sh b/tools/hook-rhel.sh
18322d
index d75767e..513a551 100755
18322d
--- a/tools/hook-rhel.sh
18322d
+++ b/tools/hook-rhel.sh
18322d
@@ -13,7 +13,8 @@ is_azure() {
18322d
 }
18322d
 
18322d
 is_enabled() {
18322d
-    # only execute hooks if cloud-init is running on azure
18322d
+    # only execute hooks if cloud-init is enabled and on azure
18322d
+    [ -e /run/cloud-init/enabled ] || return 1
18322d
     is_azure
18322d
 }
18322d
 
18322d
-- 
18322d
1.8.3.1
18322d