41a8add
From bb1b5831acb49976a088433390d44e1dcb9f2fb2 Mon Sep 17 00:00:00 2001
41a8add
From: Lubomir Rintel <lkundrak@v3.sk>
41a8add
Date: Thu, 22 Aug 2019 15:52:42 +0200
41a8add
Subject: [PATCH] Move the NetworkManager dispatcher script out of /etc
41a8add
41a8add
It's not user configuration and shouldn't ever have been there. Except for that
41a8add
it used to be the only location NetworkManager looked into. With NetworkManager
41a8add
1.20 that is no longer the case and the dispatcher scripts can be moved to
41a8add
/usr/lib.
41a8add
---
41a8add
 doc/rtd/topics/datasources/azure.rst | 2 +-
41a8add
 packages/redhat/cloud-init.spec.in   | 2 +-
41a8add
 setup.py                             | 4 ++--
41a8add
 3 files changed, 4 insertions(+), 4 deletions(-)
41a8add
41a8add
diff --git a/doc/rtd/topics/datasources/azure.rst b/doc/rtd/topics/datasources/azure.rst
41a8add
index b41cddd9..2156a3c4 100644
41a8add
--- a/doc/rtd/topics/datasources/azure.rst
41a8add
+++ b/doc/rtd/topics/datasources/azure.rst
41a8add
@@ -37,7 +37,7 @@ To find the endpoint, we now leverage the dhcp client's ability to log its
41a8add
 known values on exit.  The endpoint server is special DHCP option 245.
41a8add
 Depending on your networking stack, this can be done
41a8add
 by calling a script in /etc/dhcp/dhclient-exit-hooks or a file in
41a8add
-/etc/NetworkManager/dispatcher.d.  Both of these call a sub-command
41a8add
+/usr/lib/NetworkManager/dispatcher.d.  Both of these call a sub-command
41a8add
 'dhclient_hook' of cloud-init itself. This sub-command will write the client
41a8add
 information in json format to /run/cloud-init/dhclient.hook/<interface>.json.
41a8add
 
41a8add
diff --git a/packages/redhat/cloud-init.spec.in b/packages/redhat/cloud-init.spec.in
41a8add
index 057a5784..a4ec3dbe 100644
41a8add
--- a/packages/redhat/cloud-init.spec.in
41a8add
+++ b/packages/redhat/cloud-init.spec.in
41a8add
@@ -186,7 +186,7 @@ fi
41a8add
 %attr(0755, root, root) %{_initddir}/cloud-init
41a8add
 %endif
41a8add
 
41a8add
-%{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager
41a8add
+%{_prefix}/lib/NetworkManager/dispatcher.d/hook-network-manager
41a8add
 %{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient
41a8add
 
41a8add
 # Program binaries
41a8add
diff --git a/setup.py b/setup.py
41a8add
index fcaf26ff..cc25ed8e 100755
41a8add
--- a/setup.py
41a8add
+++ b/setup.py
41a8add
@@ -261,9 +261,9 @@ data_files = [
41a8add
 ]
41a8add
 if os.uname()[0] != 'FreeBSD':
41a8add
     data_files.extend([
41a8add
-        (ETC + '/NetworkManager/dispatcher.d/',
41a8add
-         ['tools/hook-network-manager']),
41a8add
         (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']),
41a8add
+        (USR + '/lib/NetworkManager/dispatcher.d/',
41a8add
+         ['tools/hook-network-manager']),
41a8add
         (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')])
41a8add
     ])
41a8add
 # Use a subclass for install that handles
41a8add
-- 
41a8add
2.23.0
41a8add