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