diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-11-19 14:56:25 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2010-11-24 08:38:48 -0500 |
commit | 97e9309db3708e839bd54bef442bf7296284eac6 (patch) | |
tree | fca9beb118423feb7b48c3a231acc7ed154844e8 /ipalib/plugins/baseldap.py | |
parent | d824eee8fa151751a6a0e6fae9a67abd3c5837f9 (diff) | |
download | freeipa-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/plugins/baseldap.py')
-rw-r--r-- | ipalib/plugins/baseldap.py | 5 |
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] |