Skip to content

Commit a7996c0

Browse files
committed
cleanup tox
1 parent 9482016 commit a7996c0

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

leonardo/module/search/__init__.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ def apps(self):
1717
INSTALLED_APPS = []
1818
try:
1919
import whoosh
20-
except ImportError:
21-
pass
20+
except Exception as e:
21+
try:
22+
import haystack
23+
except ImportError as e:
24+
warnings.warn(
25+
'Haystack search engine is disabled because: {}'.format(e))
26+
except ImproperlyConfigured as e:
27+
warnings.warn(
28+
'Haystack search engine is disabled because: {}'.format(e))
29+
else:
30+
INSTALLED_APPS += ['haystack']
2231
else:
23-
INSTALLED_APPS += ['whoosh']
24-
25-
try:
26-
import haystack
27-
except ImportError as e:
28-
warnings.warn('Haystack search engine is disabled because: {}'.format(e))
29-
except ImproperlyConfigured as e:
30-
warnings.warn('Haystack search engine is disabled because: {}'.format(e))
31-
else:
32-
INSTALLED_APPS += ['haystack']
32+
INSTALLED_APPS += ['whoosh', 'haystack']
3333

3434
return INSTALLED_APPS + ['leonardo.module.search']
3535

tox.ini

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
[tox]
2-
setupdir = ..
2+
setupdir = .
33
distribute = False
44
envlist =
55
{py27,py33,py34,py35}-django17,
66
{py27,py35}-django18,
77

88
[testenv]
99
usedevelop = True
10-
install_command = pip install --allow-external --download={toxworkdir}/.cache pbr git+https://github.com/openstack/horizon@stable/juno#egg=horizon --allow-insecure netaddr -U {opts} {packages}
1110
commands =
1211
{envpython} tests/manage.py test {posargs:testapp} --settings=leonardo.settings
1312
setenv =
1413
PYTHONPATH = .:{toxworkdir}
1514
deps =
16-
django17: Django>=1.7,<1.8
17-
django18: Django>=1.8,<1.9
1815
-rrequirements/tests.txt

0 commit comments

Comments
 (0)