summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/realmdomains.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/plugins/realmdomains.py')
-rw-r--r--ipalib/plugins/realmdomains.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ipalib/plugins/realmdomains.py b/ipalib/plugins/realmdomains.py
index 99ab8798b..f3dbf8dae 100644
--- a/ipalib/plugins/realmdomains.py
+++ b/ipalib/plugins/realmdomains.py
@@ -105,9 +105,10 @@ class realmdomains_mod(LDAPUpdate):
if get_domain_name() not in associateddomain:
raise errors.ValidationError(name='domain', error=_("cannot delete domain of IPA server"))
if not force:
- for d in associateddomain:
- if not has_soa_or_ns_record(d):
- raise errors.ValidationError(name='domain', error=_("no SOA or NS records found for domain %s" % d))
+ bad_domains = [d for d in associateddomain if not has_soa_or_ns_record(d)]
+ if bad_domains:
+ bad_domains = ', '.join(bad_domains)
+ raise errors.ValidationError(name='domain', error=_("no SOA or NS records found for domains: %s" % bad_domains))
return dn
# If --add-domain or --del-domain options were provided, read