[blivet] Make sure createBitmap is updated when level changes (#960271)

Chris Lumens clumens at redhat.com
Thu May 9 17:40:55 UTC 2013


> @@ -2721,6 +2718,30 @@ class MDRaidArrayDevice(StorageDevice):
>                                                  % (self.path, self.uuid))
>  
>      @property
> +    def level(self):
> +        """ Return the raid level
> +
> +            :returns: raid level value
> +            :rtype:   int
> +        """
> +        return self._level
> +
> +    @level.setter
> +    def level(self, value):
> +        """ Set the RAID level and enforce restrictions based on it.
> +
> +            :param value: new raid level
> +            :param type:  int
> +            :returns:     None
> +
> +            Sets createBitmap True unless level is 0
> +        """
> +        self._level = value
> +
> +        # bitmaps are not meaningful on raid0 according to mdadm-3.0.3
> +        self.createBitmap = self._level != 0
> +
> +    @property
>      def rawArraySize(self):
>          """ Calculate the raw array size without taking into account space
>          reserved for metadata or chunkSize alignment.

It looks like _level is never defined anywhere.  How certain are you
that the setter will always be called before the getter?

- Chris


More information about the anaconda-patches mailing list