[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Bug in dasd.py ?



On Wed, 30 Jun 2010, Hans de Goede wrote:

Hi,

I just noticed the following in dasd.py:

           if status in ["unformatted"] and device not in exclusiveDisks:

This seems wrong, as exclusiveDisks is not a list of disks to filter,
but the opposite it is a list of disks which we are allowed to touch,
so the proper test would be:

if status in ["unformatted"] and (not exclusiveDisks or device in exclusiveDisks):

Yeah, this looks like a bug.  Thanks for catching this.

Note that this code likely currently still works properly as
DASD().startup() gets called for the first time from the filter UI when
building the disk list and at this time exclusiveDisks is empty.

I do find this strange though, what is the use of having an
exclusiveDisks parameter to DASD().startup() to allow filtering out dasd's
from dasd formatting if we call DASD().startup() before the user has been
able to select which disks to filter out (and thus to populate
exclusiveDisks).

The dasd.py code came along before the filtering UI we have and, if I'm
remembering correctly, the main reason for the check against exclusiveDisks
was to handle the kickstart use case.  If exclusiveDisks is still populated by
kickstart data when we enter DASD().startup(), we should probably still keep
it.  Otherwise, I do see your point and we could simplify the test.

--
David Cantrell <dcantrell redhat com>
Red Hat / Honolulu, HI


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]