Review Request 219: Simplify error handling of FormatProvider.get_format_for_id and get_format_for_name.
Jan Safranek
reviewboard at gallagherhome.com
Tue Apr 16 13:08:07 UTC 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard-openlmi.rhcloud.com/r/219/
-----------------------------------------------------------
Review request for OpenLMI Developers.
Repository: openlmi-storage
Description
-------
Simplify error handling of FormatProvider.get_format_for_id and get_format_for_name.
With tuple (None, None) returned, following code can be used for error
handling:
(device, fmt) = fmtprovider.get_format_for_name(...)
if not device:
raise ...
With None, the unpacking would not be possible.
Also extend the documentation to explicitly state which device is returned.
Diffs
-----
src/openlmi/storage/FormatProvider.py 611e9012ea9fbecae788cb1bfa1c635ff4f16c33
Diff: http://reviewboard-openlmi.rhcloud.com/r/219/diff/
Testing
-------
Thanks,
Jan Safranek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/openlmi-devel/attachments/20130416/aeed30fc/attachment-0001.html>
More information about the openlmi-devel
mailing list