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