diff options
author | dankm <dan.mcgregor@usask.ca> | 2023-04-28 15:10:34 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-28 16:10:34 -0500 |
commit | 5abf5f5f2cf93c57ac74220251d2a2acce5f7099 (patch) | |
tree | 7b5793cc82d537714e369b5f800d504e282599fb | |
parent | 7ffd0bcd8379ae6ece096e7014444978efa5f7c8 (diff) | |
download | cloud-init-git-5abf5f5f2cf93c57ac74220251d2a2acce5f7099.tar.gz |
setup.py: use pkg-config for udev/rules path (#2137)
Distributions other than RHEL also use /usr/lib/udev for the rules
path. Instead of hardcoding the udev rules path for RedHat, check
pkg-config for the proper location.
-rw-r--r-- | setup.py | 14 | ||||
-rw-r--r-- | tools/.github-cla-signers | 1 |
2 files changed, 9 insertions, 6 deletions
@@ -46,7 +46,10 @@ def pkg_config_read(library, var): "systemdsystemconfdir": "/etc/systemd/system", "systemdsystemunitdir": "/lib/systemd/system", "systemdsystemgeneratordir": "/lib/systemd/system-generators", - } + }, + "udev": { + "udevdir": "/lib/udev", + }, } cmd = ["pkg-config", "--variable=%s" % var, library] try: @@ -307,14 +310,13 @@ data_files = [ ), ] if not platform.system().endswith("BSD"): - - RULES_PATH = LIB - if os.path.isfile("/etc/redhat-release"): - RULES_PATH = "/usr/lib" + RULES_PATH = pkg_config_read("udev", "udevdir") + if not in_virtualenv(): + RULES_PATH = "/" + RULES_PATH data_files.extend( [ - (RULES_PATH + "/udev/rules.d", [f for f in glob("udev/*.rules")]), + (RULES_PATH + "/rules.d", [f for f in glob("udev/*.rules")]), ( ETC + "/systemd/system/sshd-keygen@.service.d/", ["systemd/disable-sshd-keygen-if-cloud-init-active.conf"], diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers index 5d3cf7ac..7615f0fb 100644 --- a/tools/.github-cla-signers +++ b/tools/.github-cla-signers @@ -33,6 +33,7 @@ cjp256 Conan-Kudo cvstealth dankenigsberg +dankm david-caro dbungert ddymko |