zalando/pg_view — pull request #8 by moreati (2014-02-21 14:11:25+00:00)
Title: Ensure collectors variable is initialised

If no instances are detected by pg_view.py then `UnboundLocalError` occurs in the finally clause of main().
```
No suitable PostgreSQL instances detected, exiting...
hint: use -v for details, or specify connection parameters manually in the configuration file (-c)
Traceback (most recent call last):
File "./pg_view.py", line 3161, in
main()
File "./pg_view.py", line 3152, in main
for c in collectors:
UnboundLocalError: local variable 'collectors' referenced before assignment
```
To fix this initialise the `collectors` variable outside the try block, guaranteeing it's initialised before the finally: block can execute.