[PATCH rhel7-alpha2-branch 07/16] iscsi: add Configure Network to advanced storage GUI (#500273)

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

 



Useful for bringing up second interface for iscsi (e.g. for iface bound
and multipathed target)

Related: rhbz#500273
---
 data/ui/adddrive.glade            |  107 +++++++++++++++++++++++++++++++++++++
 pyanaconda/iw/advanced_storage.py |   12 ++++
 pyanaconda/iw/network_gui.py      |    9 ++-
 3 files changed, 125 insertions(+), 3 deletions(-)

diff --git a/data/ui/adddrive.glade b/data/ui/adddrive.glade
index 6a0a7cc..bfce9ee 100644
--- a/data/ui/adddrive.glade
+++ b/data/ui/adddrive.glade
@@ -216,6 +216,113 @@
 	      <property name="fill">True</property>
 	    </packing>
 	  </child>
+
+	  <child>
+	    <widget class="GtkHSeparator" id="hseparator1">
+	      <property name="visible">True</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox2">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">7</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label3">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Active network interfaces:</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="ifaceLabel">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">None</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox3">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">0</property>
+
+	      <child>
+		<placeholder/>
+	      </child>
+
+	      <child>
+		<widget class="GtkButton" id="netconfButton">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">C_onfigure Network</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>
diff --git a/pyanaconda/iw/advanced_storage.py b/pyanaconda/iw/advanced_storage.py
index ebaf0e9..ecdda1b 100644
--- a/pyanaconda/iw/advanced_storage.py
+++ b/pyanaconda/iw/advanced_storage.py
@@ -476,6 +476,18 @@ def addDrive(anaconda):
         dxml.get_widget("fcoeRadio").set_sensitive(False)
         dxml.get_widget("fcoeRadio").set_active(False)
 
+    def update_active_ifaces():
+        active_ifaces = network.getActiveNetDevs()
+        dxml.get_widget("ifaceLabel").set_text(", ".join(active_ifaces))
+
+    def netconfButton_clicked(*args):
+        from pyanaconda.iw.network_gui import setupNetwork
+        setupNetwork(anaconda.intf)
+        update_active_ifaces()
+
+    dxml.get_widget("netconfButton").connect("clicked", netconfButton_clicked)
+    update_active_ifaces()
+
     #figure out what advanced devices we have available and put focus on the first one
     group = dxml.get_widget("iscsiRadio").get_group()
     for button in reversed(group):
diff --git a/pyanaconda/iw/network_gui.py b/pyanaconda/iw/network_gui.py
index a7bf321..1521db0 100644
--- a/pyanaconda/iw/network_gui.py
+++ b/pyanaconda/iw/network_gui.py
@@ -50,7 +50,7 @@ class NetworkWindow(InstallWindow):
         self.hostnameEntry.set_text(self.hostname)
 
         self.netconfButton = self.xml.get_widget("netconfButton")
-        self.netconfButton.connect("clicked", self._setupNetwork)
+        self.netconfButton.connect("clicked", self._netconfButton_clicked)
         if (len(self.anaconda.network.netdevices) == 0
             or flags.imageInstall
             or flags.livecdInstall):
@@ -65,8 +65,8 @@ class NetworkWindow(InstallWindow):
 
         return self.align
 
-    def _setupNetwork(self, *args):
-        self.intf.enableNetwork(just_setup=True)
+    def _netconfButton_clicked(self, *args):
+        setupNetwork(self.intf)
 
     def focus(self):
         self.hostnameEntry.grab_focus()
@@ -102,6 +102,9 @@ def NMCEExited(pid, condition, anaconda):
     if anaconda:
         anaconda.intf.icw.window.set_sensitive(True)
 
+def setupNetwork(intf):
+    intf.enableNetwork(just_setup=True)
+
 # TODORV: get rid of setting sensitive completely?
 def runNMCE(anaconda=None, blocking=True):
     if not blocking and anaconda:
-- 
1.7.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux