فهرست منبع

Fixes for zbx api

Kenny Woodson 9 سال پیش
والد
کامیت
5adc02254b
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 3 3
      roles/lib_zabbix/library/zbx_item.py
  2. 1 1
      roles/lib_zabbix/library/zbx_user.py

+ 3 - 3
roles/lib_zabbix/library/zbx_item.py

@@ -92,7 +92,7 @@ def get_multiplier(inval):
     ''' Determine the multiplier
     '''
     if inval == None or inval == '':
-        return None, None
+        return None, 0
 
     rval = None
     try:
@@ -101,9 +101,9 @@ def get_multiplier(inval):
         pass
 
     if rval:
-        return rval, True
+        return rval, 1
 
-    return rval, False
+    return rval, 0
 
 # The branches are needed for CRUD and error handling
 # pylint: disable=too-many-branches

+ 1 - 1
roles/lib_zabbix/library/zbx_user.py

@@ -164,7 +164,7 @@ def main():
 
             if key == 'usrgrps':
                 # this must be done as a list of ordered dictionaries fails comparison
-                if not all([True for _ in zab_results[key][0] if _ in value[0]]):
+                if not all([_ in value for _ in zab_results[key]]):
                     differences[key] = value
 
             elif zab_results[key] != value and zab_results[key] != str(value):