Module: check_mk
Branch: master
Commit: 32ffe59246283df2401b65d540e54bdee2103e80
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=32ffe59246283d…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Nov 26 14:18:52 2018 +0100
Unbreak google.auth import.
Change-Id: Iab1722fa0943e540d4c8b08e221f971e3c614f67
---
omd/packages/Python/sitecustomize.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/omd/packages/Python/sitecustomize.py b/omd/packages/Python/sitecustomize.py
index 6a6e6d6..7a50788 100644
--- a/omd/packages/Python/sitecustomize.py
+++ b/omd/packages/Python/sitecustomize.py
@@ -1,12 +1,16 @@
#!/usr/bin/env python
# Make the site python know about the Check_MK specific python module paths
-import sys, os
+import os
+import site
+import sys
-# Set the Check_MK version specific python module directory. This is
-# the location for the extra python modules shipped with Check_MK.
+# Set the Check_MK version specific python module directory. This is the
+# location for the extra python modules shipped with Check_MK.
+# NOTE: Modifying sys.path alone is not enough, site.addsitedir makes sure that
+# path configuration files (*.pth) are actually found!
version_path = os.path.dirname(os.path.dirname(sys.executable))
-sys.path.insert(0, version_path + "/lib/python")
+site.addsitedir(version_path + "/lib/python")
# Regular use case: When "omd" is being executed as root, we don't know
# anything about the site -> Only set the version specific directory.