sailesh1993 / rpms / cloud-init

Forked from rpms/cloud-init a year ago
Clone
ad9e5f
From ed7060ac1d5003f70fc3da4d6006a1a958a47b04 Mon Sep 17 00:00:00 2001
ad9e5f
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
ad9e5f
Date: Mon, 20 Jun 2022 10:31:14 +0200
ad9e5f
Subject: [PATCH 2/2] setup.py: adjust udev/rules default path (#1513)
ad9e5f
ad9e5f
RH-Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
ad9e5f
RH-MergeRequest: 80: setup.py: adjust udev/rules default path (#1513)
ad9e5f
RH-Commit: [2/2] 2cb64b004acbe1b6a30f943b0da51d2d1f2f0d50 (eesposit/cloud-init)
ad9e5f
RH-Bugzilla: 2096269
ad9e5f
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
ad9e5f
RH-Acked-by: Mohamed Gamal Morsy <mmorsy@redhat.com>
ad9e5f
ad9e5f
commit 70715125f3af118ae242770e61064c24f41e9a02
ad9e5f
Author: Emanuele Giuseppe Esposito <eesposit@redhat.com>
ad9e5f
Date:   Thu Jun 16 20:39:42 2022 +0200
ad9e5f
ad9e5f
    setup.py: adjust udev/rules default path (#1513)
ad9e5f
ad9e5f
    RHEL must put cloudinit .rules files in /usr/lib/udev/rules.d
ad9e5f
    This place is a rhel standard and since it is used by all packages
ad9e5f
    cannot be modified.
ad9e5f
ad9e5f
    Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
ad9e5f
ad9e5f
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
ad9e5f
---
ad9e5f
 setup.py | 7 ++++++-
ad9e5f
 1 file changed, 6 insertions(+), 1 deletion(-)
ad9e5f
ad9e5f
diff --git a/setup.py b/setup.py
ad9e5f
index a9132d2c..fdf27cd7 100755
ad9e5f
--- a/setup.py
ad9e5f
+++ b/setup.py
ad9e5f
@@ -302,6 +302,11 @@ data_files = [
ad9e5f
     ),
ad9e5f
 ]
ad9e5f
 if not platform.system().endswith("BSD"):
ad9e5f
+
ad9e5f
+    RULES_PATH = LIB
ad9e5f
+    if os.path.isfile("/etc/redhat-release"):
ad9e5f
+        RULES_PATH = "/usr/lib"
ad9e5f
+
ad9e5f
     data_files.extend(
ad9e5f
         [
ad9e5f
             (
ad9e5f
@@ -309,7 +314,7 @@ if not platform.system().endswith("BSD"):
ad9e5f
                 ["tools/hook-network-manager"],
ad9e5f
             ),
ad9e5f
             (ETC + "/dhcp/dhclient-exit-hooks.d/", ["tools/hook-dhclient"]),
ad9e5f
-            (LIB + "/udev/rules.d", [f for f in glob("udev/*.rules")]),
ad9e5f
+            (RULES_PATH + "/udev/rules.d", [f for f in glob("udev/*.rules")]),
ad9e5f
             (
ad9e5f
                 ETC + "/systemd/system/sshd-keygen@.service.d/",
ad9e5f
                 ["systemd/disable-sshd-keygen-if-cloud-init-active.conf"],
ad9e5f
-- 
ad9e5f
2.31.1
ad9e5f