diff options
author | Jan Cholasta <jcholast@redhat.com> | 2013-02-27 14:14:33 +0100 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2013-03-06 15:05:39 +0100 |
commit | c275c6af0ba4b6664088910c95098191b130cf33 (patch) | |
tree | c57d83e2cc7d64113229520eaece06d242692af2 | |
parent | f15ff7e96a70838b1819bf7d9d9e1cb1cfa4f6d1 (diff) | |
download | freeipa.git-c275c6af0ba4b6664088910c95098191b130cf33.tar.gz freeipa.git-c275c6af0ba4b6664088910c95098191b130cf33.tar.xz freeipa.git-c275c6af0ba4b6664088910c95098191b130cf33.zip |
Fix remove while iterating in suppress_netgroup_memberof.
https://fedorahosted.org/freeipa/ticket/3464
-rw-r--r-- | ipalib/plugins/host.py | 2 | ||||
-rw-r--r-- | ipalib/plugins/hostgroup.py | 2 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_nesting.py | 1 |
3 files changed, 2 insertions, 3 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py index e1c07b53..3c5bad1b 100644 --- a/ipalib/plugins/host.py +++ b/ipalib/plugins/host.py @@ -358,7 +358,7 @@ class host(LDAPObject): """ ng_container = DN(api.env.container_netgroup, api.env.basedn) if 'memberofindirect' in entry_attrs: - for member in entry_attrs['memberofindirect']: + for member in list(entry_attrs['memberofindirect']): memberdn = DN(member) if memberdn.endswith(ng_container): try: diff --git a/ipalib/plugins/hostgroup.py b/ipalib/plugins/hostgroup.py index 7e6fe6d6..c12eb638 100644 --- a/ipalib/plugins/hostgroup.py +++ b/ipalib/plugins/hostgroup.py @@ -99,7 +99,7 @@ class hostgroup(LDAPObject): """ if 'memberof' in entry_attrs: hgdn = DN(dn) - for member in entry_attrs['memberof']: + for member in list(entry_attrs['memberof']): ngdn = DN(member) if ngdn['cn'] == hgdn['cn']: try: diff --git a/tests/test_xmlrpc/test_nesting.py b/tests/test_xmlrpc/test_nesting.py index a09a7989..e1b41b28 100644 --- a/tests/test_xmlrpc/test_nesting.py +++ b/tests/test_xmlrpc/test_nesting.py @@ -790,7 +790,6 @@ class test_nesting(Declarative): managedby_host=[fqdn1], memberof_hostgroup = [u'testhostgroup2'], memberofindirect_hostgroup = [u'testhostgroup1'], - memberofindirect_netgroup = [u'testhostgroup2'], ), ), ), |