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 Development

 
 
LinkBack Thread Tools
 
Old 01-15-2010, 10:24 PM
Peter Jones
 
Default Make sure MultipathDevice is setup correctly.

Make sure exists is set when creating MultipathDevice, as well as any
other ancillary data. Also revamp MultipathDevice.status since we now
can create it in realtime like everything else does.
---
storage/devices.py | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 8d74fa7..a2a4289 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2936,6 +2936,8 @@ class MultipathDevice(DMDevice):
self.setupIdentity()
DMDevice.__init__(self, name, format=format, size=size,
parents=parents, sysfsPath=sysfsPath)
+ parents=parents, sysfsPath=sysfsPath,
+ exists=True)

# PJTODO: these need better setup
self.config = {
@@ -2958,8 +2960,8 @@ class MultipathDevice(DMDevice):

May be overridden by a sub-class for e.g. RDAC handling.
"""
- self._serial_short = self._info['ID_SERIAL_SHORT']
- self._serial = self._info['ID_SERIAL']
+ self._identity_short = self._info['ID_SERIAL_SHORT']
+ self._identity = self._info['ID_SERIAL']

@property
def identity(self):
@@ -2967,21 +2969,25 @@ class MultipathDevice(DMDevice):

May be overridden by a sub-class for e.g. RDAC handling.
"""
- if not hasattr(self, "_serial"):
+ if not hasattr(self, "_identity"):
raise RuntimeError, "setupIdentityFromInfo() has not been called."
- return self._serial
+ return self._identity

@property
def status(self):
- return self._isUp
+ """ The device's status (True means active). """
+ if not os.path.exists(self.path):
+ return False
+
+ return True

@property
def wwid(self):
- serial = self._serial_short
+ identity = self._identity_short
ret = []
- while serial:
- ret.append(serial[:2])
- serial = serial[2:]
+ while identity:
+ ret.append(identity[:2])
+ identity = identity[2:]
return ":".join(ret)

@property
--
1.6.5.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-20-2010, 11:03 PM
Peter Jones
 
Default Make sure MultipathDevice is setup correctly.

Make sure exists is set when creating MultipathDevice, as well as any
other ancillary data. Also revamp MultipathDevice.status since we now
can create it in realtime like everything else does.
---
storage/devices.py | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 4137d4f..ab4739a 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2935,7 +2935,8 @@ class MultipathDevice(DMDevice):
self._pyBlockMultiPath = None
self.setupIdentity()
DMDevice.__init__(self, name, format=format, size=size,
- parents=parents, sysfsPath=sysfsPath)
+ parents=parents, sysfsPath=sysfsPath,
+ exists=True)

# PJTODO: these need better setup
self.config = {
@@ -2958,8 +2959,8 @@ class MultipathDevice(DMDevice):

May be overridden by a sub-class for e.g. RDAC handling.
"""
- self._serial_short = self._info['ID_SERIAL_SHORT']
- self._serial = self._info['ID_SERIAL']
+ self._identity_short = self._info['ID_SERIAL_SHORT']
+ self._identity = self._info['ID_SERIAL']

@property
def identity(self):
@@ -2967,21 +2968,25 @@ class MultipathDevice(DMDevice):

May be overridden by a sub-class for e.g. RDAC handling.
"""
- if not hasattr(self, "_serial"):
+ if not hasattr(self, "_identity"):
raise RuntimeError, "setupIdentityFromInfo() has not been called."
- return self._serial
+ return self._identity

@property
def status(self):
- return self._isUp
+ """ The device's status (True means active). """
+ if not os.path.exists(self.path):
+ return False
+
+ return True

@property
def wwid(self):
- serial = self._serial_short
+ identity = self._identity_short
ret = []
- while serial:
- ret.append(serial[:2])
- serial = serial[2:]
+ while identity:
+ ret.append(identity[:2])
+ identity = identity[2:]
return ":".join(ret)

@property
--
1.6.5.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-20-2010, 11:24 PM
David Lehman
 
Default Make sure MultipathDevice is setup correctly.

On Wed, 2010-01-20 at 19:03 -0500, Peter Jones wrote:
> Make sure exists is set when creating MultipathDevice, as well as any
> other ancillary data. Also revamp MultipathDevice.status since we now
> can create it in realtime like everything else does.
> ---
> storage/devices.py | 25 +++++++++++++++----------
> 1 files changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/storage/devices.py b/storage/devices.py
> index 4137d4f..ab4739a 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -2967,21 +2968,25 @@ class MultipathDevice(DMDevice):
>
> May be overridden by a sub-class for e.g. RDAC handling.
> """
> - if not hasattr(self, "_serial"):
> + if not hasattr(self, "_identity"):
> raise RuntimeError, "setupIdentityFromInfo() has not been called."
> - return self._serial
> + return self._identity
>
> @property
> def status(self):
> - return self._isUp
> + """ The device's status (True means active). """
> + if not os.path.exists(self.path):
> + return False
> +
> + return True

Why not just inherit DMDevice.status?

Dave

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-21-2010, 05:42 PM
Peter Jones
 
Default Make sure MultipathDevice is setup correctly.

On 01/20/2010 07:24 PM, David Lehman wrote:
> On Wed, 2010-01-20 at 19:03 -0500, Peter Jones wrote:
>> Make sure exists is set when creating MultipathDevice, as well as any
>> other ancillary data. Also revamp MultipathDevice.status since we now
>> can create it in realtime like everything else does.
>> ---
>> storage/devices.py | 25 +++++++++++++++----------
>> 1 files changed, 15 insertions(+), 10 deletions(-)
>>
>> diff --git a/storage/devices.py b/storage/devices.py
>> index 4137d4f..ab4739a 100644
>> --- a/storage/devices.py
>> +++ b/storage/devices.py
>> @@ -2967,21 +2968,25 @@ class MultipathDevice(DMDevice):
>>
>> May be overridden by a sub-class for e.g. RDAC handling.
>> """
>> - if not hasattr(self, "_serial"):
>> + if not hasattr(self, "_identity"):
>> raise RuntimeError, "setupIdentityFromInfo() has not been called."
>> - return self._serial
>> + return self._identity
>>
>> @property
>> def status(self):
>> - return self._isUp
>> + """ The device's status (True means active). """
>> + if not os.path.exists(self.path):
>> + return False
>> +
>> + return True
>
> Why not just inherit DMDevice.status?

Yeah, you're right, that's better. Done in my local tree.

--
Peter

What we need is either less corruption, or more chances to
participate in it.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-21-2010, 08:24 PM
David Lehman
 
Default Make sure MultipathDevice is setup correctly.

On Thu, 2010-01-21 at 13:42 -0500, Peter Jones wrote:
> On 01/20/2010 07:24 PM, David Lehman wrote:
> > On Wed, 2010-01-20 at 19:03 -0500, Peter Jones wrote:
> >> Make sure exists is set when creating MultipathDevice, as well as any
> >> other ancillary data. Also revamp MultipathDevice.status since we now
> >> can create it in realtime like everything else does.
> >> ---
> >> storage/devices.py | 25 +++++++++++++++----------
> >> 1 files changed, 15 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/storage/devices.py b/storage/devices.py
> >> index 4137d4f..ab4739a 100644
> >> --- a/storage/devices.py
> >> +++ b/storage/devices.py
> >> @@ -2967,21 +2968,25 @@ class MultipathDevice(DMDevice):
> >>
> >> May be overridden by a sub-class for e.g. RDAC handling.
> >> """
> >> - if not hasattr(self, "_serial"):
> >> + if not hasattr(self, "_identity"):
> >> raise RuntimeError, "setupIdentityFromInfo() has not been called."
> >> - return self._serial
> >> + return self._identity
> >>
> >> @property
> >> def status(self):
> >> - return self._isUp
> >> + """ The device's status (True means active). """
> >> + if not os.path.exists(self.path):
> >> + return False
> >> +
> >> + return True
> >
> > Why not just inherit DMDevice.status?
>
> Yeah, you're right, that's better. Done in my local tree.
>

Ack, given the change to use DMDevice.status.


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

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