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 > Redhat > Fedora Marketing

 
 
LinkBack Thread Tools
 
Old 04-14-2010, 08:49 PM
Hans de Goede
 
Default Check for and offer to format unformatted DASD devices (#560702).

Hi,

On 04/14/2010 10:08 PM, David Cantrell wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 14 Apr 2010, Hans de Goede wrote:


Nack!

This won't work as the dasd object currently is not a singleton. To
make it a singleton using the same design pattern as iscsi / zfcp / fcoe
add:

# So that users can write DASD() to get the singleton instance
def __call__(self):
return self

To the DASD class, and the following to the end of dasd.py:

# Create DASD singleton
DASD = DASD()



Updated. New patch:



Looks good now, ack.

Regards,

Hans

p.s.

Thx for the reviews.


diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index 64b8700..63c834e 100644
- --- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -35,6 +35,7 @@ from flags import flags
import storage.iscsi
import storage.fcoe
import storage.zfcp
+import storage.dasd

import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -550,8 +551,7 @@ class FilterWindow(InstallWindow):
storage.iscsi.iscsi().startup(anaconda.intf)
storage.fcoe.fcoe().startup(anaconda.intf)
storage.zfcp.ZFCP().startup()
- - # Note we do NOT call dasd.startup() here, that does not online
drives,
- - # but only checks if they need formatting.
+ storage.dasd.DASD().startup(anaconda.intf)
disks = filter(udev_device_is_disk, udev_get_block_devices())
(singlepaths, mpaths, partitions) = identifyMultipaths(disks)

diff --git a/storage/dasd.py b/storage/dasd.py
index 591dde0..b69be35 100644
- --- a/storage/dasd.py
+++ b/storage/dasd.py
@@ -49,6 +49,9 @@ class DASD:
self._maxFormatJobs = 0
self.started = False

+ def __call__(self):
+ return self
+
def startup(self, *args, **kwargs):
""" Look for any unformatted DASDs in the system and offer the user
the option for format them with dasdfmt or exit the installer.
@@ -200,4 +203,7 @@ class DASD:

return self._totalCylinders

+# Create DASD singleton
+DASD = DASD()
+
# vim:tw=78:ts=4:et:sw=4

- -- David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkvGIMMACgkQ5hsjjIy1VklRPgCgl94IChxw3c rC5rYBPdXld9Wi
iuoAoMZzdRh8p4a+o7O0GZ9wudJuUaKx
=YUTH
-----END PGP SIGNATURE-----

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


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

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