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