File fix_hardcoded_libpath_for_websession.patch of Package cobbler

From: Jörgen Maas <jorgen.maas@gmail.com>
Subject: Python3: Fix to setup.py so that install defaults to /usr/local.
References: 
Patch-Mainline: 
Git-commit: c1e83f208cc7c7e5943e004c640539fed1440d70
Git-repo: https://github.com/cobbler/cobbler.git


Signed-off-by: Thomas Renninger <trenn@suse.com>

Index: cobbler-3.0.0+git20190806.32c4bae0/setup.py
===================================================================
--- cobbler-3.0.0+git20190806.32c4bae0.orig/setup.py
+++ cobbler-3.0.0+git20190806.32c4bae0/setup.py
@@ -365,10 +365,6 @@ class install(_install):
         # Run the usual stuff.
         _install.run(self)
 
-        # If --root wasn't specified default to /usr/local
-        if self.root is None:
-            self.root = "/usr/local"
-
         # Hand over some directories to the webserver user
         path = os.path.join(self.install_data, 'share/cobbler/web')
         try:
@@ -379,9 +375,7 @@ class install(_install):
         if not os.path.abspath(libpath):
             # The next line only works for absolute libpath
             raise Exception("libpath is not absolute.")
-        # libpath is hardcoded in the code everywhere
-        # therefor cant relocate using self.root
-        path = os.path.join(libpath, 'webui_sessions')
+        path = os.path.join(self.root + libpath, 'webui_sessions')
         try:
             self.change_owner(path, http_user)
         except KeyError as e:
openSUSE Build Service is sponsored by