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