[anaconda][master/rhel7-branch] [PATCH 2/3] Show unformatted DASDs in the local disk store. (#1064423)
Vratislav Podzimek
vpodzime at redhat.com
Tue Feb 25 14:23:01 UTC 2014
On Tue, 2014-02-25 at 08:59 -0500, Samantha N. Bueno wrote:
> On Tue, Feb 25, 2014 at 01:04:07PM +0100, Vratislav Podzimek wrote:
> > On Tue, 2014-02-25 at 04:30 -0500, Samantha N. Bueno wrote:
> > > Since the installer can handle unformatted DASDs, all of them should
> > > be viewable and selectable from the storage spoke.
> > >
> > > Resolves: rhbz#1064423
> > > ---
> > > pyanaconda/ui/lib/disks.py | 23 ++++++++++++++++++-----
> > > 1 file changed, 18 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/pyanaconda/ui/lib/disks.py b/pyanaconda/ui/lib/disks.py
> > > index 486208b..010b9af 100644
> > > --- a/pyanaconda/ui/lib/disks.py
> > > +++ b/pyanaconda/ui/lib/disks.py
> > > @@ -53,11 +53,24 @@ def getDisks(devicetree, fake=False):
> > > if not flags.imageInstall:
> > > devices += devicetree._hidden
> > >
> > > - disks = [d for d in devices if d.isDisk and
> > > - d.mediaPresent and
> > > - not d.format.hidden and
> > > - not (d.protected and
> > > - d.removable)]
> > > +# disks = [d for d in devices if d.isDisk and
> > > +# d.mediaPresent and
> > > +# not d.format.hidden and
> > > +# not (d.protected and
> > > +# d.removable)]
> > > +#
> > We probably don't need this nice piece of history anymore. :)
>
> Ha, very true. ;) Removed.
>
> > > + disks = []
> > > + for d in devices:
> > > + if d.isDisk and not d.format.hidden and not (d.protected and d.removable):
> > What about the 'd.mediaPresent' check?
>
> Ahh, right. So unformatted DASDs will fail that and the size > 0 check,
> hence why I just ignore those if disk.type == "dasd". But I could make
> my conditional instead:
>
> if d.type == "dasd":
> disks.append(d)
> elif d.size > 0 and d.mediaPresent:
> disks.append(d)
>
This looks good to me.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list