diff options
| author | Tomas Babej <tbabej@redhat.com> | 2015-10-27 16:05:03 +0100 |
|---|---|---|
| committer | Tomas Babej <tbabej@redhat.com> | 2015-11-10 16:52:56 +0100 |
| commit | afd253b3494b791601d66c8e9836fcfa3d11dbd7 (patch) | |
| tree | c7e5ed2f5481eb15974a8f4c600f6d72c58d9fce | |
| parent | c339abbad1e82a264afc5cf9efa3aff80814aeaf (diff) | |
adtrustinstance: Wait for sidgen task completion
As part of hardening of adtrust installer, we should wait until
the sidgen task is completed before continuing, as it can take
considerable amount of time for a larger deployment.
https://fedorahosted.org/freeipa/ticket/5134
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
| -rw-r--r-- | ipaserver/install/adtrustinstance.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py index f7a789990..721cc23e7 100644 --- a/ipaserver/install/adtrustinstance.py +++ b/ipaserver/install/adtrustinstance.py @@ -34,6 +34,7 @@ from ipaserver.install import service from ipaserver.install import installutils from ipaserver.install.bindinstance import get_rr, add_rr, del_rr, \ dns_zone_exists +from ipaserver.install.replication import wait_for_task from ipalib import errors, api from ipalib.util import normalize_zone from ipapython.dn import DN @@ -469,13 +470,24 @@ class ADTRUSTInstance(service.Service): def __add_sids(self): """ - Add SIDs for existing users and groups + Add SIDs for existing users and groups. Make sure the task is finished + before continuing. """ try: + # Start the sidgen task self._ldap_mod("ipa-sidgen-task-run.ldif", self.sub_dict) - except: - pass + + # Notify the user about the possible delay + self.print_msg("This step may take considerable amount of time, please wait..") + + # Wait for the task to complete + task_dn = DN('cn=sidgen,cn=ipa-sidgen-task,cn=tasks,cn=config') + wait_for_task(self.admin_conn, task_dn) + + except Exception as e: + root_logger.warning("Exception occured during SID generation: {0}" + .format(str(e))) def __add_s4u2proxy_target(self): """ |
