ask/django-celery — Issue #115: djcelerymon: AttributeError: 'bool' object has no attribute 'lower'
Author: mar-pet
Created: 2012-03-06 11:53:17+00:00
State: open

Fix for #111 introduced another problem: `djcelery/mon.py`, line 25: default value of environment variable `DJCELERYMON_DEBUG` passed to `str_to_bool()` should not be bool, but string.

Currently if `DJCELERYMON_DEBUG` is not set we get:
```
Traceback (most recent call last):
File "/home/user/.virtualenvs/venv/bin/djcelerymon",line 9, in
load_entry_point('django-celery==2.5.1','console_scripts', 'djcelerymon')()
File "/home/user/.virtualenvs/venv/local/lib/python2.7/site-packages/pkg_resources.py",line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group,name)
File "/home/user/.virtualenvs/venv/local/lib/python2.7/site-packages/pkg_resources.py",line 2279, in load_entry_point
return ep.load()
File "/home/user/.virtualenvs/venv/local/lib/python2.7/site-packages/pkg_resources.py",line 1989, in load
entry = __import__(self.module_name,globals(),globals(), ['__name__'])
File "/home/user/.virtualenvs/venv/local/lib/python2.7/site-packages/djcelery/mon.py",line 25, in
"DEBUG": str_to_bool(os.environ.get("DJCELERYMON_DEBUG",False))}
File "/home/user/.virtualenvs/venv/local/lib/python2.7/site-packages/celery/app/defaults.py",line 45, in str_to_bool
return table[term.lower()]
AttributeError: 'bool' object has no attribute 'lower'
```