[PATCH 2/3] Fix up the z Panel in advanced storage. (#1024949)

Samantha N. Bueno sbueno+anaconda at redhat.com
Tue Nov 26 19:41:40 UTC 2013


This just adds functionality to the skeleton z Panel that was created
ages ago. Once z-specific devices are added (for now, just zFCP), they
should show up in the filter window. Users should be able to filter
the list by searching for the device id (CCW), LUN, or WWPN.

Once a device is selected from here, it should show up in the main
storage spoke.

Resolves: rhbz#1024949
---
 pyanaconda/ui/gui/spokes/filter.glade | 488 ++++++++++++++++++++++------------
 pyanaconda/ui/gui/spokes/filter.py    | 107 +++++++-
 pyanaconda/ui/gui/spokes/storage.py   |   6 +-
 3 files changed, 422 insertions(+), 179 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/filter.glade b/pyanaconda/ui/gui/spokes/filter.glade
index 8818aa8..d8d78e5 100644
--- a/pyanaconda/ui/gui/spokes/filter.glade
+++ b/pyanaconda/ui/gui/spokes/filter.glade
@@ -36,6 +36,8 @@
       <column type="gchararray"/>
       <!-- column-name diskCCW -->
       <column type="gchararray"/>
+      <!-- column-name diskWWPN -->
+      <column type="gchararray"/>
     </columns>
   </object>
   <object class="AnacondaSpokeWindow" id="filterWindow">
@@ -337,6 +339,9 @@
                                     <property name="rules_hint">True</property>
                                     <property name="enable_search">False</property>
                                     <property name="enable_tree_lines">True</property>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection1"/>
+                                    </child>
                                     <child>
                                       <object class="GtkTreeViewColumn" id="searchSelectedCol">
                                         <child>
@@ -730,6 +735,9 @@
                                     <property name="rules_hint">True</property>
                                     <property name="enable_search">False</property>
                                     <property name="enable_tree_lines">True</property>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection2"/>
+                                    </child>
                                     <child>
                                       <object class="GtkTreeViewColumn" id="multipathSelectedCol">
                                         <child>
@@ -932,6 +940,132 @@
                                   </packing>
                                 </child>
                                 <child>
+                                  <object class="GtkTreeView" id="otherTreeView">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="hexpand">True</property>
+                                    <property name="vexpand">True</property>
+                                    <property name="model">otherModel</property>
+                                    <property name="headers_clickable">False</property>
+                                    <property name="rules_hint">True</property>
+                                    <property name="enable_search">False</property>
+                                    <property name="search_column">0</property>
+                                    <property name="enable_tree_lines">True</property>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection3"/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherSelectedCol">
+                                        <child>
+                                          <object class="GtkCellRendererToggle" id="otherSelectedRenderer">
+                                            <signal name="toggled" handler="on_row_toggled" swapped="no"/>
+                                          </object>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="active">1</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherIDCol">
+                                        <property name="title" translatable="yes">Identifier</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="otherIDRenderer"/>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">10</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherCapacityCol">
+                                        <property name="title" translatable="yes">Capacity</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="otherCapacityRenderer"/>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">6</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherVendorCol">
+                                        <property name="title" translatable="yes">Vendor</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="otherVendorRenderer"/>
+                                          <attributes>
+                                            <attribute name="yalign">2</attribute>
+                                            <attribute name="sensitive">1</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">7</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="otherInterconnectCol">
+                                        <property name="title" translatable="yes">Interconnect</property>
+                                        <property name="clickable">True</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="otherInterconnectRenderer"/>
+                                          <attributes>
+                                            <attribute name="sensitive">2</attribute>
+                                            <attribute name="visible">0</attribute>
+                                            <attribute name="text">8</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">0</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="width">5</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="otherClearButton">
+                                    <property name="label">gtk-clear</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="use_stock">True</property>
+                                    <signal name="clicked" handler="on_clear_clicked" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">4</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="otherFindButton">
+                                    <property name="label">gtk-find</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <property name="use_stock">True</property>
+                                    <signal name="clicked" handler="on_find_clicked" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">3</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
                                   <object class="GtkNotebook" id="otherTypeNotebook">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
@@ -1077,129 +1211,6 @@
                                     <property name="height">1</property>
                                   </packing>
                                 </child>
-                                <child>
-                                  <object class="GtkTreeView" id="otherTreeView">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="hexpand">True</property>
-                                    <property name="vexpand">True</property>
-                                    <property name="model">otherModel</property>
-                                    <property name="headers_clickable">False</property>
-                                    <property name="rules_hint">True</property>
-                                    <property name="enable_search">False</property>
-                                    <property name="search_column">0</property>
-                                    <property name="enable_tree_lines">True</property>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherSelectedCol">
-                                        <child>
-                                          <object class="GtkCellRendererToggle" id="otherSelectedRenderer">
-                                            <signal name="toggled" handler="on_row_toggled" swapped="no"/>
-                                          </object>
-                                          <attributes>
-                                            <attribute name="sensitive">2</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="active">1</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherIDCol">
-                                        <property name="title" translatable="yes">Identifier</property>
-                                        <property name="clickable">True</property>
-                                        <child>
-                                          <object class="GtkCellRendererText" id="otherIDRenderer"/>
-                                          <attributes>
-                                            <attribute name="sensitive">2</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="text">10</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherCapacityCol">
-                                        <property name="title" translatable="yes">Capacity</property>
-                                        <property name="clickable">True</property>
-                                        <child>
-                                          <object class="GtkCellRendererText" id="otherCapacityRenderer"/>
-                                          <attributes>
-                                            <attribute name="sensitive">2</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="text">6</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherVendorCol">
-                                        <property name="title" translatable="yes">Vendor</property>
-                                        <property name="clickable">True</property>
-                                        <child>
-                                          <object class="GtkCellRendererText" id="otherVendorRenderer"/>
-                                          <attributes>
-                                            <attribute name="yalign">2</attribute>
-                                            <attribute name="sensitive">1</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="text">7</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                    <child>
-                                      <object class="GtkTreeViewColumn" id="otherInterconnectCol">
-                                        <property name="title" translatable="yes">Interconnect</property>
-                                        <property name="clickable">True</property>
-                                        <child>
-                                          <object class="GtkCellRendererText" id="otherInterconnectRenderer"/>
-                                          <attributes>
-                                            <attribute name="sensitive">2</attribute>
-                                            <attribute name="visible">0</attribute>
-                                            <attribute name="text">8</attribute>
-                                          </attributes>
-                                        </child>
-                                      </object>
-                                    </child>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">0</property>
-                                    <property name="top_attach">1</property>
-                                    <property name="width">5</property>
-                                    <property name="height">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="otherClearButton">
-                                    <property name="label">gtk-clear</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="use_stock">True</property>
-                                    <signal name="clicked" handler="on_clear_clicked" swapped="no"/>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">4</property>
-                                    <property name="top_attach">0</property>
-                                    <property name="width">1</property>
-                                    <property name="height">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="otherFindButton">
-                                    <property name="label">gtk-find</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="use_stock">True</property>
-                                    <signal name="clicked" handler="on_find_clicked" swapped="no"/>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="top_attach">0</property>
-                                    <property name="width">1</property>
-                                    <property name="height">1</property>
-                                  </packing>
-                                </child>
                               </object>
                             </child>
                           </object>
@@ -1268,7 +1279,6 @@
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">_Filter By:</property>
                                     <property name="use_underline">True</property>
-                                    <property name="mnemonic_widget">zFilterCombo</property>
                                   </object>
                                   <packing>
                                     <property name="left_attach">0</property>
@@ -1278,31 +1288,16 @@
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="zFilterTypeLabel">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="mnemonic_widget">zFilterEntry</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="top_attach">0</property>
-                                    <property name="width">1</property>
-                                    <property name="height">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="zGoButton">
-                                    <property name="label" translatable="yes">_Go</property>
+                                  <object class="GtkButton" id="zFindButton">
+                                    <property name="label" translatable="yes">_Find</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_find_clicked" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">4</property>
+                                    <property name="left_attach">3</property>
                                     <property name="top_attach">0</property>
                                     <property name="width">1</property>
                                     <property name="height">1</property>
@@ -1315,36 +1310,10 @@
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
                                     <property name="use_stock">True</property>
+                                    <signal name="clicked" handler="on_clear_clicked" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">5</property>
-                                    <property name="top_attach">0</property>
-                                    <property name="width">1</property>
-                                    <property name="height">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkEntry" id="zFilterEntry">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="hexpand">True</property>
-                                    <property name="invisible_char">●</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="top_attach">0</property>
-                                    <property name="width">1</property>
-                                    <property name="height">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkComboBox" id="zFilterCombo">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="hexpand">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
+                                    <property name="left_attach">4</property>
                                     <property name="top_attach">0</property>
                                     <property name="width">1</property>
                                     <property name="height">1</property>
@@ -1360,6 +1329,9 @@
                                     <property name="rules_hint">True</property>
                                     <property name="enable_search">False</property>
                                     <property name="enable_tree_lines">True</property>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection4"/>
+                                    </child>
                                     <child>
                                       <object class="GtkTreeViewColumn" id="zSelectedCol">
                                         <child>
@@ -1448,7 +1420,179 @@
                                   <packing>
                                     <property name="left_attach">0</property>
                                     <property name="top_attach">1</property>
-                                    <property name="width">6</property>
+                                    <property name="width">5</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkNotebook" id="zTypeNotebook">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="no_show_all">True</property>
+                                    <property name="hexpand">True</property>
+                                    <property name="show_tabs">False</property>
+                                    <child>
+                                      <object class="GtkLabel" id="label19">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="hexpand">True</property>
+                                      </object>
+                                    </child>
+                                    <child type="tab">
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkBox" id="zWWPNBox">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label23">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">_Show Only Devices Containing:</property>
+                                            <property name="use_underline">True</property>
+                                            <property name="mnemonic_widget">zWWPNEntry</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEntry" id="zWWPNEntry">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="invisible_char">●</property>
+                                            <property name="width_chars">30</property>
+                                            <property name="invisible_char_set">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                    <child type="tab">
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
+                                    <child type="tab">
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkBox" id="zLUNBox">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label24">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">_Show Only Devices Containing:</property>
+                                            <property name="use_underline">True</property>
+                                            <property name="mnemonic_widget">zLUNEntry</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEntry" id="zLUNEntry">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="invisible_char">●</property>
+                                            <property name="width_chars">30</property>
+                                            <property name="invisible_char_set">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="position">3</property>
+                                      </packing>
+                                    </child>
+                                    <child type="tab">
+                                      <placeholder/>
+                                    </child>
+                                    <child>
+                                      <object class="GtkBox" id="zCCWBox">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">6</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label22">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">_Show Only Devices Containing:</property>
+                                            <property name="use_underline">True</property>
+                                            <property name="mnemonic_widget">zCCWEntry</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEntry" id="zCCWEntry">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="invisible_char">●</property>
+                                            <property name="width_chars">30</property>
+                                            <property name="invisible_char_set">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="position">3</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">2</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
+                                    <property name="height">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkComboBoxText" id="zTypeCombo">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="entry_text_column">0</property>
+                                    <property name="id_column">1</property>
+                                    <items>
+                                      <item translatable="yes">None</item>
+                                      <item translatable="yes">CCW</item>
+                                      <item translatable="yes">WWPN</item>
+                                      <item translatable="yes">LUN</item>
+                                    </items>
+                                    <signal name="changed" handler="on_z_type_combo_changed" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="top_attach">0</property>
+                                    <property name="width">1</property>
                                     <property name="height">1</property>
                                   </packing>
                                 </child>
diff --git a/pyanaconda/ui/gui/spokes/filter.py b/pyanaconda/ui/gui/spokes/filter.py
index 308f4b3..5d9636f 100644
--- a/pyanaconda/ui/gui/spokes/filter.py
+++ b/pyanaconda/ui/gui/spokes/filter.py
@@ -34,6 +34,7 @@ from pyanaconda.ui.gui.utils import enlightbox
 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
+from pyanaconda.ui.gui.spokes.advstorage.zfcp import ZFCPDialog
 from pyanaconda.ui.gui.spokes.lib.cart import SelectedDisksDialog
 from pyanaconda.ui.gui.categories.storage import StorageCategory
 
@@ -43,7 +44,7 @@ DiskStoreRow = namedtuple("DiskStoreRow", ["visible", "selected", "mutable",
                                            "name", "type", "model", "capacity",
                                            "vendor", "interconnect", "serial",
                                            "wwid", "paths", "port", "target",
-                                           "lun", "ccw"])
+                                           "lun", "ccw", "wwpn"])
 
 class FilterPage(object):
     """A FilterPage is the logic behind one of the notebook tabs on the filter
@@ -231,7 +232,7 @@ class MultipathPage(FilterPage):
                           disk.name, "", disk.model, size_str(disk.size),
                           disk.vendor, disk.bus, disk.serial,
                           disk.wwid, "\n".join(paths), "", "",
-                          "", ""])
+                          "", "", ""])
             if not disk.vendor in vendors:
                 vendors.append(disk.vendor)
 
@@ -303,8 +304,20 @@ class OtherPage(FilterPage):
         interconnects = []
 
         for disk in disks:
+            paths = [d.name for d in disk.parents]
             selected = disk.name in selectedNames
 
+            store.append([True, selected, not disk.protected,
+                          disk.name, "", disk.model, size_str(disk.size),
+                          disk.vendor, disk.bus, disk.serial,
+                          disk.wwid, "\n".join(paths), "", "",
+                          "", "", ""])
+            if not disk.vendor in vendors:
+                vendors.append(disk.vendor)
+
+            if not disk.bus in interconnects:
+                interconnects.append(disk.bus)
+
             if hasattr(disk, "node"):
                 port = str(disk.node.port)
                 lun = str(disk.node.tpgt)
@@ -316,7 +329,7 @@ class OtherPage(FilterPage):
                           disk.name, "", disk.model, size_str(disk.size),
                           disk.vendor, disk.bus, disk.serial,
                           self._long_identifier(disk), "", port, getattr(disk, "initiator", ""),
-                          lun, ""])
+                          lun, "", ""])
 
             if not disk.vendor in vendors:
                 vendors.append(disk.vendor)
@@ -383,19 +396,78 @@ class ZPage(FilterPage):
         self.model = self.builder.get_object("zModel")
         self.model.set_visible_func(self.visible_func)
 
+        self._ccwEntry = self.builder.get_object("zCCWEntry")
+        self._wwpnEntry = self.builder.get_object("zWWPNEntry")
+        self._lunEntry = self.builder.get_object("zLUNEntry")
+
         self._isS390 = arch.isS390()
 
     def ismember(self, device):
         return isinstance(device, ZFCPDiskDevice) or isinstance(device, DASDDevice)
 
+    def clear(self):
+        self._lunEntry.set_text("")
+        self._ccwEntry.set_text("")
+        self._wwpnEntry.set_text("")
+
     def setup(self, store, selectedNames, disks):
+        """ Set up our Z-page, but only if we're running on s390x. For now this will
+            only contain info about manually added zFCP devices. At some point in the
+            future, there migh be support for manually adding more DASDs, and in that
+            case those will be displayed here.
+        """
         if not self._isS390:
             return
+        else:
+            ccws = []
+            wwpns = []
+            luns = []
+
+            self._combo = self.builder.get_object("zTypeCombo")
+            self._combo.set_active(0)
+            self._combo.emit("changed")
+
+            for disk in disks:
+                paths = [d.name for d in disk.parents]
+                selected = disk.name in selectedNames
+
+                if getattr(disk, "type") == "zfcp":
+                    # remember to store all of the zfcp-related junk so we can
+                    # see it in the UI
+                    if not disk.fcp_lun in luns:
+                        luns.append(disk.fcp_lun)
+                    if not disk.wwpn in wwpns:
+                        wwpns.append(disk.wwpn)
+                    if not disk.hba_id in ccws:
+                        ccws.append(disk.hba_id)
+
+                    # now add it to our store
+                    store.append([True, selected, not disk.protected,
+                                  disk.name, "", disk.model, size_str(disk.size),
+                                  disk.vendor, disk.bus, disk.serial, "", disk.path,
+                                  "", "", disk.fcp_lun, disk.hba_id, disk.wwpn])
+
+    def _filter_func(self, device):
+        if not self.filterActive:
+            return True
+
+        filterBy = self._combo.get_active()
+
+        if filterBy == 0:
+            return True
+        elif filterBy == 1:
+            return self._ccwEntry.get_text() in device.hba_id
+        elif filterBy == 2:
+            return self._wwpnEntry.get_text() in device.wwpn
+        elif filterBy == 3:
+            return self._lunEntry.get_text() in device.fcp_lun
+
+        return False
 
     def visible_func(self, model, itr, *args):
         obj = DiskStoreRow._make(model[itr])
         device = self.storage.devicetree.getDeviceByName(obj.name, hidden=True)
-        return self.ismember(device)
+        return self.ismember(device) and self._filter_func(device)
 
 class FilterSpoke(NormalSpoke):
     builderObjects = ["diskStore", "filterWindow",
@@ -472,7 +544,8 @@ class FilterSpoke(NormalSpoke):
         # these lists of disks, then call setup on each individual page.  This is
         # because there could be page-specific setup to do that requires a complete
         # view of all the disks on that page.
-        for disk in itertools.ifilterfalse(isLocalDisk, self.disks):
+        #for disk in itertools.ifilterfalse(isLocalDisk, self.disks):
+        for disk in self.disks:
             if self.pages[1].ismember(disk):
                 multipathDisks.append(disk)
             elif self.pages[2].ismember(disk):
@@ -580,7 +653,15 @@ class FilterSpoke(NormalSpoke):
         self.refresh()
 
     def on_add_zfcp_clicked(self, widget, *args):
-        pass
+        dialog = ZFCPDialog(self.data, self.storage)
+
+        with enlightbox(self.window, dialog.window):
+            dialog.refresh()
+            dialog.run()
+
+        # We now need to refresh so any new disks picked up by adding advanced
+        # storage are displayed in the UI.
+        self.refresh()
 
     ##
     ## SEARCH TAB SIGNAL HANDLERS
@@ -623,3 +704,17 @@ class FilterSpoke(NormalSpoke):
         findButton.set_sensitive(ndx != 0)
         clearButton.set_sensitive(ndx != 0)
         notebook.set_current_page(ndx)
+
+    ##
+    ## Z TAB SIGNAL HANDLERS
+    ##
+    def on_z_type_combo_changed(self, combo):
+        ndx = combo.get_active()
+
+        notebook = self.builder.get_object("zTypeNotebook")
+        findButton = self.builder.get_object("zFindButton")
+        clearButton = self.builder.get_object("zClearButton")
+
+        findButton.set_sensitive(ndx != 0)
+        clearButton.set_sensitive(ndx != 0)
+        notebook.set_current_page(ndx)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index b70331f..ece7cdb 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -570,7 +570,11 @@ class StorageSpoke(NormalSpoke, StorageChecker):
             if name not in disk_names:
                 continue
             obj = self.storage.devicetree.getDeviceByName(name, hidden=True)
-            if isLocalDisk(obj):
+            # since zfcp devices may be detected as local disks when added
+            # manually, specifically check the disk type here to make sure
+            # we won't accidentally bypass adding zfcp devices to the disk
+            # overview
+            if isLocalDisk(obj) and obj.type is not "zfcp":
                 continue
 
             self._add_disk_overview(obj, self.specialized_disks_box)
-- 
1.8.3.1



More information about the anaconda-patches mailing list