[master] Add option to select all hard drives in text mode. (#965580)
Samantha N. Bueno
sbueno+anaconda at redhat.com
Fri Oct 18 17:22:18 UTC 2013
On Fri, Oct 18, 2013 at 01:04:17PM -0400, David Shea wrote:
> On 10/18/2013 12:08 PM, Samantha N. Bueno wrote:
> > def input(self, args, key):
> > """Grab the disk choice and update things"""
> > try:
> > keyid = int(key) - 1
> >- self._update_disk_list(self.disks[keyid])
> >+ self.selection = keyid
> >+ if keyid == len(self.disks):
> >+ self._select_all_disks()
> >+ else:
> >+ self._update_disk_list(self.disks[keyid])
> > return INPUT_PROCESSED
> > except (ValueError, IndexError):
> > if key.lower() == "c":
> This part is still active if there's only one disk. So I could hit
> "2" and it would select all one disk, whereas before it would just
> tell me to pick again because 2 isn't a thing.
Oh, good catch. How about something like this:
try:
keyid = int(key) - 1
self.selection = keyid
if len(self.disks) > 1 and keyid == len(self.disks):
self._select_all_disks()
....
That should fix it.
Samantha
More information about the anaconda-patches
mailing list