summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorJoel Diaz <jdiaz@redhat.com>2016-02-10 16:14:28 -0500
committerJoel Diaz <jdiaz@redhat.com>2016-02-10 16:14:28 -0500
commit6cfd6326790b9bc9978a8bbc2f6375817c467176 (patch)
tree5643606751a3e0d9cc5b760a070278437204b17a /roles
parentb6db3a50edb3b2b53440016f305b063c009fe26d (diff)
parent77517fcaeaf3304c900bd108557f847942e873a2 (diff)
downloadopenshift-6cfd6326790b9bc9978a8bbc2f6375817c467176.tar.gz
openshift-6cfd6326790b9bc9978a8bbc2f6375817c467176.tar.bz2
openshift-6cfd6326790b9bc9978a8bbc2f6375817c467176.tar.xz
openshift-6cfd6326790b9bc9978a8bbc2f6375817c467176.zip
Merge pull request #1379 from joelddiaz/zbx-action-diff
handle being passed an empty group list
Diffstat (limited to 'roles')
-rw-r--r--roles/lib_zabbix/library/zbx_action.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/roles/lib_zabbix/library/zbx_action.py b/roles/lib_zabbix/library/zbx_action.py
index 2f9524556..c388a65cc 100644
--- a/roles/lib_zabbix/library/zbx_action.py
+++ b/roles/lib_zabbix/library/zbx_action.py
@@ -228,12 +228,12 @@ def get_user_groups(zapi, groups):
'''get the mediatype id from the mediatype name'''
user_groups = []
- content = zapi.get_content('usergroup',
- 'get',
- {'search': {'name': groups}})
-
- for usr_grp in content['result']:
- user_groups.append({'usrgrpid': usr_grp['usrgrpid']})
+ for group in groups:
+ content = zapi.get_content('usergroup',
+ 'get',
+ {'search': {'name': group}})
+ for result in content['result']:
+ user_groups.append({'usrgrpid': result['usrgrpid']})
return user_groups