[PATCH rhel6-branch 5/7] 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
---
 iw/advanced_storage.py |   12 +++++
 iw/network_gui.py      |   13 ++++--
 ui/adddrive.glade      |  107 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 127 insertions(+), 5 deletions(-)

diff --git a/iw/advanced_storage.py b/iw/advanced_storage.py
index 35e8a92..928a891 100644
--- a/iw/advanced_storage.py
+++ b/iw/advanced_storage.py
@@ -479,6 +479,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 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 set sensible default
     group = dxml.get_widget("iscsiRadio").get_group()
     for button in group:
diff --git a/iw/network_gui.py b/iw/network_gui.py
index 702d227..31ec0c5 100644
--- a/iw/network_gui.py
+++ b/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.id.network.netdevices) == 0:
             self.netconfButton.set_sensitive(False)
 
@@ -63,10 +63,8 @@ class NetworkWindow(InstallWindow):
 
         return self.align
 
-    def _setupNetwork(self, *args):
-        self.intf.enableNetwork(just_setup=True)
-        if network.hasActiveNetDev():
-            urlgrabber.grabber.reset_curl_obj()
+    def _netconfButton_clicked(self, *args):
+        setupNetwork(self.intf)
 
     def focus(self):
         self.hostnameEntry.grab_focus()
@@ -98,6 +96,11 @@ class NetworkWindow(InstallWindow):
         self.anaconda.id.network.setHostname(hostname)
         return None
 
+def setupNetwork(intf):
+    intf.enableNetwork(just_setup=True)
+    if network.hasActiveNetDev():
+        urlgrabber.grabber.reset_curl_obj()
+
 def NMCEExited(pid, condition, anaconda):
     if anaconda:
         anaconda.intf.icw.window.set_sensitive(True)
diff --git a/ui/adddrive.glade b/ui/adddrive.glade
index 5440966..84f9dd2 100644
--- a/ui/adddrive.glade
+++ b/ui/adddrive.glade
@@ -260,6 +260,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>
-- 
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