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