if statsd is not defined you will get None here, you need:

```python
statsd=cfg.get('statsd', False)
```