Hi,
this patch fixes https://fedorahosted.org/freeipa/ticket/3464.
Honza
--
Jan Cholasta
From c40f1f123b905fdd0ee4d05d32f3d86e6ffdccc0 Mon Sep 17 00:00:00 2001
From: Jan Cholasta jchol...@redhat.com
Date: Wed, 27 Feb 2013 14:14:33 +0100
Subject: [PATCH] Fix remove while iterating in suppress_netgroup_memberof.
https://fedorahosted.org/freeipa/ticket/3464
---
ipalib/plugins/host.py| 2 +-
ipalib/plugins/hostgroup.py | 2 +-
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 f464127..4a47f50 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -364,7 +364,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 7ae438c..9fb1029 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 a09a798..e1b41b2 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'],
),
),
),
--
1.8.1
___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel