summaryrefslogtreecommitdiffstats
path: root/roles/lib_zabbix
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2015-11-24 15:01:04 -0500
committerKenny Woodson <kwoodson@redhat.com>2015-11-24 15:01:04 -0500
commit55c65f440f00de42dd2d8f2940cfc738493edcba (patch)
tree888f31c0da82a789cfbba650743d1232d8c730bc /roles/lib_zabbix
parentf464177c264ef87af80ac023e2698a466b723325 (diff)
downloadopenshift-55c65f440f00de42dd2d8f2940cfc738493edcba.tar.gz
openshift-55c65f440f00de42dd2d8f2940cfc738493edcba.tar.bz2
openshift-55c65f440f00de42dd2d8f2940cfc738493edcba.tar.xz
openshift-55c65f440f00de42dd2d8f2940cfc738493edcba.zip
Fixed a bug in the actions. It now supports changing opconditions
Diffstat (limited to 'roles/lib_zabbix')
-rw-r--r--roles/lib_zabbix/library/zbx_action.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/roles/lib_zabbix/library/zbx_action.py b/roles/lib_zabbix/library/zbx_action.py
index d64cebae1..24693e5db 100644
--- a/roles/lib_zabbix/library/zbx_action.py
+++ b/roles/lib_zabbix/library/zbx_action.py
@@ -89,6 +89,9 @@ def operation_differences(zabbix_ops, user_ops):
for zab, user in zip(zabbix_ops, user_ops):
for key, val in user.items():
if key == 'opconditions':
+ if len(zab[key]) != len(val):
+ rval[key] = val
+ break
for z_cond, u_cond in zip(zab[key], user[key]):
if not all([str(u_cond[op_key]) == z_cond[op_key] for op_key in \
['conditiontype', 'operator', 'value']]):
@@ -330,9 +333,9 @@ def get_action_operations(zapi, inc_operations):
condition['operator'] = 0
if condition['value'] == 'acknowledged':
- condition['operator'] = 1
+ condition['value'] = 1
else:
- condition['operator'] = 0
+ condition['value'] = 0
return inc_operations