Check if IPA is configured before attempting a winsync migration

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

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
Gabe 2015-11-20 11:06:55 -07:00 committed by Tomas Babej
parent 8909506a88
commit 84e479edaa

View File

@ -29,7 +29,7 @@ from ipapython.dn import DN
from ipapython.ipautil import realm_to_suffix, posixify
from ipapython.ipa_log_manager import log_mgr
from ipaserver.plugins.ldap2 import ldap2
from ipaserver.install import replication
from ipaserver.install import replication, installutils
if six.PY3:
unicode = str
@ -340,6 +340,12 @@ class WinsyncMigrate(admintool.AdminTool):
the plumbing.
"""
# Check if the IPA server is configured before attempting to migrate
try:
installutils.check_server_configuration()
except RuntimeError as e:
sys.exit(e)
# Finalize API
api.bootstrap(in_server=True, context='server')
api.finalize()