Browse Source

Merge pull request #974 from kwoodson/actionfix

Fixed a bug.  opsconditions now updates propertly.
Kenny Woodson 9 years ago
parent
commit
89c2089032
1 changed files with 5 additions and 2 deletions
  1. 5 2
      roles/lib_zabbix/library/zbx_action.py

+ 5 - 2
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