Skip to content

Commit

Permalink
outputs/statink: Fix undefined reference.
Browse files Browse the repository at this point in the history
Signed-off-by: Takeshi HASEGAWA <hasegaw@gmail.com>
  • Loading branch information
hasegaw committed Apr 14, 2016
1 parent f6c1587 commit 390da72
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions ikalog/outputs/statink.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ def _post_payload_worker(self, context, payload):
timeout=120.0, # Timeout (in sec)
)

# Post the payload

try:
req = pool.urlopen('POST', self.url_statink_v1_battle,
headers=http_headers,
Expand All @@ -570,18 +572,7 @@ def _post_payload_worker(self, context, payload):
# Handle incorrect certificate error.
IkaUtils.dprint('%s: SSLError, value: %s' % (self, e.value))

if self.show_response_enabled or error:
IkaUtils.dprint('%s: == Response begin ==' % self)
print(req.data.decode('utf-8'))
IkaUtils.dprint('%s: == Response end ===' % self)

IkaUtils.dprint(
'%s: POST Done. %d bytes in %f second(s).' % (
self,
len(mp_payload),
int((time.time() - time_post_start) * 10) / 10,
)
)
# Error detection

error = False
try:
Expand All @@ -596,6 +587,23 @@ def _post_payload_worker(self, context, payload):
'error': 'Not a JSON response',
}

# Debug messages

if self.show_response_enabled or error:
IkaUtils.dprint('%s: == Response begin ==' % self)
print(req.data.decode('utf-8'))
IkaUtils.dprint('%s: == Response end ===' % self)

IkaUtils.dprint(
'%s: POST Done. %d bytes in %f second(s).' % (
self,
len(mp_payload),
int((time.time() - time_post_start) * 10) / 10,
)
)

# Trigger a event.

try:
call_plugins_func = \
context['engine']['service']['call_plugins_later']
Expand Down

0 comments on commit 390da72

Please sign in to comment.