FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 11-27-2009, 06:09 PM
Hans de Goede
 
Default Improve text mode fcoe interface

---
textw/partition_text.py | 55 +++++++++++++++++++++++++++++++++-------------
1 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/textw/partition_text.py b/textw/partition_text.py
index 4eb77a4..81c1f05 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -219,30 +219,53 @@ class PartitionTypeWindow:
return INSTALL_OK

def addFcoeDriveDialog(self, screen):
- (button, entries) = EntryWindow(screen,
- _("Add FCoE SAN"),
- _("Enter the device name for the NIC which is connected to the FCoE SAN. For example "eth0"."),
- prompts = [ _("NIC device name"),
- _("Use DCB (Yes/No)") ] )
- if button == TEXT_CANCEL_CHECK:
- return INSTALL_BACK
+ netdevs = self.anaconda.id.network.available()
+ devs = netdevs.keys()
+ devs.sort()

- nic = entries[0].strip()
- if nic not in self.anaconda.id.network.available():
+ if not devs:
ButtonChoiceWindow(screen, _("Error"),
- _("%s is not a valid NIC device name.") % nic)
+ _("No network cards present."))
return INSTALL_BACK

- dcb = entries[1].strip().lower()
- if dcb != _("yes").lower() and dcb != _("no").lower():
- ButtonChoiceWindow(screen, _("Error"),
- _("DCB value must be either yes or no."))
+ grid = GridFormHelp(screen, _("Add FCoE SAN"), "fcoeconfig",
+ 1, 4)
+
+ tb = TextboxReflowed(60,
+ _("Select which NIC is connected to the FCoE SAN."))
+ grid.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1))
+
+ interfaceList = Listbox(height=len(devs), scroll=1)
+ for dev in devs:
+ hwaddr = netdevs[dev].get("HWADDR")
+ if hwaddr:
+ desc = "%s - %.50s" % (dev, hwaddr)
+ else:
+ desc = dev
+
+ interfaceList.append(desc, dev)
+
+ interfaceList.setCurrent(devs[0])
+ grid.add(interfaceList, 0, 1, padding = (0, 1, 0, 0))
+
+ dcbCheckbox = Checkbox(_("Use DCB"), 1)
+ grid.add(dcbCheckbox, 0, 2, anchorLeft = 1)
+
+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON] )
+ grid.add(buttons, 0, 3, anchorLeft = 1, growx = 1)
+
+ result = grid.run()
+ if buttons.buttonPressed(result) == TEXT_BACK_CHECK:
+ screen.popWindow()
return INSTALL_BACK

- dcb = dcb == _("yes").lower()
+ nic = interfaceList.current()
+ dcb = dcbCheckbox.selected()

- self.anaconda.id.storage.fcoe.addSan(nic=nic, dcb=dcb)
+ self.anaconda.id.storage.fcoe.addSan(nic=nic, dcb=dcb,
+ intf=self.anaconda.intf)

+ screen.popWindow()
return INSTALL_OK

def addIscsiDriveDialog(self, screen):
--
1.6.5.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-01-2009, 10:01 AM
Ales Kozumplik
 
Default Improve text mode fcoe interface

Looks good.

On 11/27/2009 08:09 PM, Hans de Goede wrote:

---
textw/partition_text.py | 55 +++++++++++++++++++++++++++++++++-------------
1 files changed, 39 insertions(+), 16 deletions(-)

diff --git a/textw/partition_text.py b/textw/partition_text.py
index 4eb77a4..81c1f05 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -219,30 +219,53 @@ class PartitionTypeWindow:
return INSTALL_OK

def addFcoeDriveDialog(self, screen):
- (button, entries) = EntryWindow(screen,
- _("Add FCoE SAN"),
- _("Enter the device name for the NIC which is connected to the FCoE SAN. For example "eth0"."),
- prompts = [ _("NIC device name"),
- _("Use DCB (Yes/No)") ] )
- if button == TEXT_CANCEL_CHECK:
- return INSTALL_BACK
+ netdevs = self.anaconda.id.network.available()
+ devs = netdevs.keys()
+ devs.sort()

- nic = entries[0].strip()
- if nic not in self.anaconda.id.network.available():
+ if not devs:
ButtonChoiceWindow(screen, _("Error"),
- _("%s is not a valid NIC device name.") % nic)
+ _("No network cards present."))
return INSTALL_BACK

- dcb = entries[1].strip().lower()
- if dcb != _("yes").lower() and dcb != _("no").lower():
- ButtonChoiceWindow(screen, _("Error"),
- _("DCB value must be either yes or no."))
+ grid = GridFormHelp(screen, _("Add FCoE SAN"), "fcoeconfig",
+ 1, 4)
+
+ tb = TextboxReflowed(60,
+ _("Select which NIC is connected to the FCoE SAN."))
+ grid.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1))
+
+ interfaceList = Listbox(height=len(devs), scroll=1)
+ for dev in devs:
+ hwaddr = netdevs[dev].get("HWADDR")
+ if hwaddr:
+ desc = "%s - %.50s" % (dev, hwaddr)
+ else:
+ desc = dev
+
+ interfaceList.append(desc, dev)
+
+ interfaceList.setCurrent(devs[0])
+ grid.add(interfaceList, 0, 1, padding = (0, 1, 0, 0))
+
+ dcbCheckbox = Checkbox(_("Use DCB"), 1)
+ grid.add(dcbCheckbox, 0, 2, anchorLeft = 1)
+
+ buttons = ButtonBar(screen, [TEXT_OK_BUTTON, TEXT_BACK_BUTTON] )
+ grid.add(buttons, 0, 3, anchorLeft = 1, growx = 1)
+
+ result = grid.run()
+ if buttons.buttonPressed(result) == TEXT_BACK_CHECK:
+ screen.popWindow()
return INSTALL_BACK

- dcb = dcb == _("yes").lower()
+ nic = interfaceList.current()
+ dcb = dcbCheckbox.selected()

- self.anaconda.id.storage.fcoe.addSan(nic=nic, dcb=dcb)
+ self.anaconda.id.storage.fcoe.addSan(nic=nic, dcb=dcb,
+ intf=self.anaconda.intf)

+ screen.popWindow()
return INSTALL_OK

def addIscsiDriveDialog(self, screen):


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

Thread Tools




All times are GMT. The time now is 12:58 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org