[PATCH 4/4 rhel7-branch] gui: add Refresh button to network storage UI (#1065716)

Radek Vykydal rvykydal at redhat.com
Tue Sep 16 07:39:49 UTC 2014


Resolves: rhbz#1065716

Add Refresh button to advanced storage (filter) screen. The use case is
slow connection to FCoE SAN where our 10s sleep is not enough. This used
to be worked around by adding the FCoE LUN for second time in UI so that the
devicetree is repopulated once more after another 10s (or more) sleep [1].

Ideally we would refresh the screen (blivet devicetree) based on an event of
new FCoE SAN devices appearing. But it is not happening in near future afaik.
Even some kind of polling for new device would be quite hard to implement
correctly.

So ... the Refresh button.
Should we add a tooltip?
Should we make it less prominent?

[1] Details:

Note 10s sleep after fipvlan returns successfully which is not enough for
device for LUN connected to p2p1 to appear (you can ignore p2p2). Devicetree is
repopulated with new fcoe device only after the discovery on p2p1 for the
second time.

12:11:59,162  INFO anaconda: Running Thread: AnaFCOEThread (140047382103808)
12:11:59,162          INFO blivet: Activating FCoE SAN attached to p2p1, dcb: False autovlan: True
12:11:59,200      INFO program: Running... fipvlan -c -s -f -fcoe p2p1
12:12:03,207      INFO program: Created VLAN device p2p1.802-fcoe
12:12:03,207      INFO program: Starting FCoE on interface p2p1.802-fcoe
12:12:13,231  INFO anaconda: Thread Done: AnaFCOEThread (140047382103808)
12:12:13,235          INFO blivet: DeviceTree.populate: ignoredDisks is [] ; exclusiveDisks is []
12:14:25,264  INFO anaconda: Running Thread: AnaFCOEThread (140047382103808)
12:14:25,264          INFO blivet: Activating FCoE SAN attached to p2p2, dcb: False autovlan: True
12:14:25,277      INFO program: Running... fipvlan -c -s -f -fcoe p2p2
12:14:29,279      INFO program: Created VLAN device p2p2.802-fcoe
12:14:29,279      INFO program: Starting FCoE on interface p2p2.802-fcoe
12:14:39,301  INFO anaconda: Thread Done: AnaFCOEThread (140047382103808)
12:14:39,305          INFO blivet: DeviceTree.populate: ignoredDisks is [] ; exclusiveDisks is []
12:15:51,411  INFO anaconda: Running Thread: AnaFCOEThread (140047382103808)
12:15:51,411          INFO blivet: Activating FCoE SAN attached to p2p1, dcb: False autovlan: True
12:15:51,424      INFO program: Running... fipvlan -c -s -f -fcoe p2p1
12:15:52,161      INFO program: Starting FCoE on interface p2p1.802-fcoe
12:16:02,183  INFO anaconda: Thread Done: AnaFCOEThread (140047382103808)
12:16:02,187          INFO blivet: DeviceTree.populate: ignoredDisks is [] ; exclusiveDisks is []
12:16:02,294          INFO blivet: scanning sdb (/devices/virtual/net/p2p1.802-fcoe/ctlr_0/host7/rport-7:0-5/target7:0:2/7:0:2:0/block/sdb)...
12:16:02,297          WARN blivet: unexpected sysfs_path of bnx2fc device: /devices/virtual/net/p2p1.802-fcoe/ctlr_0/host7/rport-7:0-5/target7:0:2/7:0:2:0/block/sdb
12:16:02,297          INFO blivet: sdb is an fcoe disk
---
 pyanaconda/ui/gui/spokes/filter.glade | 15 +++++++++++++++
 pyanaconda/ui/gui/spokes/filter.py    |  7 ++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/gui/spokes/filter.glade b/pyanaconda/ui/gui/spokes/filter.glade
index ff0426d..d8569fb 100644
--- a/pyanaconda/ui/gui/spokes/filter.glade
+++ b/pyanaconda/ui/gui/spokes/filter.glade
@@ -1668,6 +1668,21 @@
                         <property name="position">2</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkButton" id="refresh">
+                        <property name="label" translatable="yes">Refres_h</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="use_underline">True</property>
+                        <signal name="clicked" handler="on_refresh_clicked" swapped="no"/>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">3</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/spokes/filter.py b/pyanaconda/ui/gui/spokes/filter.py
index 97b07ca..8c63816 100644
--- a/pyanaconda/ui/gui/spokes/filter.py
+++ b/pyanaconda/ui/gui/spokes/filter.py
@@ -33,7 +33,7 @@ from pyanaconda.flags import flags
 from pyanaconda.i18n import N_, P_
 
 from pyanaconda.ui.lib.disks import getDisks, size_str
-from pyanaconda.ui.gui.utils import enlightbox, escape_markup
+from pyanaconda.ui.gui.utils import enlightbox, escape_markup, timed_action
 from pyanaconda.ui.gui.spokes import NormalSpoke
 from pyanaconda.ui.gui.spokes.advstorage.fcoe import FCoEDialog
 from pyanaconda.ui.gui.spokes.advstorage.iscsi import ISCSIDialog
@@ -644,6 +644,11 @@ class FilterSpoke(NormalSpoke):
 
         self._update_summary()
 
+    @timed_action(delay=50, threshold=100)
+    def on_refresh_clicked(self, widget, *args):
+        self.storage.devicetree.populate()
+        self.refresh()
+
     def on_add_iscsi_clicked(self, widget, *args):
         dialog = ISCSIDialog(self.data, self.storage)
 
-- 
1.9.3



More information about the anaconda-patches mailing list