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-22-2010, 08:24 AM
Hans de Goede
 
Default Make isDisk a property

Some MDRaidDevices are disks (BIOS RAID) others are not, so make
it a property so that MDRaidDevice can override it.
---
storage/devices.py | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 26c1a53..bddf055 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -427,7 +427,7 @@ class StorageDevice(Device):
sysfsBlockDir = "class/block"
_resizable = False
_partitionable = False
- isDisk = False
+ _isDisk = False

def __init__(self, device, format=None,
size=None, major=None, minor=None,
@@ -739,6 +739,10 @@ class StorageDevice(Device):
open(remfile).readline().strip() == "1")

@property
+ def isDisk(self):
+ return self._isDisk
+
+ @property
def partitionable(self):
return self._partitionable

@@ -764,7 +768,7 @@ class DiskDevice(StorageDevice):
""" A disk """
_type = "disk"
_partitionable = True
- isDisk = True
+ _isDisk = True

def __init__(self, device, format=None,
size=None, major=None, minor=None, sysfsPath=',
@@ -2841,7 +2845,7 @@ class DMRaidArrayDevice(DMDevice):
_type = "dm-raid array"
_packages = ["dmraid"]
_partitionable = True
- isDisk = True
+ _isDisk = True

def __init__(self, name, raidSet=None, format=None,
size=None, major=None, minor=None, parents=None,
@@ -2943,7 +2947,7 @@ class MultipathDevice(DMDevice):
_type = "dm-multipath"
_packages = ["device-mapper-multipath"]
_partitionable = True
- isDisk = True
+ _isDisk = True

def __init__(self, name, info, format=None, size=None,
parents=None, sysfsPath='):
@@ -3281,7 +3285,7 @@ class iScsiDiskDevice(DiskDevice, NetworkStorageDevice):
_type = "iscsi"
_packages = ["iscsi-initiator-utils", "dracut-network"]
_partitionable = True
- isDisk = True
+ _isDisk = True

def __init__(self, device, **kwargs):
self.node = kwargs.pop("node")
@@ -3315,7 +3319,7 @@ class FcoeDiskDevice(DiskDevice, NetworkStorageDevice):
_type = "fcoe"
_packages = ["fcoe-utils", "dracut-network"]
_partitionable = True
- isDisk = True
+ _isDisk = True

def __init__(self, device, **kwargs):
self.nic = kwargs.pop("nic")
--
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-22-2010, 03:23 PM
David Lehman
 
Default Make isDisk a property

Ack.

On Fri, 2010-01-22 at 10:24 +0100, Hans de Goede wrote:
> Some MDRaidDevices are disks (BIOS RAID) others are not, so make
> it a property so that MDRaidDevice can override it.
> ---
> storage/devices.py | 16 ++++++++++------
> 1 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/storage/devices.py b/storage/devices.py
> index 26c1a53..bddf055 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -427,7 +427,7 @@ class StorageDevice(Device):
> sysfsBlockDir = "class/block"
> _resizable = False
> _partitionable = False
> - isDisk = False
> + _isDisk = False
>
> def __init__(self, device, format=None,
> size=None, major=None, minor=None,
> @@ -739,6 +739,10 @@ class StorageDevice(Device):
> open(remfile).readline().strip() == "1")
>
> @property
> + def isDisk(self):
> + return self._isDisk
> +
> + @property
> def partitionable(self):
> return self._partitionable
>
> @@ -764,7 +768,7 @@ class DiskDevice(StorageDevice):
> """ A disk """
> _type = "disk"
> _partitionable = True
> - isDisk = True
> + _isDisk = True
>
> def __init__(self, device, format=None,
> size=None, major=None, minor=None, sysfsPath=',
> @@ -2841,7 +2845,7 @@ class DMRaidArrayDevice(DMDevice):
> _type = "dm-raid array"
> _packages = ["dmraid"]
> _partitionable = True
> - isDisk = True
> + _isDisk = True
>
> def __init__(self, name, raidSet=None, format=None,
> size=None, major=None, minor=None, parents=None,
> @@ -2943,7 +2947,7 @@ class MultipathDevice(DMDevice):
> _type = "dm-multipath"
> _packages = ["device-mapper-multipath"]
> _partitionable = True
> - isDisk = True
> + _isDisk = True
>
> def __init__(self, name, info, format=None, size=None,
> parents=None, sysfsPath='):
> @@ -3281,7 +3285,7 @@ class iScsiDiskDevice(DiskDevice, NetworkStorageDevice):
> _type = "iscsi"
> _packages = ["iscsi-initiator-utils", "dracut-network"]
> _partitionable = True
> - isDisk = True
> + _isDisk = True
>
> def __init__(self, device, **kwargs):
> self.node = kwargs.pop("node")
> @@ -3315,7 +3319,7 @@ class FcoeDiskDevice(DiskDevice, NetworkStorageDevice):
> _type = "fcoe"
> _packages = ["fcoe-utils", "dracut-network"]
> _partitionable = True
> - isDisk = True
> + _isDisk = True
>
> def __init__(self, device, **kwargs):
> self.nic = kwargs.pop("nic")


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

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