Skip to content

Commit ec08406

Browse files
vdombrovskiracciari
vdombrovski
authored andcommitted
Fix http.request not being caught
1 parent 8eb4a5a commit ec08406

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

collectors/openio/openio.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,12 @@ def get_service_diskspace(self, metric_prefix, volume):
181181
self.publish_gauge('%s.inodes_avail' % metric_prefix, inodes_avail)
182182

183183
def get_rawx_stats(self, http, addr, namespace, srv_type='rawx'):
184-
stat = http.request('GET', addr+'/stat')
184+
stat = None
185+
try:
186+
stat = http.request('GET', addr+'/stat')
187+
except Exception as e:
188+
self.log.exception(e)
189+
return
185190
for m in (stat.data).split('\n'):
186191
if not m:
187192
continue
@@ -196,7 +201,12 @@ def get_rawx_stats(self, http, addr, namespace, srv_type='rawx'):
196201
metric_type=metric_type.upper())
197202

198203
def get_gridd_stats(self, http, proxy, addr, namespace, srv_type):
199-
stat = http.request('POST', proxy+'/v3.0/forward/stats?id='+addr)
204+
stat = None
205+
try:
206+
stat = http.request('POST', proxy+'/v3.0/forward/stats?id='+addr)
207+
except Exception as e:
208+
self.log.exception(e)
209+
return
200210
for m in (stat.data).split('\n'):
201211
if not m:
202212
continue

0 commit comments

Comments
 (0)