[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[rhel6-branch] Pulsing progress bar instead of the static popup during device discovery.



On machines with hundreds of devices Anaconda looks dead during device
discovery. Having a proper progress bar would be cooler but we don't know
how many devices will be there altogether.

Resolves: rhbz#616641
---
 storage/__init__.py   |    9 +++++----
 storage/devicetree.py |    8 +++++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 007f029..d9c89fe 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -403,8 +403,9 @@ class Storage(object):
             if device.format.type == "luks" and device.format.exists:
                 self.__luksDevs[device.format.uuid] = device.format._LUKS__passphrase
 
-        w = self.anaconda.intf.waitWindow(_("Examining Devices"),
-                                          _("Examining storage devices"))
+        prog = self.anaconda.intf.progressWindow(_("Examining Devices"),
+                                                 _("Examining storage devices"),
+                                                 100, 0.03, pulse=True)
         self.iscsi.startup(self.anaconda.intf)
         self.fcoe.startup(self.anaconda.intf)
         self.zfcp.startup(self.anaconda.intf)
@@ -427,13 +428,13 @@ class Storage(object):
                                      iscsi=self.iscsi,
                                      dasd=self.dasd,
                                      mpathFriendlyNames=self.mpathFriendlyNames)
-        self.devicetree.populate()
+        self.devicetree.populate(prog)
         self.fsset = FSSet(self.devicetree, self.anaconda.rootPath)
         self.eddDict = get_edd_dict(self.partitioned)
         self.anaconda.id.rootParts = None
         self.anaconda.id.upgradeRoot = None
         self.dumpState("initial")
-        w.pop()
+        prog.pop()
 
     @property
     def devices(self):
diff --git a/storage/devicetree.py b/storage/devicetree.py
index b419026..e9ff36a 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -2034,7 +2034,7 @@ class DeviceTree(object):
 
         return ret
 
-    def populate(self):
+    def populate(self, progressWindow=None):
         """ Locate all storage devices. """
         log.debug("DeviceTree.populate: ignoredDisks is %s ; exclusiveDisks is %s"
                     % (self._ignoredDisks, self.exclusiveDisks))
@@ -2074,6 +2074,8 @@ class DeviceTree(object):
         log.info("devices to scan: %s" % [d['name'] for d in devices])
         for dev in devices:
             self.addUdevDevice(dev)
+            if progressWindow:
+                progressWindow.pulse()
 
         # Having found all the disks, we can now find all the multipaths built
         # upon them.
@@ -2095,6 +2097,8 @@ class DeviceTree(object):
             self.__multipathConfigWriter.addMultipathDevice(mp)
             self._addDevice(mp)
             self.addUdevDevice(mp_info)
+            if progressWindow:
+                progressWindow.pulse()
         for d in self.devices:
             if not d.name in whitelist:
                 self.__multipathConfigWriter.addBlacklistDevice(d)
@@ -2126,6 +2130,8 @@ class DeviceTree(object):
             log.info("devices to scan: %s" % [d['name'] for d in devices])
             for dev in devices:
                 self.addUdevDevice(dev)
+                if progressWindow:
+                    progressWindow.pulse()
 
         self.populated = True
 
-- 
1.7.5.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]