Skip to content

Commit

Permalink
Fix "unexpected EOF on client connection" errors.
Browse files Browse the repository at this point in the history
Fixes issue zenoss#5.
  • Loading branch information
cluther committed May 21, 2012
1 parent 97b0691 commit ab7cd07
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Depending on what version of Zenoss you're running you will need a different
package. Download the appropriate package for your Zenoss version from the list
below.

* Zenoss 4.1 - 4.2: [Packages for Zenoss 4][]
* Zenoss 3.0 - 4.0: [Packages for Zenoss 3][]
* Zenoss 4.1 - 4.2: [Packages for Python 2.7][]
* Zenoss 3.0 - 4.0: [Packages for Python 2.6][]

Then copy it to your Zenoss server and run the following commands as the zenoss
user.
Expand Down Expand Up @@ -163,6 +163,6 @@ remodeled. This occur once every 12 hours.


[Zenoss]: <http://www.zenoss.com/>
[Packages for Zenoss 4]: <http://zenpacks.zenoss.com/pypi/github/3.2/ZenPacks.zenoss.PostgreSQL/>
[Packages for Zenoss 3]: <http://zenpacks.zenoss.com/pypi/github/4.2/ZenPacks.zenoss.PostgreSQL/>
[Packages for Python 2.7]: <http://zenpacks.zenoss.com/pypi/github/4.2/ZenPacks.zenoss.PostgreSQL/>
[Packages for Python 2.6]: <http://zenpacks.zenoss.com/pypi/github/3.2/ZenPacks.zenoss.PostgreSQL/>
[git repository]: <https://github.com/zenoss/ZenPacks.zenoss.PostgreSQL>
2 changes: 2 additions & 0 deletions ZenPacks/zenoss/PostgreSQL/poll_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def getData(self):
else:
self._data[k] = v

pg.close()

self._cacheData()
return self._data

Expand Down
6 changes: 3 additions & 3 deletions ZenPacks/zenoss/PostgreSQL/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def __init__(self, host, port, username, password, ssl):
self._ssl = ssl
self._connections = {}

def __del__(self):
for conn in self._connections.values():
def close(self):
for value in self._connections.values():
try:
conn.close()
value['connection'].close()
except Exception:
pass

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = "ZenPacks.zenoss.PostgreSQL"
VERSION = "1.0.4"
VERSION = "1.0.5"
AUTHOR = "Zenoss"
LICENSE = "GPLv2"
NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.zenoss']
Expand Down

0 comments on commit ab7cd07

Please sign in to comment.