sailesh1993 / rpms / cloud-init

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