Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Kernel Team (http://www.linux-archive.org/ubuntu-kernel-team/)
-   -   Set StorageDevice.exists before calling Device.__init__ (http://www.linux-archive.org/ubuntu-kernel-team/309969-set-storagedevice-exists-before-calling-device-__init__.html)

Peter Jones 01-15-2010 08:23 PM

Set StorageDevice.exists before calling Device.__init__
 
Set self.exists in StorageDevice.__init__ before calling
Device.__init__, because some Device methods use .exists and they can be
called before StorageDevice.__init__ finishes.

This probably needs more rethinking, but it makes things better for now.
---
storage/devices.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index ead7ae8..6b19fd8 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -453,6 +453,7 @@ class StorageDevice(Device):
if isinstance(parents, Device):
parents = [parents]

+ self.exists = exists
Device.__init__(self, device, parents=parents)

self.uuid = None
@@ -461,7 +462,6 @@ class StorageDevice(Device):
self.major = numeric_type(major)
self.minor = numeric_type(minor)
self.sysfsPath = sysfsPath
- self.exists = exists
self.serial = serial
self.vendor = vendor
self.bus = bus
--
1.6.5.2

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

Peter Jones 01-20-2010 11:03 PM

Set StorageDevice.exists before calling Device.__init__
 
Set self.exists in StorageDevice.__init__ before calling
Device.__init__, because some Device methods use .exists and they can be
called before StorageDevice.__init__ finishes.

This probably needs more rethinking, but it makes things better for now.
---
storage/devices.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 3a00584..4137d4f 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -457,6 +457,7 @@ class StorageDevice(Device):
if isinstance(parents, Device):
parents = [parents]

+ self.exists = exists
Device.__init__(self, device, parents=parents)

self.uuid = None
@@ -465,7 +466,6 @@ class StorageDevice(Device):
self.major = numeric_type(major)
self.minor = numeric_type(minor)
self.sysfsPath = sysfsPath
- self.exists = exists
self._serial = serial
self._vendor = vendor
self._model = model
--
1.6.5.2

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


All times are GMT. The time now is 04:13 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.