Skip to content

Commit

Permalink
Fixing Graphite & statsd socket error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Dorival committed May 22, 2012
1 parent 9f58f2e commit 4db1481
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metrology/reporter/graphite.py
Expand Up @@ -27,7 +27,7 @@ def __init__(self, host, port, **options):

@property
def socket(self):
if not self._socket:
if not hasattr(self, '_socket'):
self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._socket.connect((self.host, self.port))
return self._socket
Expand Down
2 changes: 1 addition & 1 deletion metrology/reporter/statsd.py
Expand Up @@ -15,7 +15,7 @@ def __init__(self, host, port, **options):

@property
def socket(self):
if not self._socket:
if not hasattr(self, '_socket'):
self._socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return self._socket

Expand Down

0 comments on commit 4db1481

Please sign in to comment.