mirror of
https://github.com/veops/cmdb.git
synced 2025-09-14 07:26:54 +08:00
fix wehook trigger ok when http status failed (#718)
Co-authored-by: tangshoubin <tangshoubin@itiger.com>
This commit is contained in:
@@ -255,7 +255,9 @@ def cmdb_trigger():
|
||||
try:
|
||||
ready_cis = CITriggerManager.waiting_cis(trigger)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
import traceback
|
||||
current_app.logger.error("cmdb trigger waiting_cis exception for trigger_id {}: {}".format(trigger.id, e))
|
||||
current_app.logger.error("traceback: {}".format(traceback.format_exc()))
|
||||
continue
|
||||
|
||||
if trigger.id not in trigger2cis:
|
||||
|
@@ -1618,7 +1618,8 @@ class CITriggerManager(object):
|
||||
ci_id, need_children=False, use_master=False, enum_use_label=True)
|
||||
|
||||
try:
|
||||
response = webhook_request(webhook, ci_dict).text
|
||||
response = webhook_request(webhook, ci_dict)
|
||||
response.raise_for_status()
|
||||
is_ok = True
|
||||
except Exception as e:
|
||||
current_app.logger.warning("exec webhook failed: {}".format(e))
|
||||
|
Reference in New Issue
Block a user