)]}'
{"nova/virt/libvirt/blockinfo.py":[{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"d419aea6f9ec51677a83ad9f19a06972b4ae90f2","unresolved":false,"context_lines":[{"line_number":391,"context_line":"def get_device_name(bdm):"},{"line_number":392,"context_line":"    \"\"\"Get the device name if present regardless of the bdm format.\"\"\""},{"line_number":393,"context_line":"    if isinstance(bdm, block_device_obj.BlockDeviceMapping):"},{"line_number":394,"context_line":"        return bdm.device_name"},{"line_number":395,"context_line":"    else:"},{"line_number":396,"context_line":"        return bdm.get(\u0027device_name\u0027) or bdm.get(\u0027mount_device\u0027)"},{"line_number":397,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2B8as%3D","line":394,"updated":"2014-03-11 05:32:10.000000000","message":"I have a patch at hand before I found yours, and in my patch I checked if it\u0027s drive block device, thus didn\u0027t add the new import of block device object, but not sure if it will have some issue this way.\n\n+    if isinstance(bdm, driver_block_device.DriverBlockDevice):\n\n+        return bdm.get(\u0027device_name\u0027) or bdm.get(\u0027mount_device\u0027)","commit_id":"4aa4133abc06f33c4119423ac77319ea566ce61b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ac36e19d0dfe89e4cec766f3ef3e67911c181b8f","unresolved":false,"context_lines":[{"line_number":391,"context_line":"def get_device_name(bdm):"},{"line_number":392,"context_line":"    \"\"\"Get the device name if present regardless of the bdm format.\"\"\""},{"line_number":393,"context_line":"    if isinstance(bdm, block_device_obj.BlockDeviceMapping):"},{"line_number":394,"context_line":"        return bdm.device_name"},{"line_number":395,"context_line":"    else:"},{"line_number":396,"context_line":"        return bdm.get(\u0027device_name\u0027) or bdm.get(\u0027mount_device\u0027)"},{"line_number":397,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2B4Cg%3D","line":394,"updated":"2014-03-11 15:46:31.000000000","message":"So between patch set 1 and patch set 2 you had to add bdm.get(\u0027mount_device\u0027) back to the non-objects case, but why doesn\u0027t the objects case do:\n\nbdm.device_name or bdm.mount_device?","commit_id":"4aa4133abc06f33c4119423ac77319ea566ce61b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7a45472e9cf355ed84323a669b80e4940241b1b7","unresolved":false,"context_lines":[{"line_number":391,"context_line":"def get_device_name(bdm):"},{"line_number":392,"context_line":"    \"\"\"Get the device name if present regardless of the bdm format.\"\"\""},{"line_number":393,"context_line":"    if isinstance(bdm, block_device_obj.BlockDeviceMapping):"},{"line_number":394,"context_line":"        return bdm.device_name"},{"line_number":395,"context_line":"    else:"},{"line_number":396,"context_line":"        return bdm.get(\u0027device_name\u0027) or bdm.get(\u0027mount_device\u0027)"},{"line_number":397,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2B3NE%3D","line":394,"in_reply_to":"AAAAVn%2F%2B35c%3D","updated":"2014-03-11 17:07:16.000000000","message":"OK, mount_device isn\u0027t a field on the BDM object so yeah, good point.\n\nIt would be nice having a comment in the else case for legacy formats, but I won\u0027t hold up the bug fix for that.","commit_id":"4aa4133abc06f33c4119423ac77319ea566ce61b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"796965b471de1e83c26569285c5ecfaad5f6f5c3","unresolved":false,"context_lines":[{"line_number":391,"context_line":"def get_device_name(bdm):"},{"line_number":392,"context_line":"    \"\"\"Get the device name if present regardless of the bdm format.\"\"\""},{"line_number":393,"context_line":"    if isinstance(bdm, block_device_obj.BlockDeviceMapping):"},{"line_number":394,"context_line":"        return bdm.device_name"},{"line_number":395,"context_line":"    else:"},{"line_number":396,"context_line":"        return bdm.get(\u0027device_name\u0027) or bdm.get(\u0027mount_device\u0027)"},{"line_number":397,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2B4Bc%3D","line":394,"in_reply_to":"AAAAVn%2F%2B4Cg%3D","updated":"2014-03-11 15:47:31.000000000","message":"Sorry, you added bdm.get(\u0027device_name\u0027) back between PS1 and PS2 on line 396.","commit_id":"4aa4133abc06f33c4119423ac77319ea566ce61b"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"2e63782ec36491db2ef71a95dc9666fc68161430","unresolved":false,"context_lines":[{"line_number":391,"context_line":"def get_device_name(bdm):"},{"line_number":392,"context_line":"    \"\"\"Get the device name if present regardless of the bdm format.\"\"\""},{"line_number":393,"context_line":"    if isinstance(bdm, block_device_obj.BlockDeviceMapping):"},{"line_number":394,"context_line":"        return bdm.device_name"},{"line_number":395,"context_line":"    else:"},{"line_number":396,"context_line":"        return bdm.get(\u0027device_name\u0027) or bdm.get(\u0027mount_device\u0027)"},{"line_number":397,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2B35c%3D","line":394,"in_reply_to":"AAAAVn%2F%2B4Cg%3D","updated":"2014-03-11 15:55:32.000000000","message":"yeah... so the bug was that get() on objects does not exactly work like get() on dicts - it blows up if you try a attribute that does not exist on the object.\n\nThe reason we still have the else is that in case it is a DriverBlockDevice and depending on which kind (epehemeral, swap or volume etc.) some of them have either device_name, or mount_device keys (I didn\u0027t invent the format so don\u0027t hate me). Thus the line has to stay.\n\nIn the ps 1 and 2 I forgot that ephemerals and swaps call it device_name, so that\u0027s why I did it. but then quickly I realized.\n\n FWIW it\u0027s easy to check what fields are to be expected on each of those as they are well defined in the classes","commit_id":"4aa4133abc06f33c4119423ac77319ea566ce61b"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"b301560cdeebc42a462cf3d92b58d932915898b9","unresolved":false,"context_lines":[{"line_number":391,"context_line":"def get_device_name(bdm):"},{"line_number":392,"context_line":"    \"\"\"Get the device name if present regardless of the bdm format.\"\"\""},{"line_number":393,"context_line":"    if isinstance(bdm, block_device_obj.BlockDeviceMapping):"},{"line_number":394,"context_line":"        return bdm.device_name"},{"line_number":395,"context_line":"    else:"},{"line_number":396,"context_line":"        return bdm.get(\u0027device_name\u0027) or bdm.get(\u0027mount_device\u0027)"},{"line_number":397,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAVn%2F%2B6iw%3D","line":394,"in_reply_to":"AAAAVn%2F%2B8as%3D","updated":"2014-03-11 10:36:22.000000000","message":"Right - the reason I didn\u0027t go that route is because DriverBlockDevice classes are essentially dicts. And most of the stuff should really work with them being just dicts. This is of course not strictly true as we do have methods on them for for example Volumes that we expect to be there. But following the principle of being liberal in what we accept - this seemed more  appropriate.\n\nAlso that would require fixing more tests that do pass \u0027just dicts\u0027 I believe.","commit_id":"4aa4133abc06f33c4119423ac77319ea566ce61b"}]}
