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 > CRUX > CRUX

 
 
LinkBack Thread Tools
 
Old 11-23-2010, 11:59 AM
Ales Kozumplik
 
Default Do not auto-check all drives when creating a RAID partition (#641910).

The patch modifies parameter lists of createAllowedDrivesStore() and
createAllowedDrivesList() into what I think makes more sense (the old
selectDrives always ended up being True).
---
pyanaconda/iw/partition_dialog_gui.py | 7 ++++++-
pyanaconda/iw/partition_ui_helpers_gui.py | 24 ++++++++++--------------
2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/pyanaconda/iw/partition_dialog_gui.py b/pyanaconda/iw/partition_dialog_gui.py
index 723fbee..26abd02 100644
--- a/pyanaconda/iw/partition_dialog_gui.py
+++ b/pyanaconda/iw/partition_dialog_gui.py
@@ -457,9 +457,14 @@ class PartitionEditor:
maintable.attach(lbl, 0, 1, row, row + 1)

req_disk_names = [d.name for d in self.origrequest.req_disks]
+ preselectAll = True
+ if restrictfs and 'mdmember' in restrictfs:
+ # do not preselect all available drives for new raid partitions
+ preselectAll = False
self.driveview = createAllowedDrivesList(self.storage.partitioned,
req_disk_names,
- disallowDrives=[self.anaconda.updateSrc])
+ disallowDrives=[self.anaconda.updateSrc],
+ preselectAll=preselectAll)
lbl.set_mnemonic_widget(self.driveview)
sw = gtk.ScrolledWindow()
sw.add(self.driveview)
diff --git a/pyanaconda/iw/partition_ui_helpers_gui.py b/pyanaconda/iw/partition_ui_helpers_gui.py
index 4b88347..fa8d20e 100644
--- a/pyanaconda/iw/partition_ui_helpers_gui.py
+++ b/pyanaconda/iw/partition_ui_helpers_gui.py
@@ -140,19 +140,17 @@ def fstypechangeCB(widget, mountCombo):
fstype = widget.get_active_value()
setMntPtComboStateFromType(fstype, mountCombo)

-def createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=True,
- disallowDrives=[]):
+def createAllowedDrivesStore(disks, reqdrives, drivelist, disallowDrives,
+ preselectAll):
drivelist.clear()
for disk in disks:
selected = 0

- if selectDrives:
- if reqdrives:
- if disk.name in reqdrives:
- selected = 1
- else:
- if disk.name not in disallowDrives:
- selected = 1
+ if reqdrives:
+ if disk.name in reqdrives:
+ selected = 1
+ elif preselectAll and (disk.name not in disallowDrives):
+ selected = 1

sizestr = "%8.0f MB" % disk.size
drivelist.append_row((disk.name,
@@ -165,7 +163,7 @@ def createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=True,
else:
drivelist.set_sensitive(True)

-def createAllowedDrivesList(disks, reqdrives, selectDrives=True, disallowDrives=[]):
+def createAllowedDrivesList(disks, reqdrives, disallowDrives, preselectAll):
store = gtk.TreeStore(gobject.TYPE_BOOLEAN,
gobject.TYPE_STRING,
gobject.TYPE_STRING,
@@ -174,12 +172,10 @@ def createAllowedDrivesList(disks, reqdrives, selectDrives=True, disallowDrives=
columns = ['Drive', 'Size', 'Model']
drivelist = WideCheckList(columns, store, sensitivity=True)
drivelist.set_headers_visible(True)
- createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=selectDrives,
- disallowDrives=disallowDrives)
+ createAllowedDrivesStore(disks, reqdrives, drivelist, disallowDrives,
+ preselectAll)

return drivelist
-
-

# pass in callback for when fs changes because of python scope issues
def createFSTypeMenu(format, fstypechangeCB, mountCombo,
--
1.7.3.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-23-2010, 02:55 PM
David Lehman
 
Default Do not auto-check all drives when creating a RAID partition (#641910).

On Tue, 2010-11-23 at 13:59 +0100, Ales Kozumplik wrote:
> The patch modifies parameter lists of createAllowedDrivesStore() and
> createAllowedDrivesList() into what I think makes more sense (the old
> selectDrives always ended up being True).
> ---
> pyanaconda/iw/partition_dialog_gui.py | 7 ++++++-
> pyanaconda/iw/partition_ui_helpers_gui.py | 24 ++++++++++--------------
> 2 files changed, 16 insertions(+), 15 deletions(-)

Ack.

>
> diff --git a/pyanaconda/iw/partition_dialog_gui.py b/pyanaconda/iw/partition_dialog_gui.py
> index 723fbee..26abd02 100644
> --- a/pyanaconda/iw/partition_dialog_gui.py
> +++ b/pyanaconda/iw/partition_dialog_gui.py
> @@ -457,9 +457,14 @@ class PartitionEditor:
> maintable.attach(lbl, 0, 1, row, row + 1)
>
> req_disk_names = [d.name for d in self.origrequest.req_disks]
> + preselectAll = True
> + if restrictfs and 'mdmember' in restrictfs:
> + # do not preselect all available drives for new raid partitions
> + preselectAll = False
> self.driveview = createAllowedDrivesList(self.storage.partitioned,
> req_disk_names,
> - disallowDrives=[self.anaconda.updateSrc])
> + disallowDrives=[self.anaconda.updateSrc],
> + preselectAll=preselectAll)
> lbl.set_mnemonic_widget(self.driveview)
> sw = gtk.ScrolledWindow()
> sw.add(self.driveview)
> diff --git a/pyanaconda/iw/partition_ui_helpers_gui.py b/pyanaconda/iw/partition_ui_helpers_gui.py
> index 4b88347..fa8d20e 100644
> --- a/pyanaconda/iw/partition_ui_helpers_gui.py
> +++ b/pyanaconda/iw/partition_ui_helpers_gui.py
> @@ -140,19 +140,17 @@ def fstypechangeCB(widget, mountCombo):
> fstype = widget.get_active_value()
> setMntPtComboStateFromType(fstype, mountCombo)
>
> -def createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=True,
> - disallowDrives=[]):
> +def createAllowedDrivesStore(disks, reqdrives, drivelist, disallowDrives,
> + preselectAll):
> drivelist.clear()
> for disk in disks:
> selected = 0
>
> - if selectDrives:
> - if reqdrives:
> - if disk.name in reqdrives:
> - selected = 1
> - else:
> - if disk.name not in disallowDrives:
> - selected = 1
> + if reqdrives:
> + if disk.name in reqdrives:
> + selected = 1
> + elif preselectAll and (disk.name not in disallowDrives):
> + selected = 1
>
> sizestr = "%8.0f MB" % disk.size
> drivelist.append_row((disk.name,
> @@ -165,7 +163,7 @@ def createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=True,
> else:
> drivelist.set_sensitive(True)
>
> -def createAllowedDrivesList(disks, reqdrives, selectDrives=True, disallowDrives=[]):
> +def createAllowedDrivesList(disks, reqdrives, disallowDrives, preselectAll):
> store = gtk.TreeStore(gobject.TYPE_BOOLEAN,
> gobject.TYPE_STRING,
> gobject.TYPE_STRING,
> @@ -174,12 +172,10 @@ def createAllowedDrivesList(disks, reqdrives, selectDrives=True, disallowDrives=
> columns = ['Drive', 'Size', 'Model']
> drivelist = WideCheckList(columns, store, sensitivity=True)
> drivelist.set_headers_visible(True)
> - createAllowedDrivesStore(disks, reqdrives, drivelist, selectDrives=selectDrives,
> - disallowDrives=disallowDrives)
> + createAllowedDrivesStore(disks, reqdrives, drivelist, disallowDrives,
> + preselectAll)
>
> return drivelist
> -
> -
>
> # pass in callback for when fs changes because of python scope issues
> def createFSTypeMenu(format, fstypechangeCB, mountCombo,


_______________________________________________
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:01 AM.

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