goagent/goagent — pull request #6 by felixonmars (2014-04-07 08:51:18+00:00)
Title: fix DirectRegionFilter: don't fail when the function is not enabled

This fixes an error if regions not set:

```
Apr 07 16:21:27 felix-arch goagent[22114]: Traceback (most recent call last):
Apr 07 16:21:27 felix-arch goagent[22114]: File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
Apr 07 16:21:27 felix-arch goagent[22114]: self.finish_request(request, client_address)
Apr 07 16:21:27 felix-arch goagent[22114]: File "/usr/share/goagent/local/goagent", line 1735, in finish_request
Apr 07 16:21:27 felix-arch goagent[22114]: self.RequestHandlerClass(request, client_address, self)
Apr 07 16:21:27 felix-arch goagent[22114]: File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
Apr 07 16:21:27 felix-arch goagent[22114]: self.handle()
Apr 07 16:21:27 felix-arch goagent[22114]: File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
Apr 07 16:21:27 felix-arch goagent[22114]: self.handle_one_request()
Apr 07 16:21:27 felix-arch goagent[22114]: File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
Apr 07 16:21:27 felix-arch goagent[22114]: method()
Apr 07 16:21:27 felix-arch goagent[22114]: File "/usr/share/goagent/local/goagent", line 935, in do_METHOD
Apr 07 16:21:27 felix-arch goagent[22114]: action = handler_filter.filter(self)
Apr 07 16:21:27 felix-arch goagent[22114]: File "/usr/share/goagent/local/goagent", line 1852, in filter
Apr 07 16:21:27 felix-arch goagent[22114]: country_code = self.geoip.country_code_by_addr(iplist[0])
Apr 07 16:21:27 felix-arch goagent[22114]: AttributeError: 'NoneType' object has no attribute 'country_code_by_addr'
```