summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorsebres <serg.brester@sebres.de>2016-08-11 19:57:40 +0200
committersebres <serg.brester@sebres.de>2016-08-12 17:59:24 +0200
commit6cdc1ce68522c137c7242ce8dbdb8bca1bb138e7 (patch)
tree6a64702d4e6d061490005dae16e1936bf63fe4c8 /setup.py
parent38d53a72fd2b55fae0c6a57e7ea10ffa3446b650 (diff)
downloadfail2ban-6cdc1ce68522c137c7242ce8dbdb8bca1bb138e7.tar.gz
compatibility fix (virtualenv, running test cases in py3)
# Conflicts: # MANIFEST
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/setup.py b/setup.py
index aa9f7055..a4a3f977 100755
--- a/setup.py
+++ b/setup.py
@@ -49,20 +49,7 @@ import sys
import warnings
from glob import glob
-
-def updatePyExec(bindir, executable=None):
- """Update fail2ban-python link to current python version (where f2b-modules located/installed)
- """
- bindir = os.path.realpath(bindir)
- if executable is None:
- executable = sys.executable
- pypath = os.path.join(bindir, 'fail2ban-python')
- # if not exists or point to another version - update link:
- isfile = os.path.isfile(pypath)
- if not isfile or os.path.realpath(pypath) != os.path.realpath(executable):
- if isfile:
- os.unlink(pypath)
- os.symlink(executable, pypath)
+from fail2ban.setup import updatePyExec
# Wrapper to install python binding (to current python version):
@@ -80,6 +67,9 @@ class install_scripts_f2b(install_scripts):
return outputs
+# Update fail2ban-python env to current python version (where f2b-modules located/installed)
+updatePyExec(os.path.join(os.path.dirname(__file__), 'bin'))
+
if setuptools and "test" in sys.argv:
import logging
logSys = logging.getLogger("fail2ban")