)]}'
{"nova/virt/xenapi/vm_utils.py":[{"author":{"_account_id":5044,"name":"Mate Lakat","email":"mlakat@suse.com","username":"mate-lakat"},"change_message_id":"0b1ba14ef60beb49aaa37bb13eaf51645e8f9938","unresolved":false,"context_lines":[{"line_number":431,"context_line":"            label \u003d \u0027tempSR-%s\u0027 % dev_params[\u0027volume_id\u0027]"},{"line_number":432,"context_line":"        else:"},{"line_number":433,"context_line":"            label \u003d dev_params[\u0027name_label\u0027]"},{"line_number":434,"context_line":"            del dev_params[\u0027name_label\u0027]"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        if \u0027name_description\u0027 not in dev_params:"},{"line_number":437,"context_line":"            desc \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FHi0%3D","line":434,"updated":"2012-10-16 12:34:43.000000000","message":"I think it is not really a good idea to modify the input parameter of a function\nA separate function: get_name_label would be more useful","commit_id":"2b96874dad5000ecfe22df209b6aad9d7f87971c"},{"author":{"_account_id":5044,"name":"Mate Lakat","email":"mlakat@suse.com","username":"mate-lakat"},"change_message_id":"0b1ba14ef60beb49aaa37bb13eaf51645e8f9938","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        if \u0027name_description\u0027 not in dev_params:"},{"line_number":437,"context_line":"            desc \u003d \u0027\u0027"},{"line_number":438,"context_line":"        else:"},{"line_number":439,"context_line":"            desc \u003d dev_params[\u0027name_description\u0027]"},{"line_number":440,"context_line":"        sr_params \u003d {}"},{"line_number":441,"context_line":"        for k in dev_params[\u0027introduce_sr_keys\u0027]:"},{"line_number":442,"context_line":"            sr_params[k] \u003d dev_params[k]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FHhg%3D","line":439,"updated":"2012-10-16 12:34:43.000000000","message":"this could also be extracted to a separate function ~ get_description","commit_id":"2b96874dad5000ecfe22df209b6aad9d7f87971c"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"aa81838b009cb7e2097be9f381e93a825b9c70d7","unresolved":false,"context_lines":[{"line_number":435,"context_line":"        if \u0027name_description\u0027 not in dev_params:"},{"line_number":436,"context_line":"            desc \u003d \u0027\u0027"},{"line_number":437,"context_line":"        else:"},{"line_number":438,"context_line":"            desc \u003d dev_params.get(\u0027name_description\u0027)"},{"line_number":439,"context_line":"        sr_params \u003d {}"},{"line_number":440,"context_line":"        for k in dev_params[\u0027introduce_sr_keys\u0027]:"},{"line_number":441,"context_line":"            sr_params[k] \u003d dev_params[k]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALn%2F%2F%2FhQ%3D","line":438,"updated":"2012-10-22 20:52:47.000000000","message":"Could potentially be written more concisely like:\n\ndesc \u003d dev_params.get(\u0027name_description\u0027, \u0027\u0027)\n\nSame thing for label.","commit_id":"f569727491544a0cffbbaa7174234142a275082f"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"aa81838b009cb7e2097be9f381e93a825b9c70d7","unresolved":false,"context_lines":[{"line_number":438,"context_line":"            desc \u003d dev_params.get(\u0027name_description\u0027)"},{"line_number":439,"context_line":"        sr_params \u003d {}"},{"line_number":440,"context_line":"        for k in dev_params[\u0027introduce_sr_keys\u0027]:"},{"line_number":441,"context_line":"            sr_params[k] \u003d dev_params[k]"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        sr_params[\u0027name_description\u0027] \u003d desc"},{"line_number":444,"context_line":"        sr_ref \u003d volume_utils.introduce_sr(session, sr_uuid, label,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALn%2F%2F%2FhU%3D","line":441,"updated":"2012-10-22 20:52:47.000000000","message":"If `introduce_sr` doesn\u0027t mutate the `sr_params` dict, we could just pass in dev_params[\u0027introduce_sr_keys\u0027] directly w/o making a copy.","commit_id":"f569727491544a0cffbbaa7174234142a275082f"},{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"f70c64d426a3a045a32b0e18a39cd16ea0ec0e1f","unresolved":false,"context_lines":[{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    if sr_ref is None:"},{"line_number":448,"context_line":"        raise exception.NovaException(_(\u0027SR not present and could not be \u0027"},{"line_number":449,"context_line":"                                        \u0027introduced\u0027))"},{"line_number":450,"context_line":"    else:"},{"line_number":451,"context_line":"        session.call_xenapi(\"SR.scan\", sr_ref)"},{"line_number":452,"context_line":"        return {\u0027root\u0027: dict(uuid\u003ddev_params[\u0027vdi_uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALn%2F%2F%2Fpc%3D","line":449,"updated":"2012-10-22 17:52:19.000000000","message":"seems like this should be a new exception? Or does this file just use NovaException in other places?","commit_id":"f569727491544a0cffbbaa7174234142a275082f"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"f2132b59cf5783c78ec3d7889c66ff723cb501fa","unresolved":false,"context_lines":[{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    if sr_ref is None:"},{"line_number":448,"context_line":"        raise exception.NovaException(_(\u0027SR not present and could not be \u0027"},{"line_number":449,"context_line":"                                        \u0027introduced\u0027))"},{"line_number":450,"context_line":"    else:"},{"line_number":451,"context_line":"        session.call_xenapi(\"SR.scan\", sr_ref)"},{"line_number":452,"context_line":"        return {\u0027root\u0027: dict(uuid\u003ddev_params[\u0027vdi_uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALn%2F%2F%2Fmo%3D","line":449,"in_reply_to":"AAAALn%2F%2F%2Fpc%3D","updated":"2012-10-22 18:46:41.000000000","message":"I think the tendency here (though not written in stone anywhere) is to use separate exception classes where the caller is intended to handle it explicitly.\n\nIn cases where the caller is just expected to re-raise the exception, dropping a traceback in the logs, we usually just use Exception or NovaException and add an ops-friendly message to it.","commit_id":"f569727491544a0cffbbaa7174234142a275082f"}]}
