[blivet:master 07/26] Allow the RAID object itself to be a valid RAID descriptor for lookup.

Vratislav Podzimek vpodzime at redhat.com
Fri May 30 07:16:12 UTC 2014


On Thu, 2014-05-29 at 14:47 -0400, mulhern wrote:
> Update tests accordingly.
> 
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>  blivet/devicelibs/raid.py          | 5 ++++-
>  blivet/devices.py                  | 2 +-
>  tests/devicelibs_test/raid_test.py | 1 +
>  3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/blivet/devicelibs/raid.py b/blivet/devicelibs/raid.py
> index 84f2aa1..33af02f 100644
> --- a/blivet/devicelibs/raid.py
> +++ b/blivet/devicelibs/raid.py
> @@ -303,11 +303,14 @@ class RAIDLevels(object):
>  
>             :param object descriptor: a RAID level descriptor
>  
> +           Note that descriptor may be any object that identifies a
> +           RAID level, including the RAID object itself.
> +
>             Raises a RaidError if no RAID object can be found for this
>             descriptor.
>          """
>          for level in self._raid_levels:
> -            if descriptor in level.names:
> +            if descriptor in level.names or descriptor == level:
How is the __eq__ defined for RAIDLevel? Or do we want to use 'is'
instead of '==' here?

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list