summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-11-19 14:56:25 -0500
committerSimo Sorce <ssorce@redhat.com>2010-11-24 08:38:48 -0500
commit97e9309db3708e839bd54bef442bf7296284eac6 (patch)
treefca9beb118423feb7b48c3a231acc7ed154844e8 /ipalib
parentd824eee8fa151751a6a0e6fae9a67abd3c5837f9 (diff)
downloadfreeipa-97e9309db3708e839bd54bef442bf7296284eac6.tar.gz
freeipa-97e9309db3708e839bd54bef442bf7296284eac6.tar.xz
freeipa-97e9309db3708e839bd54bef442bf7296284eac6.zip
Gracefully handle an empty members list
This can occur if you do something like: $ ipa hbac-add-host --hosts="" testrule options will have an entry for 'host' but it will be None whcih is not iterable. ticket 486
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/baseldap.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 8f723b999..dfde0a211 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -864,7 +864,10 @@ class LDAPModMember(LDAPQuery):
for ldap_obj_name in self.obj.attribute_members[attr]:
dns[attr][ldap_obj_name] = []
failed[attr][ldap_obj_name] = []
- for name in options.get(to_cli(ldap_obj_name), []):
+ names = options.get(to_cli(ldap_obj_name), [])
+ if not names:
+ continue
+ for name in names:
if not name:
continue
ldap_obj = self.api.Object[ldap_obj_name]