Skip to content

Commit

Permalink
Merge pull request #1398 from OpenConceptConsulting/feature/remove-un…
Browse files Browse the repository at this point in the history
…necessary-version-check

Removed extra version check
  • Loading branch information
naparuba committed Jan 8, 2015
2 parents 3fba007 + 8ed52af commit 2a94ee4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 18 deletions.
4 changes: 1 addition & 3 deletions bin/shinken-arbiter
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ if os.name != 'nt':
# on the Python version and the process limit "stack size".
# The factors used were acquired by testing a broad range of installations
stacksize_soft, stacksize_hard = resource.getrlimit(3)
if sys.version_info < (2, 6):
sys.setrecursionlimit(int(stacksize_soft * 0.65 + 1100))
elif sys.version_info < (3,):
if sys.version_info < (3,):
sys.setrecursionlimit(int(stacksize_soft * 1.9 + 3200))
else:
sys.setrecursionlimit(int(stacksize_soft * 2.4 + 3200))
Expand Down
4 changes: 1 addition & 3 deletions bin/shinken-scheduler
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ if os.name != 'nt':
# on the Python version and the process limit "stack size".
# The factors used were acquired by testing a broad range of installations
stacksize_soft, stacksize_hard = resource.getrlimit(3)
if sys.version_info < (2, 6):
sys.setrecursionlimit(int(stacksize_soft * 0.65 + 1100))
elif sys.version_info < (3,):
if sys.version_info < (3,):
sys.setrecursionlimit(int(stacksize_soft * 1.9 + 3200))
else:
sys.setrecursionlimit(int(stacksize_soft * 2.4 + 3200))
Expand Down
1 change: 1 addition & 0 deletions shinken/bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@


# Make sure people are using Python 2.6 or higher
# This is the canonical python version check
if sys.version_info < (2, 6):
sys.exit("Shinken requires as a minimum Python 2.6.x, sorry")
elif sys.version_info >= (3,):
Expand Down
7 changes: 4 additions & 3 deletions shinken/misc/importlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

import sys

if sys.version_info[:2] <= (2, 6):
try: # still try to import it from system:
# importlib was introduced in 2.7. It is also available as a backport
if sys.version_info[:2] < (2, 7):
try: # try to import the system-wide backported module
from importlib import *
except ImportError:
except ImportError: # load our bundled backported module
from ._importlib import *
else:
from importlib import *
6 changes: 1 addition & 5 deletions shinken/objects/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,7 @@ def read_config(self, files):
self.packs_dirs.append(cfg_dir_name)

# Now walk for it.
# BEWARE : we can follow symlinks only for python 2.6 and higher
args = {}
if sys.version_info >= (2, 6):
args['followlinks'] = True
for root, dirs, files in os.walk(cfg_dir_name, **args):
for root, dirs, files in os.walk(cfg_dir_name, followlinks=True):
for file in files:
if re.search("\.cfg$", file):
if self.read_config_silent == 0:
Expand Down
4 changes: 0 additions & 4 deletions test/test_conf_in_symlinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ def setUp(self):
def test_symlinks(self):
if os.name == 'nt':
return
if sys.version_info < (2 , 6):
print "************* WARNING********"*200
print "On python 2.4 and 2.5, the symlinks following is NOT managed"
return
svc = self.sched.services.find_srv_by_name_and_hostname("test_host_0", "test_HIDDEN")
self.assertIsNot(svc, None)

Expand Down

0 comments on commit 2a94ee4

Please sign in to comment.