From 87377493bd67939d6e90f08d1e26d1fc3bcfd708 Mon Sep 17 00:00:00 2001 From: Mohammad Rizwan Yusuf Date: May 18 2020 12:46:28 +0000 Subject: Display principal name while del required principal Fix is to display the proper principal in error message while attempting to delete required principal. related: https://pagure.io/freeipa/issue/7695 Signed-off-by: Mohammad Rizwan Yusuf Reviewed-By: Christian Heimes Reviewed-By: Rob Crittenden Reviewed-By: Christian Heimes --- diff --git a/ipaserver/plugins/service.py b/ipaserver/plugins/service.py index de80fab..d5836b3 100644 --- a/ipaserver/plugins/service.py +++ b/ipaserver/plugins/service.py @@ -289,7 +289,10 @@ def check_required_principal(ldap, principal): except errors.ValidationError: service_types = {'http', 'ldap', 'dns', 'dogtagldap'} if principal.service_name.lower() in service_types: - raise errors.ValidationError(name='principal', error=_('This principal is required by the IPA master')) + raise errors.ValidationError( + name='principal', + error=_('{} is required by the IPA master').format(principal) + ) def update_krbticketflags(ldap, entry_attrs, attrs_list, options, existing): add = remove = 0