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

Re: [PATCH 6/8] Add isDisk property to MDRaidArrayDevice



On Fri, 2010-01-22 at 10:24 +0100, Hans de Goede wrote:
> And make it return True for BIOS RAID sets (but not for containers).
> ---
>  storage/devices.py |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/storage/devices.py b/storage/devices.py
> index bddf055..52e0466 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -2836,6 +2836,10 @@ class MDRaidArrayDevice(StorageDevice):
>      def partitionable(self):
>          return self.devices and self.devices[0].type == "mdcontainer"
>  
> +    @property
> +    def isDisk(self):
> +        return self.devices and self.devices[0].type == "mdcontainer"
> +

It's better if you make this always return a boolean. (use
len(self.devices) != 0)

Dave

>      def dracutSetupString(self):
>          return "rd_MD_UUID=%s" % self.uuid
>  



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