URL: https://github.com/freeipa/freeipa/pull/529
Author: tomaskrizek
 Title: #529: installer: update time estimates
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/529/head:pr529
git checkout pr529
From d2ba0a116153d384822c6ba8229e1dcb3f7bb9f2 Mon Sep 17 00:00:00 2001
From: Tomas Krizek <tkri...@redhat.com>
Date: Wed, 1 Mar 2017 17:35:56 +0100
Subject: [PATCH] installer: update time estimates

Time estimates have been updated to be more accurate. Only
tasks that are estimated to take longer than 10 seconds have
the estimate displayed.

https://pagure.io/freeipa/issue/6596
---
 ipaserver/install/cainstance.py      | 7 ++++++-
 ipaserver/install/dsinstance.py      | 6 +++---
 ipaserver/install/httpinstance.py    | 2 +-
 ipaserver/install/krainstance.py     | 2 +-
 ipaserver/install/krbinstance.py     | 4 ++--
 ipaserver/install/service.py         | 4 ++--
 ipaserver/install/upgradeinstance.py | 3 ++-
 7 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index 0991883..42e4541 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -450,8 +450,13 @@ def configure_instance(self, host_name, dm_password, admin_password,
                 self.step("configuring certmonger renewal for lightweight CAs",
                           self.__add_lightweight_ca_tracking_requests)
 
+        if ra_only:
+            runtime = None
+        else:
+            runtime = 180
+
         try:
-            self.start_creation(runtime=210)
+            self.start_creation(runtime=runtime)
         finally:
             self.clean_pkispawn_files()
 
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py
index 733dd40..91cc180 100644
--- a/ipaserver/install/dsinstance.py
+++ b/ipaserver/install/dsinstance.py
@@ -350,7 +350,7 @@ def create_instance(self, realm_name, fqdn, domain_name,
 
         self.__common_post_setup()
 
-        self.start_creation(runtime=60)
+        self.start_creation(runtime=30)
 
     def enable_ssl(self):
         self.steps = []
@@ -359,7 +359,7 @@ def enable_ssl(self):
         self.step("restarting directory server", self.__restart_instance)
         self.step("adding CA certificate entry", self.__upload_ca_cert)
 
-        self.start_creation(runtime=10)
+        self.start_creation()
 
     def create_replica(self, realm_name, master_fqdn, fqdn,
                        domain_name, dm_password,
@@ -412,7 +412,7 @@ def create_replica(self, realm_name, master_fqdn, fqdn,
 
         self.__common_post_setup()
 
-        self.start_creation(runtime=60)
+        self.start_creation(runtime=30)
 
 
     def __setup_replica(self):
diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py
index 0c2216e..3e8fb0c 100644
--- a/ipaserver/install/httpinstance.py
+++ b/ipaserver/install/httpinstance.py
@@ -185,7 +185,7 @@ def create_instance(self, realm, fqdn, domain_name, pkcs12_info=None,
         self.step("configuring httpd to start on boot", self.__enable)
         self.step("enabling oddjobd", self.enable_and_start_oddjobd)
 
-        self.start_creation(runtime=60)
+        self.start_creation()
 
     def __start(self):
         self.backup_state("running", self.is_running())
diff --git a/ipaserver/install/krainstance.py b/ipaserver/install/krainstance.py
index 5ee08dc..b41ccb6 100644
--- a/ipaserver/install/krainstance.py
+++ b/ipaserver/install/krainstance.py
@@ -132,7 +132,7 @@ def configure_instance(self, realm_name, host_name, dm_password,
         self.step("enabling KRA instance", self.__enable_instance)
 
         try:
-            self.start_creation(runtime=126)
+            self.start_creation(runtime=120)
         finally:
             self.clean_pkispawn_files()
 
diff --git a/ipaserver/install/krbinstance.py b/ipaserver/install/krbinstance.py
index 79803ca..08d39e2 100644
--- a/ipaserver/install/krbinstance.py
+++ b/ipaserver/install/krbinstance.py
@@ -164,7 +164,7 @@ def create_instance(self, realm_name, host_name, domain_name, admin_password, ma
             self.step("installing X509 Certificate for PKINIT",
                       self.setup_pkinit)
 
-        self.start_creation(runtime=30)
+        self.start_creation()
 
         self.kpasswd = KpasswdInstance()
         self.kpasswd.create_instance('KPASSWD', self.fqdn, self.suffix,
@@ -189,7 +189,7 @@ def create_replica(self, realm_name,
 
         self.__common_post_setup()
 
-        self.start_creation(runtime=30)
+        self.start_creation()
 
         self.kpasswd = KpasswdInstance()
         self.kpasswd.create_instance('KPASSWD', self.fqdn, self.suffix)
diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py
index 837880f..b09d01f 100644
--- a/ipaserver/install/service.py
+++ b/ipaserver/install/service.py
@@ -365,7 +365,7 @@ def step(self, message, method, run_after_failure=False):
         self.steps.append((message, method, run_after_failure))
 
     def start_creation(self, start_message=None, end_message=None,
-        show_service_name=True, runtime=-1):
+                       show_service_name=True, runtime=None):
         """
         Starts creation of the service.
 
@@ -401,7 +401,7 @@ def start_creation(self, start_message=None, end_message=None,
                 else:
                     end_message = "Done configuring %s." % self.service_desc
 
-        if runtime > 0:
+        if runtime and runtime > 0:
             self.print_msg('%s. Estimated time: %s' % (start_message,
                                                       format_seconds(runtime)))
         else:
diff --git a/ipaserver/install/upgradeinstance.py b/ipaserver/install/upgradeinstance.py
index fca4226..e5bc8a2 100644
--- a/ipaserver/install/upgradeinstance.py
+++ b/ipaserver/install/upgradeinstance.py
@@ -120,7 +120,8 @@ def create_instance(self):
         if ds_running:
             self.step("starting directory server", self.__start)
         self.start_creation(start_message="Upgrading IPA:",
-                            show_service_name=False)
+                            show_service_name=False,
+                            runtime=90)
 
     def __save_config(self):
         shutil.copy2(self.filename, self.savefilename)
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to