----- Original Message -----
From: "Vratislav Podzimek" <vpodzime(a)redhat.com>
To: "anaconda patch review" <anaconda-patches(a)lists.fedorahosted.org>
Sent: Friday, May 30, 2014 3:16:12 AM
Subject: Re: [blivet:master 07/26] Allow the RAID object itself to be a valid RAID
descriptor for lookup.
On Thu, 2014-05-29 at 14:47 -0400, mulhern wrote:
> Update tests accordingly.
>
> Signed-off-by: mulhern <amulhern(a)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
_______________________________________________
anaconda-patches mailing list
anaconda-patches(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
We want 'is', since we've taken
all that trouble to make each RAID level object unique.
Thanks for catching that, fixed in current copy.
- mulhern