Explorar o código

Added some debug when zbxapi has an issue

Kenny Woodson %!s(int64=9) %!d(string=hai) anos
pai
achega
1cca69d339
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      roles/lib_zabbix/library/zbx_trigger.py

+ 4 - 0
roles/lib_zabbix/library/zbx_trigger.py

@@ -170,6 +170,10 @@ def main():
         if not exists(content):
             # if we didn't find it, create it
             content = zapi.get_content(zbx_class_name, 'create', params)
+
+            if content.has_key('error'):
+                module.exit_json(failed=True, changed=True, results=content['error'], state="present")
+
             module.exit_json(changed=True, results=content['result'], state='present')
 
         ########