mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-07-29 15:55:47 -05:00
Fix upgrade when named.conf does not exist
Commit aee0d2180c adds an upgrade step
that adds system crypto policy include to named.conf. This step
omitted the named.conf existence check; upgrade fails when it does
not exist. Add the existence check.
Also update the test to add the IPA-related part of the named.conf
config, because the "existence check" actually does more than just
check that the file exists - it also check that it contains the IPA
bind-dyndb-ldap configuration section.
Part of: https://pagure.io/freeipa/issue/4853
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
committed by
Christian Heimes
parent
b0d8c6c211
commit
421fc376cc
@@ -93,6 +93,10 @@ def create_reverse():
|
||||
|
||||
|
||||
def named_conf_exists():
|
||||
"""
|
||||
Checks that named.conf exists AND that it contains IPA-related config.
|
||||
|
||||
"""
|
||||
try:
|
||||
with open(paths.NAMED_CONF, 'r') as named_fd:
|
||||
lines = named_fd.readlines()
|
||||
|
||||
@@ -905,6 +905,10 @@ def named_add_server_id():
|
||||
def named_add_crypto_policy():
|
||||
"""Add crypto policy include
|
||||
"""
|
||||
if not bindinstance.named_conf_exists():
|
||||
logger.info('DNS is not configured')
|
||||
return False
|
||||
|
||||
if sysupgrade.get_upgrade_state('named.conf', 'add_crypto_policy'):
|
||||
# upgrade was done already
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user