mirror of https://github.com/fail2ban/fail2ban
ENH: until we make it proper module -- adjust sys.path only if system-wide run
parent
348239cf14
commit
9e7a3b7a04
|
@ -33,7 +33,9 @@ import getopt, time, shlex, socket
|
|||
|
||||
# Inserts our own modules path first in the list
|
||||
# fix for bug #343821
|
||||
sys.path.insert(1, "/usr/share/fail2ban")
|
||||
if os.path.abspath(__file__).startswith('/usr/'):
|
||||
# makes sense to use system-wide library iff -client is also under /usr/
|
||||
sys.path.insert(1, "/usr/share/fail2ban")
|
||||
|
||||
# Now we can import our modules
|
||||
from common.version import version
|
||||
|
|
|
@ -29,7 +29,9 @@ import getopt, sys, time, logging, os
|
|||
|
||||
# Inserts our own modules path first in the list
|
||||
# fix for bug #343821
|
||||
sys.path.insert(1, "/usr/share/fail2ban")
|
||||
if os.path.abspath(__file__).startswith('/usr/'):
|
||||
# makes sense to use system-wide library iff -regex is also under /usr/
|
||||
sys.path.insert(1, "/usr/share/fail2ban")
|
||||
|
||||
from client.configparserinc import SafeConfigParserWithIncludes
|
||||
from ConfigParser import NoOptionError, NoSectionError, MissingSectionHeaderError
|
||||
|
|
|
@ -32,7 +32,9 @@ import getopt, sys, logging
|
|||
|
||||
# Inserts our own modules path first in the list
|
||||
# fix for bug #343821
|
||||
sys.path.insert(1, "/usr/share/fail2ban")
|
||||
if os.path.abspath(__file__).startswith('/usr/'):
|
||||
# makes sense to use system-wide library iff -server is also under /usr/
|
||||
sys.path.insert(1, "/usr/share/fail2ban")
|
||||
|
||||
from common.version import version
|
||||
from server.server import Server
|
||||
|
|
Loading…
Reference in New Issue