[master/f23-branch] Fix traceback when trying to create list of unformatted DASDs. (#1268764)

Samantha N. Bueno sbueno+anaconda at redhat.com
Wed Oct 7 16:21:30 UTC 2015


On Tue, Oct 06, 2015 at 05:27:54PM -0400, David Lehman wrote:
> On Tue, 2015-10-06 at 11:37 -0400, Samantha N. Bueno wrote:
> > Have to pass in a list of DASD objects obtained from
> > storage.devicetree.dasd
> > since make_unformatted_dasd_list requires a list of DASD objects to
> > process.
> > Passing in self.selected_disks just sends in a list of strings
> > (device names),
> > which causes make_unformatted_dasd_list to fail.
> > ---
> >  pyanaconda/ui/gui/spokes/storage.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/pyanaconda/ui/gui/spokes/storage.py
> > b/pyanaconda/ui/gui/spokes/storage.py
> > index 181e97c..6947028 100644
> > --- a/pyanaconda/ui/gui/spokes/storage.py
> > +++ b/pyanaconda/ui/gui/spokes/storage.py
> > @@ -783,7 +783,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
> >  
> >      def _check_dasd_formats(self):
> >          rc = DASD_FORMAT_NO_CHANGE
> > -        dasds =
> > self.storage.devicetree.make_unformatted_dasd_list(self.selected_disk
> > s)
> > +        dasds =
> > self.storage.devicetree.make_unformatted_dasd_list([d for d in
> > self.storage.devicetree.dasd])
> 
> Might as well just pass in self.storage.devicetree.dasd or, if
> you want to make sure you're passing a copy of that list,
> self.storage.devicetree.dasd[:]
 
Yeah that was stupid; I'm not sure what I was(n't) thinking. I believe
just passing in the list itself is fine, so I've made that change
locally; thanks.

Samantha
 
> >          if len(dasds) > 0:
> >              # We want to apply current selection before running
> > dasdfmt to
> >              # prevent this information from being lost afterward
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches


More information about the anaconda-patches mailing list