Re: [PATCH] Fix devicelibs.dm.device_is_multipath support for new udev rules.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/30/2009 03:44 PM, Hans de Goede wrote:
> Hi,
> 
> Erm, this has some issues, see below.
> 
> On 11/30/2009 09:06 PM, Peter Jones wrote:
>> New udev rules for DM stuff use 'MAJOR' and 'MINOR' instead of 'DM_MAJOR'
>> and 'DM_MINOR', so we need devicelibs.dm.device_is_multipath() to check
>> for them instead. For now, this code will work with either variety.
>>
>> This also makes devicelibs.dm.device_is_multipath() take the whole info
>> blob and do what it needs with it, rather than splitting it up in the
>> calling function.
>> ---
>>   storage/devicelibs/dm.py |   17 ++++++++++++++++-
>>   storage/devicetree.py    |    2 +-
>>   2 files changed, 17 insertions(+), 2 deletions(-)
>>
>> diff --git a/storage/devicelibs/dm.py b/storage/devicelibs/dm.py
>> index c118d51..1689e57 100644
>> --- a/storage/devicelibs/dm.py
>> +++ b/storage/devicelibs/dm.py
>> @@ -67,7 +67,22 @@ def dm_node_from_name(map_name):
>>       log.debug("dm_node_from_name(%s) returning '%s'" % (map_name,
>> dm_node))
>>       return dm_node
>>
>> -def dm_is_multipath(major, minor):
>> +def dm_is_multipath(info):
>> +    major = None
>> +    minor = None
>> +
>> +    if info.has_key('MAJOR'):
>> +        major = info['MAJOR']
>> +    elif info.has_key('DM_MAJOR'):
>> +        major = info['DM_MAJOR']
>> +    if info.has_key('MINOR'):
>> +        major = info['MINOR']
>> +    elif info.has_key('DM_MINOR'):
>> +        major = info['DM_MINOR']
>> +
> 
> These last 2 major occurences should read minor! Other then that it is
> ack.

Oh, thanks for catching that.

-- 
        Peter

Sanity's just a one trick pony anyway.  You only get one trick -- rational
thinking -- but when you're good and crazy, the sky's the limit!
		-- The Tick

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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux