Install: Force service add during replica promotion

Replica does not need to have A/AAAA records during install, so we
cannot enforce it and service must be added with --force option.

https://fedorahosted.org/freeipa/ticket/5420

Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
Martin Basti 2015-11-23 16:11:04 +01:00 committed by Tomas Babej
parent ed830af693
commit 5427e7a8c7
2 changed files with 4 additions and 2 deletions

View File

@ -1203,7 +1203,8 @@ class DsInstance(service.Service):
installutils.install_service_keytab(self.principal,
self.master_fqdn,
paths.DS_KEYTAB)
paths.DS_KEYTAB,
force_service_add=True)
# Configure DS to use the keytab
vardict = {"KRB5_KTNAME": paths.DS_KEYTAB}

View File

@ -1108,7 +1108,7 @@ def enable_and_start_oddjobd(sstore):
root_logger.critical("Unable to start oddjobd: {0}".format(str(e)))
def install_service_keytab(principal, server, path):
def install_service_keytab(principal, server, path, force_service_add=False):
try:
api.Backend.rpcclient.connect()
@ -1121,6 +1121,7 @@ def install_service_keytab(principal, server, path):
api.Backend.rpcclient.forward(
'service_add',
krbprincipalname=principal,
force=force_service_add,
version=u'2.112' # All the way back to 3.0 servers
)
except errors.DuplicateEntry: