mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
DNS Locations: dnsserver: print specific error when DNS is not installed
Print 'DNS is not configured' if there is no IPA DNS in domain https://fedorahosted.org/freeipa/ticket/2008 Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
@@ -11,6 +11,7 @@ from ipalib import (
|
||||
DNSNameParam,
|
||||
Str,
|
||||
StrEnum,
|
||||
errors,
|
||||
)
|
||||
from ipalib.frontend import Local
|
||||
from ipalib.plugable import Registry
|
||||
@@ -27,6 +28,7 @@ from ipaserver.plugins.baseldap import (
|
||||
LDAPCreate,
|
||||
LDAPDelete,
|
||||
)
|
||||
from .dns import dns_container_exists
|
||||
|
||||
|
||||
__doc__ = _("""
|
||||
@@ -138,6 +140,11 @@ class dnsserver(LDAPObject):
|
||||
),
|
||||
)
|
||||
|
||||
def get_dn(self, *keys, **options):
|
||||
if not dns_container_exists(self.api.Backend.ldap2):
|
||||
raise errors.NotFound(reason=_('DNS is not configured'))
|
||||
return super(dnsserver, self).get_dn(*keys, **options)
|
||||
|
||||
|
||||
@register()
|
||||
class dnsserver_mod(LDAPUpdate):
|
||||
|
||||
Reference in New Issue
Block a user