)]}'
{"plugins/xenserver/xenapi/etc/xapi.d/plugins/glance":[{"author":{"_account_id":7353,"name":"Kevin Carter","email":"kevin@cloudnull.com","username":"cloudnull"},"change_message_id":"40dbf086dd49236802d7de7407030073c8bb1d8b","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    # NOTE(johngarbutt) to ensure the script does not hang"},{"line_number":263,"context_line":"    # if we lose connection to glance we add a default socket"},{"line_number":264,"context_line":"    # The default is to never timeout."},{"line_number":265,"context_line":"    socket.setdefaulttimeout(DEFAULT_SOCKET_TIMEOUT_SECONDS)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    utils.register_plugin_calls(download_vhd, upload_vhd)"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAWH%2F9VCE%3D","line":265,"updated":"2014-04-07 00:54:09.000000000","message":"If the idea is to make the default socket timeout 90 seconds for everything this should be a global. As this stands this would only ever be called if the plugin was executed directly which would set the module name to \"__main__\".  Being that this is a plugin and likely imported more often than executed this would never be instantiated and the socket timeout would be set to the system\u0027s default.  I would recommend moving the modified default socket timeout into the methods that you would like to use it, IE \"_download_tarball_and_verify\", and \"_upload_tarball\", or change it to be a global.","commit_id":"28ca8dd2ad35f59a932633f6ddd8656b8b520ff9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"a0039edc7ba8c5d566cf73282a2bdcd211d71c30","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    # NOTE(johngarbutt) to ensure the script does not hang"},{"line_number":263,"context_line":"    # if we lose connection to glance we add a default socket"},{"line_number":264,"context_line":"    # The default is to never timeout."},{"line_number":265,"context_line":"    socket.setdefaulttimeout(DEFAULT_SOCKET_TIMEOUT_SECONDS)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    utils.register_plugin_calls(download_vhd, upload_vhd)"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAWH%2F9TNI%3D","line":265,"in_reply_to":"AAAAWH%2F9TWM%3D","updated":"2014-04-07 09:23:21.000000000","message":"See: http://wiki.xenproject.org/wiki/XAPI_Host_Plugins","commit_id":"28ca8dd2ad35f59a932633f6ddd8656b8b520ff9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5fcf6762a8b0736921995f65276a17713923cedf","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    # NOTE(johngarbutt) to ensure the script does not hang"},{"line_number":263,"context_line":"    # if we lose connection to glance we add a default socket"},{"line_number":264,"context_line":"    # The default is to never timeout."},{"line_number":265,"context_line":"    socket.setdefaulttimeout(DEFAULT_SOCKET_TIMEOUT_SECONDS)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    utils.register_plugin_calls(download_vhd, upload_vhd)"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAWH%2F9TWM%3D","line":265,"in_reply_to":"AAAAWH%2F9VCE%3D","updated":"2014-04-07 09:05:10.000000000","message":"I am 90% certain that is how XenAPI loads the plugins, the plugins are have to call the method below to register the functions, and this is re-called on every call the a XenAPI plugin.\n\nHowever, I am happy to move this into back into each method, its probably clearer what is happening that way. I just didn\u0027t like the repeated code that way.","commit_id":"28ca8dd2ad35f59a932633f6ddd8656b8b520ff9"}],"plugins/xenserver/xenapi/etc/xapi.d/plugins/utils.py":[{"author":{"_account_id":7353,"name":"Kevin Carter","email":"kevin@cloudnull.com","username":"cloudnull"},"change_message_id":"40dbf086dd49236802d7de7407030073c8bb1d8b","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    kill_process_cmd \u003d [\"kill\", \"-9\", str(pid)]"},{"line_number":124,"context_line":"    # NOTE(johngarbutt) can\u0027t use proc.kill() because"},{"line_number":125,"context_line":"    # this code is run in python 2.4"},{"line_number":126,"context_line":"    run_command(kill_process_cmd)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def make_staging_area(sr_path):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAWH%2F9VBY%3D","line":126,"updated":"2014-04-07 00:54:09.000000000","message":"I would like to see this not be a subprocess call but rather use the os module to kill the pid. The \"os\" module is already imported and being that it already provides a way to kill a running process I think that it would be cleaner to do \u003e\u003e\u003e os.kill(pid, 9)\n\nMore details on that here:\nhttps://docs.python.org/2/library/os.html#os.kill","commit_id":"28ca8dd2ad35f59a932633f6ddd8656b8b520ff9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5fcf6762a8b0736921995f65276a17713923cedf","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    kill_process_cmd \u003d [\"kill\", \"-9\", str(pid)]"},{"line_number":124,"context_line":"    # NOTE(johngarbutt) can\u0027t use proc.kill() because"},{"line_number":125,"context_line":"    # this code is run in python 2.4"},{"line_number":126,"context_line":"    run_command(kill_process_cmd)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def make_staging_area(sr_path):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAWH%2F9TW0%3D","line":126,"in_reply_to":"AAAAWH%2F9VBY%3D","updated":"2014-04-07 09:05:10.000000000","message":"I would love to use that too, but this in python 2.6 code, and that function was added in python 2.7.","commit_id":"28ca8dd2ad35f59a932633f6ddd8656b8b520ff9"},{"author":{"_account_id":8430,"name":"Christopher Lefelhocz","email":"christopher.lefelhoc@rackspace.com","username":"leif"},"change_message_id":"6f677cb581f5e39fba123f4c4a4d21d42ed5ee62","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    try:"},{"line_number":126,"context_line":"        os.kill(pid, signal.SIGKILL)"},{"line_number":127,"context_line":"    except Exception:"},{"line_number":128,"context_line":"        LOG.exception(\"Failed to kill %s\" % pid)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"def make_staging_area(sr_path):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAWn%2F%2F6O8%3D","line":128,"updated":"2014-04-08 15:04:36.000000000","message":"This seems like the wrong level.\n\nIn the case where the process doesn\u0027t exist we just want to debug it as it isn\u0027t an exceptional condition.  \n\nI\u0027m okay with leaving it as exception if you disagree.","commit_id":"6b578665d4573b248e01ae5e0a77f200833c3b5c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"44d920e444a7749d2f8cef0b326e53a882ab59c9","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    try:"},{"line_number":126,"context_line":"        os.kill(pid, signal.SIGKILL)"},{"line_number":127,"context_line":"    except Exception:"},{"line_number":128,"context_line":"        LOG.exception(\"Failed to kill %s\" % pid)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"def make_staging_area(sr_path):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAW3%2F%2F9iw%3D","line":128,"in_reply_to":"AAAAWn%2F%2F5lg%3D","updated":"2014-04-09 08:19:36.000000000","message":"Yeah, its just the traceback I was wanting here.","commit_id":"6b578665d4573b248e01ae5e0a77f200833c3b5c"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"48d17373d1af8ec8a5ae58738886626d4769a1a1","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    try:"},{"line_number":126,"context_line":"        os.kill(pid, signal.SIGKILL)"},{"line_number":127,"context_line":"    except Exception:"},{"line_number":128,"context_line":"        LOG.exception(\"Failed to kill %s\" % pid)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"def make_staging_area(sr_path):"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAWn%2F%2F5lg%3D","line":128,"in_reply_to":"AAAAWn%2F%2F6O8%3D","updated":"2014-04-08 16:27:10.000000000","message":"This makes sense to me, though I usually like to have the traceback just in case. I\u0027ve been bitten multiple times in this  code base where it was assumed all possible reasons something would fail are know, and instead the real error is masked by presumptuous logging","commit_id":"6b578665d4573b248e01ae5e0a77f200833c3b5c"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"0a9625fac6d179f1054348ecbc4fd9f8fc858cac","unresolved":false,"context_lines":[{"line_number":400,"context_line":""},{"line_number":401,"context_line":"            if fileobj:"},{"line_number":402,"context_line":"                fileobj.write(chunk)"},{"line_number":403,"context_line":"    except Exception:"},{"line_number":404,"context_line":"        try_kill_process(tar_proc)"},{"line_number":405,"context_line":"        raise"},{"line_number":406,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAW3%2F%2FsKk%3D","line":403,"updated":"2014-04-11 05:29:43.000000000","message":"Should this exception be more specific?","commit_id":"6b578665d4573b248e01ae5e0a77f200833c3b5c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6ff88c8d8c2b86f981bf542a31174fc18e520f04","unresolved":false,"context_lines":[{"line_number":400,"context_line":""},{"line_number":401,"context_line":"            if fileobj:"},{"line_number":402,"context_line":"                fileobj.write(chunk)"},{"line_number":403,"context_line":"    except Exception:"},{"line_number":404,"context_line":"        try_kill_process(tar_proc)"},{"line_number":405,"context_line":"        raise"},{"line_number":406,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAW3%2F%2Fos4%3D","line":403,"in_reply_to":"AAAAW3%2F%2FsKk%3D","updated":"2014-04-11 14:22:34.000000000","message":"it was intentionally broad, given the callback could fail in any way.","commit_id":"6b578665d4573b248e01ae5e0a77f200833c3b5c"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"0a9625fac6d179f1054348ecbc4fd9f8fc858cac","unresolved":false,"context_lines":[{"line_number":427,"context_line":"                callback(chunk)"},{"line_number":428,"context_line":""},{"line_number":429,"context_line":"            tar_proc.stdin.write(chunk)"},{"line_number":430,"context_line":"    except Exception:"},{"line_number":431,"context_line":"        try_kill_process(tar_proc)"},{"line_number":432,"context_line":"        raise"},{"line_number":433,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAW3%2F%2FsKc%3D","line":430,"updated":"2014-04-11 05:29:43.000000000","message":"Ditto.","commit_id":"6b578665d4573b248e01ae5e0a77f200833c3b5c"}]}
