Blob Blame History Raw
From bb1b5831acb49976a088433390d44e1dcb9f2fb2 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Thu, 22 Aug 2019 15:52:42 +0200
Subject: [PATCH] Move the NetworkManager dispatcher script out of /etc

It's not user configuration and shouldn't ever have been there. Except for that
it used to be the only location NetworkManager looked into. With NetworkManager
1.20 that is no longer the case and the dispatcher scripts can be moved to
/usr/lib.
---
 doc/rtd/topics/datasources/azure.rst | 2 +-
 packages/redhat/cloud-init.spec.in   | 2 +-
 setup.py                             | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/rtd/topics/datasources/azure.rst b/doc/rtd/topics/datasources/azure.rst
index b41cddd9..2156a3c4 100644
--- a/doc/rtd/topics/datasources/azure.rst
+++ b/doc/rtd/topics/datasources/azure.rst
@@ -37,7 +37,7 @@ To find the endpoint, we now leverage the dhcp client's ability to log its
 known values on exit.  The endpoint server is special DHCP option 245.
 Depending on your networking stack, this can be done
 by calling a script in /etc/dhcp/dhclient-exit-hooks or a file in
-/etc/NetworkManager/dispatcher.d.  Both of these call a sub-command
+/usr/lib/NetworkManager/dispatcher.d.  Both of these call a sub-command
 'dhclient_hook' of cloud-init itself. This sub-command will write the client
 information in json format to /run/cloud-init/dhclient.hook/<interface>.json.
 
diff --git a/packages/redhat/cloud-init.spec.in b/packages/redhat/cloud-init.spec.in
index 057a5784..a4ec3dbe 100644
--- a/packages/redhat/cloud-init.spec.in
+++ b/packages/redhat/cloud-init.spec.in
@@ -186,7 +186,7 @@ fi
 %attr(0755, root, root) %{_initddir}/cloud-init
 %endif
 
-%{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager
+%{_prefix}/lib/NetworkManager/dispatcher.d/hook-network-manager
 %{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient
 
 # Program binaries
diff --git a/setup.py b/setup.py
index fcaf26ff..cc25ed8e 100755
--- a/setup.py
+++ b/setup.py
@@ -261,9 +261,9 @@ data_files = [
 ]
 if os.uname()[0] != 'FreeBSD':
     data_files.extend([
-        (ETC + '/NetworkManager/dispatcher.d/',
-         ['tools/hook-network-manager']),
         (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']),
+        (USR + '/lib/NetworkManager/dispatcher.d/',
+         ['tools/hook-network-manager']),
         (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')])
     ])
 # Use a subclass for install that handles
-- 
2.23.0