summaryrefslogtreecommitdiffstats
path: root/roles/lib_zabbix
diff options
context:
space:
mode:
authorMatt Woodson <mwoodson@gmail.com>2015-09-28 14:44:19 -0400
committerMatt Woodson <mwoodson@gmail.com>2015-09-28 14:44:19 -0400
commit7f1db7b49c344ae5aa62bc779590e9baa45647e6 (patch)
treec4cc999bf8781b2252bc684a2ead341b4ee5e9b0 /roles/lib_zabbix
parent39a7b2379f558037ad9840f7f08a397c9a9d9f70 (diff)
parent1cca69d33920681b1040987a4b9681216703d99d (diff)
downloadopenshift-7f1db7b49c344ae5aa62bc779590e9baa45647e6.tar.gz
openshift-7f1db7b49c344ae5aa62bc779590e9baa45647e6.tar.bz2
openshift-7f1db7b49c344ae5aa62bc779590e9baa45647e6.tar.xz
openshift-7f1db7b49c344ae5aa62bc779590e9baa45647e6.zip
Merge pull request #626 from kwoodson/quick
Error handling added
Diffstat (limited to 'roles/lib_zabbix')
-rw-r--r--roles/lib_zabbix/library/zbx_trigger.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/roles/lib_zabbix/library/zbx_trigger.py b/roles/lib_zabbix/library/zbx_trigger.py
index 8a7b29d07..21d0fcfd2 100644
--- a/roles/lib_zabbix/library/zbx_trigger.py
+++ b/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')
########