Review Request 219: Simplify error handling of FormatProvider.get_format_for_id and get_format_for_name.

Jan Safranek reviewboard at gallagherhome.com
Fri Apr 19 15:01:17 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard-openlmi.rhcloud.com/r/219/
-----------------------------------------------------------

(Updated April 19, 2013, 5:01 p.m.)


Status
------

This change has been marked as submitted.


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/20130419/d44c2896/attachment.html>


More information about the openlmi-devel mailing list