[rhinstaller/blivet/pulls/161 master] Don't fail in storage.py:isNameValid when name is None

mulkieran installerbot-noreply at redhat.com
Mon Jun 22 16:44:04 UTC 2015


Thanks for the patch.

Yes, that is a bad way to fail. But...

Let's assume that you are correct and that all subclasses of StorageDevice should have a name that is not None. Many subclasses of StorageDevice override StorageDevice.isNameValid w/out invoking it. So, your patch would introduce a behavior where sometimes a TypeError or AttributeError is raised, and sometimes False is returned. More  method surgery is needed to get this patch to work properly and get the intended result. Probably the actual checks on strings should be lowered into an internal method, like ```_isNameValid```, while ```isNameValid``` would only handle issues about None. It should also be noted that ```Device.isNameValid``` _might_ be the place to make this change, not ```StorageDevice.isNameValid```.

Alternatively, there may be some devices that are subset of StorageDevice that do not require a name that is not None. In that case, this patch would be wrong. I don't think that is true, but the possibility needs to be eliminated, especially before additional work is done.

@dwlehman: Is it the case that all StorageDevices should have a name that is not None when created?





-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/161


More information about the anaconda-patches mailing list