diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2017-09-06 14:27:06 +0200 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2017-10-16 15:11:39 +0200 |
commit | d82741b1a8ada493ca74efa5d5c8b731412d035c (patch) | |
tree | 81930d86724c87b5e5b83757d98781a80b936283 | |
parent | 948c1a4d423dba289342844fb177bd5fa9828fc0 (diff) | |
download | sssd-d82741b1a8ada493ca74efa5d5c8b731412d035c.tar.gz sssd-d82741b1a8ada493ca74efa5d5c8b731412d035c.tar.xz sssd-d82741b1a8ada493ca74efa5d5c8b731412d035c.zip |
intg: Prefer locally built python modules
Patch prepends path to sssd python modules; so we will be
able to import them without any issue and they will be preferred over
system modules.
sh$[/tmp/sssd-intg.3gb4hzpn/var/log/sssd] python2
Python 2.7.13 (default, Aug 16 2017, 12:56:26)
[GCC 7.1.1 20170802 (Red Hat 7.1.1-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import SSSDConfig
>>> print(SSSDConfig.__file__)
/tmp/sssd-intg.3gb4hzpn/lib/python2.7/site-packages/SSSDConfig/__init__.pyc
>>> import pyhbac
>>> print(pyhbac.__file__)
/tmp/sssd-intg.3gb4hzpn/lib64/python2.7/site-packages/pyhbac.so
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r-- | src/tests/intg/Makefile.am | 1 | ||||
-rw-r--r-- | src/tests/intg/__init__.py | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/tests/intg/Makefile.am b/src/tests/intg/Makefile.am index 0acab288e..b9bfdb209 100644 --- a/src/tests/intg/Makefile.am +++ b/src/tests/intg/Makefile.am @@ -1,4 +1,5 @@ dist_noinst_DATA = \ + __init__.py \ config.py.m4 \ util.py \ sssd_nss.py \ diff --git a/src/tests/intg/__init__.py b/src/tests/intg/__init__.py new file mode 100644 index 000000000..542f4d13c --- /dev/null +++ b/src/tests/intg/__init__.py @@ -0,0 +1,13 @@ +import sys +import config + +if sys.version_info[0] > 2: + LOCAL_PYEXECDIR = config.PY3EXECDIR + LOCAL_PYDIR = config.PY3DIR +else: + LOCAL_PYEXECDIR = config.PY2EXECDIR + LOCAL_PYDIR = config.PY2DIR + +for path in [LOCAL_PYEXECDIR, LOCAL_PYDIR]: + if path not in sys.path: + sys.path.insert(0, path) |