ipa-client-automount: fix '--idmap-domain DNS' logic

Previously '--idmap-domain DNS' would assume the Domain
parameter of idmapd.conf was already absent. With this
fix, the Domain parameter is always removed and the
configuration file is always backuped.

Related-to: https://pagure.io/freeipa/issue/7918
Fixes: https://pagure.io/freeipa/issue/7988
Signed-off-by: François Cami fcami@redhat.com
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
François Cami 2019-06-25 16:24:00 +02:00 committed by Christian Heimes
parent 34bfffd1be
commit cc348b990e

View File

@ -371,7 +371,7 @@ def configure_nfs(fstore, statestore, options):
changes = [conf.setOption('Domain', api.env.domain)]
elif options.idmapdomain == 'DNS':
# Rely on idmapd auto-detection (DNS)
changes = None
changes = [conf.rmOption('Domain')]
else:
# Set NFSv4 domain to what was provided
changes = [conf.setOption('Domain', options.idmapdomain)]