File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""A Python Riemann client and command line tool"""
22
3- __version__ = '3.0.0 '
3+ __version__ = '3.0.1 '
44__author__ = 'Sam Clements <sam.clements@datasift.com>'
Original file line number Diff line number Diff line change 99import riemann_client .riemann_pb2
1010
1111
12+ def socket_recvall (socket , length , bufsize = 4096 ):
13+ """Recives bytes from a socket until the buffer is the requested length"""
14+ data = ""
15+ while len (data ) < length :
16+ data += socket .recv (bufsize )
17+ return data
18+
19+
1220class RiemannError (Exception ):
1321 """Error class for errors recived from the Riemann server"""
1422 pass
@@ -71,16 +79,9 @@ def send(self, message):
7179
7280 length = struct .unpack ('!I' , self .socket .recv (4 ))[0 ]
7381 response = riemann_client .riemann_pb2 .Msg ()
74- response .ParseFromString (self . socket_recvall (socket , length ))
82+ response .ParseFromString (socket_recvall (self . socket , length ))
7583
7684 if not response .ok :
7785 raise RiemannError (response .error )
7886
7987 return response
80-
81- @staticmethod
82- def socket_recvall (socket , length , bufsize = 4096 ):
83- data = ""
84- while len (data ) < length :
85- data += socket .recv (bufsize )
86- return data
Original file line number Diff line number Diff line change 55
66setuptools .setup (
77 name = "riemann-client" ,
8- version = '3.0.0 ' ,
8+ version = '3.0.1 ' ,
99
1010 author = "Sam Clements" ,
1111 author_email = "sam.clements@datasift.com" ,
You can’t perform that action at this time.
0 commit comments